Skip to content

Commit

Permalink
[SYNC] Sync phnt
Browse files Browse the repository at this point in the history
  • Loading branch information
RatinCN committed Sep 23, 2024
1 parent c500ed2 commit 8a97cb8
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ The content from the following public sources were lawfully used:
- Windows Internals

And public projects:
- phnt (from [winsiderss/systeminformer](https://github.com/winsiderss/systeminformer), [commit ec15fef2](https://github.com/winsiderss/systeminformer/commit/ec15fef23bff3e94ce2621a4f3eb67a1b493cb35)) - [MIT](https://github.com/winsiderss/phnt/blob/master/LICENSE)
- phnt (from [winsiderss/systeminformer](https://github.com/winsiderss/systeminformer), [commit 6a372fc5](https://github.com/winsiderss/systeminformer/commit/6a372fc5167e3c27230dee84644817c5e54ef5ed)) - [MIT](https://github.com/winsiderss/phnt/blob/master/LICENSE)

[KNSoft.NDK](https://github.com/KNSoft/KNSoft.NDK) also uses [KNSoft/Precomp4C](https://github.com/KNSoft/Precomp4C) to generate DLL import libraries.
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ NuGet包[KNSoft.NDK](https://www.nuget.org/packages/KNSoft.NDK)包含所有头
- Windows Internals

和公开项目:
- phnt(来自[winsiderss/systeminformer](https://github.com/winsiderss/systeminformer)[提交 ec15fef2](https://github.com/winsiderss/systeminformer/commit/ec15fef23bff3e94ce2621a4f3eb67a1b493cb35))- [MIT](https://github.com/winsiderss/phnt/blob/master/LICENSE)
- phnt(来自[winsiderss/systeminformer](https://github.com/winsiderss/systeminformer)[提交 6a372fc5](https://github.com/winsiderss/systeminformer/commit/6a372fc5167e3c27230dee84644817c5e54ef5ed))- [MIT](https://github.com/winsiderss/phnt/blob/master/LICENSE)

[KNSoft.NDK](https://github.com/KNSoft/KNSoft.NDK)也使用了[KNSoft/Precomp4C](https://github.com/KNSoft/Precomp4C)来生成DLL引入库。
10 changes: 9 additions & 1 deletion Source/Include/KNSoft/NDK/NT/MinDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ typedef SID* PSID;
#pragma region Basic Types

typedef unsigned __int64 QWORD, near* PQWORD, far* LPQWORD;
typedef double *PDOUBLE;
typedef DOUBLE *PDOUBLE;

#define MAKEDWORD(l, h) ((DWORD)(((WORD)(((DWORD_PTR)(l)) & 0xffff)) | ((DWORD)((WORD)(((DWORD_PTR)(h)) & 0xffff))) << 16))
#define MAKEQWORD(l, h) ((QWORD)(((DWORD)(((DWORD_PTR)(l)) & 0xffffffff)) | ((QWORD)((DWORD)(((DWORD_PTR)(h)) & 0xffffffff))) << 32))
Expand All @@ -273,9 +273,17 @@ typedef double *PDOUBLE;

#define DECLSPEC_ALLOCATOR __declspec(allocator)
#define DECLSPEC_EXPORT __declspec(dllexport)
#define DECLSPEC_NOALIAS __declspec(noalias)

EXTERN_C IMAGE_DOS_HEADER __ImageBase;

#if __STDC_VERSION__ >= 202311L
#ifndef __cplusplus
#define nullptr ((void *)0)
#endif
typedef __typeof__(nullptr) nullptr_t;
#endif

#pragma endregion

#pragma region Types
Expand Down
2 changes: 2 additions & 0 deletions Source/Include/KNSoft/NDK/NT/Rtl/Heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ _Ret_maybenull_
_Post_writable_byte_size_(Size)
__drv_allocatesMem(Mem)
DECLSPEC_ALLOCATOR
DECLSPEC_NOALIAS
DECLSPEC_RESTRICT
PVOID
NTAPI
Expand Down Expand Up @@ -362,6 +363,7 @@ _Ret_maybenull_
_Post_writable_byte_size_(Size)
_When_(Size > 0, __drv_allocatesMem(Mem))
DECLSPEC_ALLOCATOR
DECLSPEC_NOALIAS
DECLSPEC_RESTRICT
PVOID
NTAPI
Expand Down
44 changes: 43 additions & 1 deletion Source/Include/KNSoft/NDK/NT/Win32K/Misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,48 @@ NtUserQueryWindow(
_In_ WINDOWINFOCLASS WindowInfo
);

NTSYSCALLAPI
NTSTATUS
NTAPI
NtUserTestForInteractiveUser(
_In_ PLUID AuthenticationId
);

NTSYSCALLAPI
NTSTATUS
NTAPI
NtUserCheckAccessForIntegrityLevel(
_In_ ULONG ProcessIdFirst,
_In_ ULONG ProcessIdSecond,
_Out_ PBOOLEAN GrantedAccess
);

NTSYSCALLAPI
NTSTATUS
NTAPI
NtUserCheckProcessForClipboardAccess(
_In_ ULONG ProcessId,
_Out_ PULONG GrantedAccess
);

NTSYSCALLAPI
ULONG
NTAPI
NtUserInternalGetWindowText(
_In_ HWND WindowHandle,
_Out_writes_to_(cchMaxCount, return + 1) LPWSTR pString,
_In_ ULONG cchMaxCount
);

NTSYSCALLAPI
ULONG
NTAPI
NtUserGetClassName(
_In_ HWND WindowHandle,
_In_ LONGLONG Real,
_Out_ PUNICODE_STRING ClassName
);

typedef enum _CONSOLECONTROL
{
ConsoleSetVDMCursorBounds = 0, // RECT
Expand Down Expand Up @@ -74,7 +116,7 @@ typedef struct _CONSOLEENDTASK
} CONSOLEENDTASK, *PCONSOLEENDTASK;

/**
* Performs special kernel operations for console host applications.
* Performs special kernel operations for console host applications. (win32u.dll)
*
* This includes reparenting the console window, allowing the console to pass foreground rights
* on to launched console subsystem applications and terminating attached processes.
Expand Down
9 changes: 9 additions & 0 deletions Source/Include/KNSoft/NDK/Win32/API/User32.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,13 @@ EndTask(
BOOL fShutDown,
BOOL fForce);

/* See also NtUserConsoleControl */
NTSYSCALLAPI
NTSTATUS
NTAPI
ConsoleControl(
_In_ CONSOLECONTROL Command,
_In_reads_bytes_(ConsoleInformationLength) PVOID ConsoleInformation,
_In_ ULONG ConsoleInformationLength);

EXTERN_C_END
5 changes: 2 additions & 3 deletions Source/Include/KNSoft/NDK/Win32/API/WinSta.h
Original file line number Diff line number Diff line change
Expand Up @@ -1188,14 +1188,13 @@ WinStationIsSessionRemoteable(
_Out_ PBOOLEAN IsRemote
);


// rev
NTSYSAPI
BOOLEAN
NTAPI
WinStationSetAutologonPassword(
_In_ PCSTR SessionId,
_In_ PCSTR Name
_In_ PCSTR KeyName,
_In_ PCSTR Password
);

typedef enum _SessionType
Expand Down

0 comments on commit 8a97cb8

Please sign in to comment.