Pull upstream changes from TELY UI
This commit is contained in:
1 parent
7147ad52a2
commit
d5c98d5288
20 files changed
+17900
-10682
No files matched your search
+565
-21
@@ -14,6 +14,10 @@
|
||||
#pragma comment(lib, "Shell32") // ShellExecuteW
|
||||
#pragma comment(lib, "shlwapi")
|
||||
#pragma comment(lib, "user32")
|
||||
#pragma comment(lib, "pdh") // DN_Os_SysMonitor GPU/thermal counters
|
||||
#pragma comment(lib, "iphlpapi") // DN_Os_SysMonitor network counters
|
||||
#pragma comment(lib, "gdi32") // DN_Os_SysMonitor D3DKMT queries
|
||||
#pragma comment(lib, "powrprof") // DN_Os_SysMonitor CPU clock speed
|
||||
|
||||
// TODO: Technically we only need this library for custom window titlebars to get access to DWM
|
||||
// functions. Otherwise this API surface is not used in the DN OS layer.
|
||||
@@ -24,7 +28,7 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h> // LONG
|
||||
#include <dwmapi.h> // DwmExtendFrameIntoClientArea...
|
||||
#include <bcrypt.h> // DN_OS_SecureRNGBytes -> BCryptOpenAlgorithmProvider ... etc
|
||||
#include <bcrypt.h> // DN_Os_SecureRNGBytes -> BCryptOpenAlgorithmProvider ... etc
|
||||
#include <shellapi.h> // DN_Win_MakeProcessDPIAware -> SetProcessDpiAwareProc
|
||||
#include <ShellScalingApi.h> // MONITOR_DPI_TYPE
|
||||
#include <shlwapi.h> // PathRelativePathTO
|
||||
@@ -34,6 +38,12 @@
|
||||
#include <commdlg.h> // OPENFILENAMEW
|
||||
#include <DbgHelp.h>
|
||||
#include <windowsx.h> // GET_X_PARAM
|
||||
#include <pdh.h> // DN_Os_SysMonitor GPU and thermal counters
|
||||
#include <pdhmsg.h> // PDH status codes
|
||||
#include <iphlpapi.h> // DN_Os_SysMonitor network counters
|
||||
#include <d3dkmthk.h> // DN_Os_SysMonitor GPU temperature
|
||||
#include <winioctl.h> // DN_Os_SysMonitor drive temperatures
|
||||
#include <powrprof.h> // DN_Os_SysMonitor CPU clock speed
|
||||
#else
|
||||
DN_MSVC_WARNING_PUSH
|
||||
DN_MSVC_WARNING_DISABLE(4201) // warning C4201: nonstandard extension used: nameless struct/union
|
||||
@@ -85,6 +95,8 @@
|
||||
// NOTE: shared/winerror.h /////////////////////////////////////////////////////////////////////
|
||||
// NOTE: GetModuleFileNameW
|
||||
#define ERROR_INSUFFICIENT_BUFFER 122L // dderror
|
||||
#define ERROR_SUCCESS 0L
|
||||
#define NO_ERROR 0L
|
||||
|
||||
// NOTE: um/winnls.h ///////////////////////////////////////////////////////////////////////////
|
||||
// NOTE: MultiByteToWideChar
|
||||
@@ -100,11 +112,22 @@
|
||||
typedef long LONG;
|
||||
typedef wchar_t WCHAR; // wc, 16-bit UNICODE character
|
||||
typedef CHAR * NPSTR, *LPSTR, *PSTR;
|
||||
typedef const CHAR * LPCSTR, *PCSTR;
|
||||
typedef WCHAR * NWPSTR, *LPWSTR, *PWSTR;
|
||||
typedef const WCHAR* LPCWSTR, *PCWSTR;
|
||||
typedef long HRESULT;
|
||||
typedef ULONGLONG DWORDLONG;
|
||||
|
||||
#define ANYSIZE_ARRAY 1
|
||||
|
||||
typedef struct _LUID {
|
||||
DWORD LowPart;
|
||||
LONG HighPart;
|
||||
} LUID, *PLUID;
|
||||
|
||||
typedef UINT POWER_INFORMATION_LEVEL;
|
||||
#define ProcessorInformation 11
|
||||
|
||||
// NOTE: VirtualAlloc: Allocation Type
|
||||
#define MEM_RESERVE 0x00002000
|
||||
#define MEM_COMMIT 0x00001000
|
||||
@@ -357,8 +380,10 @@
|
||||
#define SLMFLAG_ALT_INDEX 0x2
|
||||
#define SLMFLAG_NO_SYMBOLS 0x4
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) VOID __stdcall RtlCaptureContext(CONTEXT *ContextRecord);
|
||||
__declspec(dllimport) HANDLE __stdcall GetCurrentProcess(void);
|
||||
__declspec(dllimport) HANDLE __stdcall GetCurrentThread(void);
|
||||
@@ -366,11 +391,15 @@
|
||||
__declspec(dllimport) BOOL __stdcall SymInitialize(HANDLE hProcess, const CHAR* UserSearchPath, BOOL fInvadeProcess);
|
||||
__declspec(dllimport) DWORD64 __stdcall SymLoadModuleEx(HANDLE hProcess, HANDLE hFile, CHAR const *ImageName, CHAR const *ModuleName, DWORD64 BaseOfDll, DWORD DllSize, MODLOAD_DATA *Data, DWORD Flags);
|
||||
__declspec(dllimport) BOOL __stdcall SymUnloadModule64(HANDLE hProcess, DWORD64 BaseOfDll);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/heapapi.h ////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) HANDLE __stdcall HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize);
|
||||
__declspec(dllimport) BOOL __stdcall HeapDestroy(HANDLE hHeap);
|
||||
__declspec(dllimport) VOID * __stdcall HeapAlloc(HANDLE hHeap, DWORD dwFlags,SIZE_T dwBytes);
|
||||
@@ -379,7 +408,9 @@
|
||||
__declspec(dllimport) SIZE_T __stdcall HeapSize(HANDLE hHeap, DWORD dwFlags, VOID const *lpMem);
|
||||
__declspec(dllimport) HANDLE __stdcall GetProcessHeap(VOID);
|
||||
__declspec(dllimport) SIZE_T __stdcall HeapCompact(HANDLE hHeap, DWORD dwFlags);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: shared/windef.h ////////////////////////////////////////////////////////////////////
|
||||
typedef struct tagPOINT
|
||||
@@ -393,23 +424,133 @@
|
||||
};
|
||||
typedef struct HMONITOR__ *HMONITOR;
|
||||
|
||||
// NOTE: shared/guiddef.h //////////////////////////////////////////////////////////////////////
|
||||
typedef struct _GUID {
|
||||
DWORD Data1;
|
||||
WORD Data2;
|
||||
WORD Data3;
|
||||
BYTE Data4[8];
|
||||
} GUID, *LPGUID;
|
||||
|
||||
// NOTE: shared/ifdef.h ////////////////////////////////////////////////////////////////////////
|
||||
#define IF_MAX_STRING_SIZE 256
|
||||
#define IF_MAX_PHYS_ADDRESS_LENGTH 32
|
||||
|
||||
typedef union _NET_LUID_LH {
|
||||
ULONG64 Value;
|
||||
struct {
|
||||
ULONG64 Reserved : 24;
|
||||
ULONG64 NetLuidIndex: 24;
|
||||
ULONG64 IfType : 16;
|
||||
} Info;
|
||||
} NET_LUID_LH, *PNET_LUID_LH;
|
||||
typedef NET_LUID_LH NET_LUID;
|
||||
typedef GUID NET_IF_NETWORK_GUID;
|
||||
typedef ULONG NET_IFINDEX;
|
||||
|
||||
typedef ULONG IF_OPER_STATUS;
|
||||
#define IfOperStatusUp 1
|
||||
|
||||
// NOTE: shared/ipifcons.h /////////////////////////////////////////////////////////////////////
|
||||
typedef ULONG IFTYPE;
|
||||
#define IF_TYPE_SOFTWARE_LOOPBACK 24
|
||||
|
||||
// NOTE: shared/netioapi.h /////////////////////////////////////////////////////////////////////
|
||||
#define ANY_SIZE 1
|
||||
|
||||
typedef struct _MIB_IF_ROW2 {
|
||||
NET_LUID InterfaceLuid;
|
||||
NET_IFINDEX InterfaceIndex;
|
||||
GUID InterfaceGuid;
|
||||
WCHAR Alias[IF_MAX_STRING_SIZE + 1];
|
||||
WCHAR Description[IF_MAX_STRING_SIZE + 1];
|
||||
ULONG PhysicalAddressLength;
|
||||
UCHAR PhysicalAddress[IF_MAX_PHYS_ADDRESS_LENGTH];
|
||||
UCHAR PermanentPhysicalAddress[IF_MAX_PHYS_ADDRESS_LENGTH];
|
||||
ULONG Mtu;
|
||||
IFTYPE Type;
|
||||
ULONG TunnelType;
|
||||
ULONG MediaType;
|
||||
ULONG PhysicalMediumType;
|
||||
ULONG AccessType;
|
||||
ULONG DirectionType;
|
||||
struct {
|
||||
UCHAR HardwareInterface : 1;
|
||||
UCHAR FilterInterface : 1;
|
||||
UCHAR ConnectorPresent : 1;
|
||||
UCHAR NotAuthenticated : 1;
|
||||
UCHAR NotMediaConnected : 1;
|
||||
UCHAR Paused : 1;
|
||||
UCHAR LowPower : 1;
|
||||
UCHAR EndPointInterface : 1;
|
||||
} InterfaceAndOperStatusFlags;
|
||||
IF_OPER_STATUS OperStatus;
|
||||
ULONG AdminStatus;
|
||||
ULONG MediaConnectState;
|
||||
NET_IF_NETWORK_GUID NetworkGuid;
|
||||
ULONG ConnectionType;
|
||||
ULONG64 TransmitLinkSpeed;
|
||||
ULONG64 ReceiveLinkSpeed;
|
||||
ULONG64 InOctets;
|
||||
ULONG64 InUcastPkts;
|
||||
ULONG64 InNUcastPkts;
|
||||
ULONG64 InDiscards;
|
||||
ULONG64 InErrors;
|
||||
ULONG64 InUnknownProtos;
|
||||
ULONG64 InUcastOctets;
|
||||
ULONG64 InMulticastOctets;
|
||||
ULONG64 InBroadcastOctets;
|
||||
ULONG64 OutOctets;
|
||||
ULONG64 OutUcastPkts;
|
||||
ULONG64 OutNUcastPkts;
|
||||
ULONG64 OutDiscards;
|
||||
ULONG64 OutErrors;
|
||||
ULONG64 OutUcastOctets;
|
||||
ULONG64 OutMulticastOctets;
|
||||
ULONG64 OutBroadcastOctets;
|
||||
ULONG64 OutQLen;
|
||||
} MIB_IF_ROW2, *PMIB_IF_ROW2;
|
||||
|
||||
typedef struct _MIB_IF_TABLE2 {
|
||||
ULONG NumEntries;
|
||||
MIB_IF_ROW2 Table[ANY_SIZE];
|
||||
} MIB_IF_TABLE2, *PMIB_IF_TABLE2;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) DWORD __stdcall GetIfTable2 (MIB_IF_TABLE2 **Table);
|
||||
__declspec(dllimport) VOID __stdcall FreeMibTable (VOID *Memory);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: handleapi.h ///////////////////////////////////////////////////////////////////////////
|
||||
#define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall CloseHandle(HANDLE hObject);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: consoleapi.h ///////////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall WriteConsoleW(HANDLE hConsoleOutput, const VOID* lpBuffer, DWORD nNumberOfCharsToWrite, DWORD *lpNumberOfCharsWritten, VOID *lpReserved);
|
||||
__declspec(dllimport) BOOL __stdcall AllocConsole(VOID);
|
||||
__declspec(dllimport) BOOL __stdcall FreeConsole(VOID);
|
||||
__declspec(dllimport) BOOL __stdcall AttachConsole(DWORD dwProcessId);
|
||||
__declspec(dllimport) BOOL __stdcall GetConsoleMode(HANDLE hConsoleHandle, DWORD *lpMode);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/minwinbase.h ///////////////////////////////////////////////////////////////////////
|
||||
// NOTE: FindFirstFile
|
||||
@@ -520,21 +661,47 @@
|
||||
// NOTE: CreateProcessW
|
||||
#define STARTF_USESTDHANDLES 0x00000100
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall MoveFileExW (const WCHAR *lpExistingFileName, const WCHAR *lpNewFileName, DWORD dwFlags);
|
||||
__declspec(dllimport) BOOL __stdcall CopyFileW (const WCHAR *lpExistingFileName, const WCHAR *lpNewFileName, BOOL bFailIfExists);
|
||||
__declspec(dllimport) HANDLE __stdcall CreateSemaphoreA(SECURITY_ATTRIBUTES *lpSemaphoreAttributes, LONG lInitialCount, LONG lMaximumCount, const CHAR *lpName);
|
||||
__declspec(dllimport) DWORD __stdcall FormatMessageW (DWORD dwFlags, VOID const *lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, va_list *Arguments);
|
||||
__declspec(dllimport) HLOCAL __stdcall LocalFree (HLOCAL hMem);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/stringapiset.h /////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) int __stdcall MultiByteToWideChar(UINT CodePage, DWORD dwFlags, const CHAR *lpMultiByteStr, int cbMultiByte, WCHAR *lpWideCharStr, int cchWideChar);
|
||||
__declspec(dllimport) int __stdcall WideCharToMultiByte(UINT CodePage, DWORD dwFlags, const WCHAR *lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, const CHAR *lpDefaultChar, BOOL *lpUsedDefaultChar);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/winbase.h //////////////////////////////////////////////////////////////////////////
|
||||
#define DRIVE_UNKNOWN 0
|
||||
#define DRIVE_NO_ROOT_DIR 1
|
||||
#define DRIVE_REMOVABLE 2
|
||||
#define DRIVE_FIXED 3
|
||||
#define DRIVE_REMOTE 4
|
||||
#define DRIVE_CDROM 5
|
||||
#define DRIVE_RAMDISK 6
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) int __stdcall lstrlenW(LPCWSTR lpString);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/fileapi.h //////////////////////////////////////////////////////////////////////////
|
||||
#define INVALID_FILE_SIZE ((DWORD)0xFFFFFFFF)
|
||||
@@ -556,8 +723,10 @@
|
||||
DWORD nFileSizeLow;
|
||||
} WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall FlushFileBuffers (HANDLE hFile);
|
||||
__declspec(dllimport) BOOL __stdcall CreateDirectoryW (const WCHAR *lpPathName, SECURITY_ATTRIBUTES *lpSecurityAttributes);
|
||||
__declspec(dllimport) BOOL __stdcall RemoveDirectoryW (const WCHAR *lpPathName);
|
||||
@@ -573,18 +742,27 @@
|
||||
__declspec(dllimport) BOOL __stdcall ReadFile (HANDLE hFile, VOID *lpBuffer, DWORD nNumberOfBytesToRead, DWORD *lpNumberOfBytesRead, OVERLAPPED *lpOverlapped);
|
||||
__declspec(dllimport) BOOL __stdcall WriteFile (HANDLE hFile, const VOID *lpBuffer, DWORD nNumberOfBytesToWrite, DWORD *lpNumberOfBytesWritten, OVERLAPPED *lpOverlapped);
|
||||
__declspec(dllimport) BOOL __stdcall GetDiskFreeSpaceExW (WCHAR const *lpDirectoryName, ULARGE_INTEGER *lpFreeBytesAvailableToCaller, ULARGE_INTEGER *lpTotalNumberOfBytes, ULARGE_INTEGER *lpTotalNumberOfFreeBytes);
|
||||
__declspec(dllimport) UINT __stdcall GetDriveTypeW (LPCWSTR lpRootPathName);
|
||||
__declspec(dllimport) DWORD __stdcall GetLogicalDriveStringsW (DWORD nBufferLength, LPWSTR lpBuffer);
|
||||
__declspec(dllimport) BOOL __stdcall GetVolumeInformationW (LPCWSTR lpRootPathName, LPWSTR lpVolumeNameBuffer, DWORD nVolumeNameSize, DWORD *lpVolumeSerialNumber, DWORD *lpMaximumComponentLength, DWORD *lpFileSystemFlags, LPWSTR lpFileSystemNameBuffer, DWORD nFileSystemNameSize);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/processenv.h ///////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) DWORD __stdcall GetCurrentDirectoryW (DWORD nBufferLength, WCHAR *lpBuffer);
|
||||
__declspec(dllimport) HANDLE __stdcall GetStdHandle (DWORD nStdHandle);
|
||||
__declspec(dllimport) WCHAR* __stdcall GetEnvironmentStringsW ();
|
||||
__declspec(dllimport) BOOL __stdcall FreeEnvironmentStringsW(WCHAR *penv);
|
||||
__declspec(dllimport) DWORD __stdcall GetEnvironmentVariableW(WCHAR const *lpName, WCHAR *lpBuffer, DWORD nSize);
|
||||
__declspec(dllimport) BOOL __stdcall SetEnvironmentVariableW(WCHAR const *lpName, WCHAR const *lpValue);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/psapi.h ////////////////////////////////////////////////////////////////////////////
|
||||
typedef struct _PROCESS_MEMORY_COUNTERS {
|
||||
@@ -618,10 +796,14 @@
|
||||
} PROCESS_MEMORY_COUNTERS_EX2;
|
||||
typedef PROCESS_MEMORY_COUNTERS_EX2 *PPROCESS_MEMORY_COUNTERS_EX2;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall GetProcessMemoryInfo(HANDLE Process, PPROCESS_MEMORY_COUNTERS ppsmemCounters, DWORD cb);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/sysinfoapi.h ///////////////////////////////////////////////////////////////////////
|
||||
typedef struct _SYSTEM_INFO {
|
||||
@@ -655,14 +837,18 @@
|
||||
DWORDLONG ullAvailExtendedVirtual;
|
||||
} MEMORYSTATUSEX, *LPMEMORYSTATUSEX;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall GlobalMemoryStatusEx (LPMEMORYSTATUSEX lpBuffer);
|
||||
__declspec(dllimport) VOID __stdcall GetSystemInfo (SYSTEM_INFO *lpSystemInfo);
|
||||
__declspec(dllimport) VOID __stdcall GetSystemTime (SYSTEMTIME *lpSystemTime);
|
||||
__declspec(dllimport) VOID __stdcall GetSystemTimeAsFileTime(FILETIME *lpSystemTimeAsFileTime);
|
||||
__declspec(dllimport) VOID __stdcall GetLocalTime (SYSTEMTIME *lpSystemTime);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/timezoneapi.h //////////////////////////////////////////////////////////////////////
|
||||
typedef struct _TIME_ZONE_INFORMATION {
|
||||
@@ -675,12 +861,16 @@
|
||||
LONG DaylightBias;
|
||||
} TIME_ZONE_INFORMATION, *PTIME_ZONE_INFORMATION, *LPTIME_ZONE_INFORMATION;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall FileTimeToSystemTime (const FILETIME* lpFileTime, SYSTEMTIME *lpSystemTime);
|
||||
__declspec(dllimport) BOOL __stdcall SystemTimeToFileTime (const SYSTEMTIME* lpSystemTime, FILETIME *lpFileTime);
|
||||
__declspec(dllimport) BOOL __stdcall TzSpecificLocalTimeToSystemTime(const TIME_ZONE_INFORMATION* lpTimeZoneInformation, const SYSTEMTIME* lpLocalTime, const LPSYSTEMTIME lpUniversalTime);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: shared/windef.h ///////////////////////////////////////////////////////////////////////
|
||||
typedef struct tagRECT {
|
||||
@@ -767,6 +957,16 @@
|
||||
#define WS_SIZEBOX WS_THICKFRAME
|
||||
#define WS_TILEDWINDOW WS_OVERLAPPEDWINDOW
|
||||
|
||||
#define WS_EX_LAYERED 0x00080000L
|
||||
#define WS_EX_TOOLWINDOW 0x00000080L
|
||||
#define WS_EX_TRANSPARENT 0x00000020L
|
||||
#define WS_EX_NOACTIVATE 0x08000000L
|
||||
#define WS_EX_APPWINDOW 0x00040000L
|
||||
|
||||
#define HWND_TOPMOST ((HWND)(-1))
|
||||
#define HWND_NOTOPMOST ((HWND)(-2))
|
||||
|
||||
|
||||
#define WS_OVERLAPPEDWINDOW (WS_OVERLAPPED | \
|
||||
WS_CAPTION | \
|
||||
WS_SYSMENU | \
|
||||
@@ -808,6 +1008,7 @@
|
||||
#define GWLP_WNDPROC (-4)
|
||||
|
||||
#define GWL_STYLE (-16)
|
||||
#define GWL_EXSTYLE (-20)
|
||||
|
||||
#define WS_OVERLAPPED 0x00000000L
|
||||
|
||||
@@ -846,29 +1047,282 @@
|
||||
#define HTHELP 21
|
||||
#endif /* WINVER >= 0x0400 */
|
||||
|
||||
#define WM_NULL 0x0000
|
||||
#define WM_GETICON 0x007F
|
||||
#define WM_LBUTTONDOWN 0x0201
|
||||
#define WM_LBUTTONUP 0x0202
|
||||
#define WM_LBUTTONDBLCLK 0x0203
|
||||
#define WM_RBUTTONDOWN 0x0204
|
||||
#define WM_RBUTTONUP 0x0205
|
||||
#define WM_RBUTTONDBLCLK 0x0206
|
||||
#define WM_APP 0x8000
|
||||
|
||||
#define ICON_SMALL 0
|
||||
#define ICON_BIG 1
|
||||
#define IDI_APPLICATION ((LPCWSTR)(ULONG_PTR)32512)
|
||||
|
||||
#define NIM_ADD 0x00000000
|
||||
#define NIM_MODIFY 0x00000001
|
||||
#define NIM_DELETE 0x00000002
|
||||
|
||||
#define NIF_MESSAGE 0x00000001
|
||||
#define NIF_ICON 0x00000002
|
||||
#define NIF_TIP 0x00000004
|
||||
|
||||
#define MF_STRING 0x00000000
|
||||
#define MF_SEPARATOR 0x00000800
|
||||
|
||||
#define TPM_RIGHTBUTTON 0x0002
|
||||
#define TPM_NONOTIFY 0x0080
|
||||
#define TPM_RETURNCMD 0x0100
|
||||
|
||||
struct HICON__ { int unused; };
|
||||
typedef struct HICON__ *HICON;
|
||||
struct HMENU__ { int unused; };
|
||||
typedef struct HMENU__ *HMENU;
|
||||
|
||||
typedef struct NOTIFYICONDATAW
|
||||
{
|
||||
DWORD cbSize;
|
||||
HWND hWnd;
|
||||
UINT uID;
|
||||
UINT uFlags;
|
||||
UINT uCallbackMessage;
|
||||
HICON hIcon;
|
||||
WCHAR szTip[128];
|
||||
DWORD dwState;
|
||||
DWORD dwStateMask;
|
||||
WCHAR szInfo[256];
|
||||
UINT uVersion;
|
||||
WCHAR szInfoTitle[64];
|
||||
DWORD dwInfoFlags;
|
||||
} NOTIFYICONDATAW, *PNOTIFYICONDATAW;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
__declspec(dllimport) BOOL __stdcall GetWindowRect (HWND hWnd, RECT *lpRect);
|
||||
__declspec(dllimport) BOOL __stdcall SetWindowPos (HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags);
|
||||
__declspec(dllimport) UINT __stdcall GetWindowModuleFileNameA(HWND hwnd, LPSTR pszFileName, UINT cchFileNameMax);
|
||||
__declspec(dllimport) BOOL __stdcall ShowWindow (HWND hWnd, int nCmdShow);
|
||||
__declspec(dllimport) BOOL __stdcall GetWindowPlacement (HWND hWnd, WINDOWPLACEMENT *lpwndpl);
|
||||
__declspec(dllimport) BOOL __stdcall IsIconic (HWND hWnd);
|
||||
__declspec(dllimport) BOOL __stdcall IsZoomed (HWND hWnd);
|
||||
__declspec(dllimport) BOOL __stdcall BringWindowToTop (HWND hWnd);
|
||||
__declspec(dllimport) BOOL __stdcall SetForegroundWindow (HWND hWnd);
|
||||
__declspec(dllimport) HWND __stdcall SetFocus (HWND hWnd);
|
||||
__declspec(dllimport) HWND __stdcall GetForegroundWindow ();
|
||||
__declspec(dllimport) BOOL __stdcall SetWindowTextW (HWND hWnd, LPCWSTR lpString);
|
||||
__declspec(dllimport) UINT __stdcall GetDoubleClickTime ();
|
||||
__declspec(dllimport) LONG_PTR __stdcall GetWindowLongPtrW (HWND hWnd, int nIndex);
|
||||
__declspec(dllimport) LONG_PTR __stdcall SetWindowLongPtrW (HWND hWnd, int nIndex, LONG_PTR dwNewLong);
|
||||
__declspec(dllimport) LONG __stdcall GetWindowLongW (HWND hWnd, int nIndex);
|
||||
__declspec(dllimport) LRESULT __stdcall CallWindowProcW (WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|
||||
__declspec(dllimport) int __stdcall GetSystemMetrics (int nIndex);
|
||||
__declspec(dllimport) BOOL __stdcall ScreenToClient (HWND hWnd, LPPOINT lpPoint);
|
||||
__declspec(dllimport) LRESULT __stdcall DefWindowProcW (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall GetWindowRect (HWND hWnd, RECT *lpRect);
|
||||
__declspec(dllimport) BOOL __stdcall SetWindowPos (HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags);
|
||||
__declspec(dllimport) UINT __stdcall GetWindowModuleFileNameA (HWND hwnd, LPSTR pszFileName, UINT cchFileNameMax);
|
||||
__declspec(dllimport) BOOL __stdcall ShowWindow (HWND hWnd, int nCmdShow);
|
||||
__declspec(dllimport) BOOL __stdcall GetWindowPlacement (HWND hWnd, WINDOWPLACEMENT *lpwndpl);
|
||||
__declspec(dllimport) BOOL __stdcall IsIconic (HWND hWnd);
|
||||
__declspec(dllimport) BOOL __stdcall IsZoomed (HWND hWnd);
|
||||
__declspec(dllimport) BOOL __stdcall IsWindowVisible (HWND hWnd);
|
||||
__declspec(dllimport) BOOL __stdcall BringWindowToTop (HWND hWnd);
|
||||
__declspec(dllimport) BOOL __stdcall SetForegroundWindow (HWND hWnd);
|
||||
__declspec(dllimport) HWND __stdcall SetFocus (HWND hWnd);
|
||||
__declspec(dllimport) HWND __stdcall GetForegroundWindow ();
|
||||
__declspec(dllimport) BOOL __stdcall SetWindowTextW (HWND hWnd, LPCWSTR lpString);
|
||||
__declspec(dllimport) UINT __stdcall GetDoubleClickTime ();
|
||||
__declspec(dllimport) int __stdcall wsprintfW (LPWSTR lpOut, LPCWSTR lpFmt, ...);
|
||||
__declspec(dllimport) LONG_PTR __stdcall GetWindowLongPtrW (HWND hWnd, int nIndex);
|
||||
__declspec(dllimport) LONG_PTR __stdcall SetWindowLongPtrW (HWND hWnd, int nIndex, LONG_PTR dwNewLong);
|
||||
__declspec(dllimport) LONG __stdcall GetWindowLongW (HWND hWnd, int nIndex);
|
||||
__declspec(dllimport) LRESULT __stdcall CallWindowProcW (WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|
||||
__declspec(dllimport) int __stdcall GetSystemMetrics (int nIndex);
|
||||
__declspec(dllimport) BOOL __stdcall GetCursorPos (LPPOINT lpPoint);
|
||||
__declspec(dllimport) BOOL __stdcall ScreenToClient (HWND hWnd, LPPOINT lpPoint);
|
||||
__declspec(dllimport) LRESULT __stdcall DefWindowProcW (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|
||||
__declspec(dllimport) LRESULT __stdcall SendMessageW (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|
||||
__declspec(dllimport) BOOL __stdcall PostMessageW (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
|
||||
__declspec(dllimport) HICON __stdcall LoadIconW (HINSTANCE hInstance, LPCWSTR lpIconName);
|
||||
__declspec(dllimport) HMENU __stdcall CreatePopupMenu ();
|
||||
__declspec(dllimport) BOOL __stdcall DestroyMenu (HMENU hMenu);
|
||||
__declspec(dllimport) BOOL __stdcall AppendMenuW (HMENU hMenu, UINT uFlags, UINT_PTR uIDNewItem, LPCWSTR lpNewItem);
|
||||
__declspec(dllimport) BOOL __stdcall TrackPopupMenu (HMENU hMenu, UINT uFlags, int x, int y, int nReserved, HWND hWnd, const RECT *prcRect);
|
||||
__declspec(dllimport) UINT __stdcall RegisterWindowMessageW (LPCWSTR lpString);
|
||||
__declspec(dllimport) BOOL __stdcall Shell_NotifyIconW (DWORD dwMessage, PNOTIFYICONDATAW lpData);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/powerbase.h ////////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) LONG __stdcall CallNtPowerInformation(UINT InformationLevel, VOID *InputBuffer, ULONG InputBufferLength, VOID *OutputBuffer, ULONG OutputBufferLength);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/pdh.h //////////////////////////////////////////////////////////////////////////////
|
||||
typedef LONG PDH_STATUS;
|
||||
typedef HANDLE PDH_HQUERY;
|
||||
typedef HANDLE PDH_HCOUNTER;
|
||||
|
||||
typedef struct _PDH_FMT_COUNTERVALUE {
|
||||
DWORD CStatus;
|
||||
union {
|
||||
LONG longValue;
|
||||
double doubleValue;
|
||||
LONGLONG largeValue;
|
||||
LPCSTR AnsiStringValue;
|
||||
LPCWSTR WideStringValue;
|
||||
};
|
||||
} PDH_FMT_COUNTERVALUE;
|
||||
|
||||
typedef struct _PDH_FMT_COUNTERVALUE_ITEM_W {
|
||||
LPWSTR szName;
|
||||
PDH_FMT_COUNTERVALUE FmtValue;
|
||||
} PDH_FMT_COUNTERVALUE_ITEM_W, *PPDH_FMT_COUNTERVALUE_ITEM_W;
|
||||
|
||||
#define PDH_FMT_DOUBLE 0x00000200
|
||||
|
||||
// NOTE: um/pdhmsg.h ///////////////////////////////////////////////////////////////////////////
|
||||
#define PDH_CSTATUS_VALID_DATA 0x00000000L
|
||||
#define PDH_CSTATUS_NEW_DATA 0x00000001L
|
||||
#define PDH_MORE_DATA 0x800007D2L
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) PDH_STATUS __stdcall PdhOpenQueryW (LPCWSTR szDataSource, DWORD_PTR dwUserData, PDH_HQUERY *phQuery);
|
||||
__declspec(dllimport) PDH_STATUS __stdcall PdhAddEnglishCounterW (PDH_HQUERY hQuery, LPCWSTR szFullCounterPath, DWORD_PTR dwUserData, PDH_HCOUNTER *phCounter);
|
||||
__declspec(dllimport) PDH_STATUS __stdcall PdhCollectQueryData (PDH_HQUERY hQuery);
|
||||
__declspec(dllimport) PDH_STATUS __stdcall PdhGetFormattedCounterArrayW(PDH_HCOUNTER hCounter, DWORD dwFormat, DWORD *lpdwBufferSize, DWORD *lpdwItemCount, PPDH_FMT_COUNTERVALUE_ITEM_W ItemBuffer);
|
||||
__declspec(dllimport) PDH_STATUS __stdcall PdhCloseQuery (PDH_HQUERY hQuery);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/ioapiset.h /////////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall DeviceIoControl(HANDLE hDevice, DWORD dwIoControlCode, VOID *lpInBuffer, DWORD nInBufferSize, VOID *lpOutBuffer, DWORD nOutBufferSize, DWORD *lpBytesReturned, OVERLAPPED *lpOverlapped);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/winioctl.h /////////////////////////////////////////////////////////////////////////
|
||||
typedef enum _STORAGE_PROPERTY_ID {
|
||||
StorageDeviceTemperatureProperty = 52,
|
||||
} STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID;
|
||||
|
||||
typedef enum _STORAGE_QUERY_TYPE {
|
||||
PropertyStandardQuery = 0,
|
||||
} STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE;
|
||||
|
||||
typedef struct _STORAGE_PROPERTY_QUERY {
|
||||
STORAGE_PROPERTY_ID PropertyId;
|
||||
STORAGE_QUERY_TYPE QueryType;
|
||||
BYTE AdditionalParameters[1];
|
||||
} STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY;
|
||||
|
||||
typedef struct _STORAGE_TEMPERATURE_INFO {
|
||||
WORD Index;
|
||||
SHORT Temperature;
|
||||
SHORT OverThreshold;
|
||||
SHORT UnderThreshold;
|
||||
UCHAR OverThresholdChangable;
|
||||
UCHAR UnderThresholdChangable;
|
||||
UCHAR EventGenerated;
|
||||
BYTE Reserved0;
|
||||
DWORD Reserved1;
|
||||
} STORAGE_TEMPERATURE_INFO, *PSTORAGE_TEMPERATURE_INFO;
|
||||
|
||||
typedef struct _STORAGE_TEMPERATURE_DATA_DESCRIPTOR {
|
||||
DWORD Version;
|
||||
DWORD Size;
|
||||
SHORT CriticalTemperature;
|
||||
SHORT WarningTemperature;
|
||||
WORD InfoCount;
|
||||
BYTE Reserved0[2];
|
||||
DWORD Reserved1[2];
|
||||
STORAGE_TEMPERATURE_INFO TemperatureInfo[ANYSIZE_ARRAY];
|
||||
} STORAGE_TEMPERATURE_DATA_DESCRIPTOR, *PSTORAGE_TEMPERATURE_DATA_DESCRIPTOR;
|
||||
|
||||
typedef struct _DISK_EXTENT {
|
||||
DWORD DiskNumber;
|
||||
LARGE_INTEGER StartingOffset;
|
||||
LARGE_INTEGER ExtentLength;
|
||||
} DISK_EXTENT, *PDISK_EXTENT;
|
||||
|
||||
typedef struct _VOLUME_DISK_EXTENTS {
|
||||
DWORD NumberOfDiskExtents;
|
||||
DISK_EXTENT Extents[ANYSIZE_ARRAY];
|
||||
} VOLUME_DISK_EXTENTS, *PVOLUME_DISK_EXTENTS;
|
||||
|
||||
#define IOCTL_STORAGE_QUERY_PROPERTY 0x002D1400
|
||||
#define IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS 0x00560000
|
||||
|
||||
// NOTE: shared/d3dkmthk.h /////////////////////////////////////////////////////////////////////
|
||||
typedef UINT D3DKMT_HANDLE;
|
||||
|
||||
#define KMTQAITYPE_ADAPTERREGISTRYINFO 8
|
||||
#define KMTQAITYPE_NODEPERFDATA 61
|
||||
#define KMTQAITYPE_ADAPTERPERFDATA 62
|
||||
|
||||
typedef struct _D3DKMT_ADAPTERINFO {
|
||||
D3DKMT_HANDLE hAdapter;
|
||||
LUID AdapterLuid;
|
||||
ULONG NumOfSources;
|
||||
BOOL bPrecisePresentRegionsPreferred;
|
||||
} D3DKMT_ADAPTERINFO, *PD3DKMT_ADAPTERINFO;
|
||||
|
||||
typedef struct _D3DKMT_ENUMADAPTERS2 {
|
||||
ULONG NumAdapters;
|
||||
D3DKMT_ADAPTERINFO *pAdapters;
|
||||
} D3DKMT_ENUMADAPTERS2, *PD3DKMT_ENUMADAPTERS2;
|
||||
|
||||
typedef struct _D3DKMT_QUERYADAPTERINFO {
|
||||
D3DKMT_HANDLE hAdapter;
|
||||
UINT Type;
|
||||
VOID *pPrivateDriverData;
|
||||
UINT PrivateDriverDataSize;
|
||||
} D3DKMT_QUERYADAPTERINFO, *PD3DKMT_QUERYADAPTERINFO;
|
||||
|
||||
typedef struct _D3DKMT_ADAPTER_PERFDATA {
|
||||
UINT PhysicalAdapterIndex;
|
||||
ULONGLONG MemoryFrequency;
|
||||
ULONGLONG MaxMemoryFrequency;
|
||||
ULONGLONG MaxMemoryFrequencyOC;
|
||||
ULONGLONG MemoryBandwidth;
|
||||
ULONGLONG PCIEBandwidth;
|
||||
ULONG FanRPM;
|
||||
ULONG Power;
|
||||
ULONG Temperature;
|
||||
UCHAR PowerStateOverride;
|
||||
} D3DKMT_ADAPTER_PERFDATA, *PD3DKMT_ADAPTER_PERFDATA;
|
||||
|
||||
typedef struct _D3DKMT_ADAPTERREGISTRYINFO {
|
||||
WCHAR AdapterString[MAX_PATH];
|
||||
WCHAR BiosString[MAX_PATH];
|
||||
WCHAR DacType[MAX_PATH];
|
||||
WCHAR ChipType[MAX_PATH];
|
||||
} D3DKMT_ADAPTERREGISTRYINFO, *PD3DKMT_ADAPTERREGISTRYINFO;
|
||||
|
||||
typedef struct _D3DKMT_NODE_PERFDATA {
|
||||
UINT NodeOrdinal;
|
||||
UINT PhysicalAdapterIndex;
|
||||
ULONGLONG Frequency;
|
||||
ULONGLONG MaxFrequency;
|
||||
ULONGLONG MaxFrequencyOC;
|
||||
ULONG Voltage;
|
||||
ULONG VoltageMax;
|
||||
ULONG VoltageMaxOC;
|
||||
ULONGLONG MaxTransitionLatency;
|
||||
} D3DKMT_NODE_PERFDATA, *PD3DKMT_NODE_PERFDATA;
|
||||
|
||||
typedef struct _D3DKMT_CLOSEADAPTER {
|
||||
D3DKMT_HANDLE hAdapter;
|
||||
} D3DKMT_CLOSEADAPTER, *PD3DKMT_CLOSEADAPTER;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) LONG __stdcall D3DKMTEnumAdapters2 (D3DKMT_ENUMADAPTERS2 *unnamedParam1);
|
||||
__declspec(dllimport) LONG __stdcall D3DKMTQueryAdapterInfo (D3DKMT_QUERYADAPTERINFO *unnamedParam1);
|
||||
__declspec(dllimport) LONG __stdcall D3DKMTCloseAdapter (D3DKMT_CLOSEADAPTER const *unnamedParam1);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/dwmapi.h //////////////////////////////////////////////////////////////////////////
|
||||
typedef struct _MARGINS
|
||||
@@ -879,10 +1333,14 @@
|
||||
int cyBottomHeight; // height of bottom border that retains its size
|
||||
} MARGINS, *PMARGINS;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) HRESULT __stdcall DwmExtendFrameIntoClientArea(HWND hWnd, const MARGINS* pMarInset);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/wininet.h //////////////////////////////////////////////////////////////////////////
|
||||
typedef WORD INTERNET_PORT;
|
||||
@@ -1115,8 +1573,10 @@
|
||||
DWORD dwStatusInformationLength
|
||||
);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) HINTERNET __stdcall WinHttpOpen(WCHAR const *pszAgentW, DWORD dwAccessType, WCHAR const *pszProxyW, WCHAR const *pszProxyBypassW, DWORD dwFlags);
|
||||
__declspec(dllimport) BOOL __stdcall WinHttpCloseHandle(HINTERNET hInternet);
|
||||
__declspec(dllimport) HINTERNET __stdcall WinHttpConnect(HINTERNET hSession, WCHAR const *pswzServerName, INTERNET_PORT nServerPort, DWORD dwReserved);
|
||||
@@ -1133,7 +1593,9 @@
|
||||
__declspec(dllimport) BOOL __stdcall WinHttpQueryHeaders(HINTERNET hRequest, DWORD dwInfoLevel, WCHAR const *pwszName, VOID *lpBuffer, DWORD *lpdwBufferLength, DWORD *lpdwIndex);
|
||||
__declspec(dllimport) BOOL __stdcall WinHttpReceiveResponse(HINTERNET hRequest, VOID *lpReserved);
|
||||
__declspec(dllimport) WINHTTP_STATUS_CALLBACK __stdcall WinHttpSetStatusCallback(HINTERNET hInternet, WINHTTP_STATUS_CALLBACK lpfnInternetCallback, DWORD dwNotificationFlags, DWORD_PTR dwReserved);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/DbgHelp.h //////////////////////////////////////////////////////////////////////////
|
||||
#define SYMOPT_CASE_INSENSITIVE 0x00000001
|
||||
@@ -1250,31 +1712,43 @@
|
||||
typedef DWORD64(__stdcall GET_MODULE_BASE_ROUTINE64)(HANDLE hProcess, DWORD64 Address);
|
||||
typedef DWORD64(__stdcall TRANSLATE_ADDRESS_ROUTINE64)(HANDLE hProcess, HANDLE hThread, ADDRESS64 *lpaddr);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall StackWalk64 (DWORD MachineType, HANDLE hProcess, HANDLE hThread, STACKFRAME64 *StackFrame, VOID *ContextRecord, READ_PROCESS_MEMORY_ROUTINE64 *ReadMemoryRoutine, FUNCTION_TABLE_ACCESS_ROUTINE64 *FunctionTableAccessRoutine, GET_MODULE_BASE_ROUTINE64 *GetModuleBaseRoutine, TRANSLATE_ADDRESS_ROUTINE64 *TranslateAddress);
|
||||
__declspec(dllimport) BOOL __stdcall SymFromAddrW (HANDLE hProcess, DWORD64 Address, DWORD64 *Displacement, SYMBOL_INFOW *Symbol);
|
||||
__declspec(dllimport) VOID * __stdcall SymFunctionTableAccess64(HANDLE hProcess, DWORD64 AddrBase);
|
||||
__declspec(dllimport) BOOL __stdcall SymGetLineFromAddrW64 (HANDLE hProcess, DWORD64 dwAddr, DWORD *pdwDisplacement, IMAGEHLP_LINEW64 *Line);
|
||||
__declspec(dllimport) DWORD64 __stdcall SymGetModuleBase64 (HANDLE hProcess, DWORD64 qwAddr);
|
||||
__declspec(dllimport) BOOL __stdcall SymRefreshModuleList (HANDLE hProcess);
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
// NOTE: um/errhandlingapi.h ///////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) DWORD __stdcall GetLastError(VOID);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/libloaderapi.h /////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) HMODULE __stdcall LoadLibraryA (const CHAR *lpLibFileName);
|
||||
__declspec(dllimport) BOOL __stdcall FreeLibrary (HMODULE hLibModule);
|
||||
__declspec(dllimport) void * __stdcall GetProcAddress (HMODULE hModule, const CHAR *lpProcName);
|
||||
__declspec(dllimport) HMODULE __stdcall GetModuleHandleA (const CHAR *lpModuleName);
|
||||
__declspec(dllimport) DWORD __stdcall GetModuleFileNameW(HMODULE hModule, WCHAR *lpFilename, DWORD nSize);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/synchapi.h /////////////////////////////////////////////////////////////////////////
|
||||
typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE;
|
||||
@@ -1287,8 +1761,10 @@
|
||||
#define SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY 0x02
|
||||
#define SYNCHRONIZATION_BARRIER_FLAGS_NO_DELETE 0x04
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) VOID __stdcall InitializeConditionVariable (CONDITION_VARIABLE *ConditionVariable);
|
||||
__declspec(dllimport) VOID __stdcall WakeConditionVariable (CONDITION_VARIABLE *ConditionVariable);
|
||||
__declspec(dllimport) VOID __stdcall WakeAllConditionVariable (CONDITION_VARIABLE *ConditionVariable);
|
||||
@@ -1310,14 +1786,20 @@
|
||||
__declspec(dllimport) BOOL __stdcall EnterSynchronizationBarrier (SYNCHRONIZATION_BARRIER *lpBarrier, DWORD dwFlags);
|
||||
__declspec(dllimport) BOOL __stdcall InitializeSynchronizationBarrier (SYNCHRONIZATION_BARRIER *lpBarrier, LONG lTotalThreads, LONG lSpinCount);
|
||||
__declspec(dllimport) BOOL __stdcall DeleteSynchronizationBarrier (SYNCHRONIZATION_BARRIER *lpBarrier);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/profileapi.h ///////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall QueryPerformanceCounter (LARGE_INTEGER* lpPerformanceCount);
|
||||
__declspec(dllimport) BOOL __stdcall QueryPerformanceFrequency(LARGE_INTEGER* lpFrequency);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/processthreadsapi.h ////////////////////////////////////////////////////////////////
|
||||
typedef struct _PROCESS_INFORMATION {
|
||||
@@ -1353,57 +1835,86 @@
|
||||
);
|
||||
typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall CreateProcessW (WCHAR const *lpApplicationName, WCHAR *lpCommandLine, SECURITY_ATTRIBUTES *lpProcessAttributes, SECURITY_ATTRIBUTES *lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, VOID *lpEnvironment, WCHAR const *lpCurrentDirectory, STARTUPINFOW *lpStartupInfo, PROCESS_INFORMATION *lpProcessInformation);
|
||||
__declspec(dllimport) HANDLE __stdcall CreateThread (SECURITY_ATTRIBUTES *lpThreadAttributes, SIZE_T dwStackSize, PTHREAD_START_ROUTINE lpStartAddress, VOID *lpParameter, DWORD dwCreationFlags, DWORD *lpThreadId);
|
||||
__declspec(dllimport) DWORD __stdcall GetCurrentThreadId(VOID);
|
||||
__declspec(dllimport) BOOL __stdcall GetSystemTimes (LPFILETIME lpIdleTime, LPFILETIME lpKernelTime, LPFILETIME lpUserTime);
|
||||
__declspec(dllimport) BOOL __stdcall GetExitCodeProcess(HANDLE hProcess, DWORD *lpExitCode);
|
||||
__declspec(dllimport) void __stdcall ExitProcess (UINT uExitCode);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/memoryapi.h ////////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) VOID * __stdcall VirtualAlloc (VOID *lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
|
||||
__declspec(dllimport) BOOL __stdcall VirtualProtect(VOID *lpAddress, SIZE_T dwSize, DWORD flNewProtect, DWORD *lpflOldProtect);
|
||||
__declspec(dllimport) BOOL __stdcall VirtualFree (VOID *lpAddress, SIZE_T dwSize, DWORD dwFreeType);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: shared/bcrypt.h ///////////////////////////////////////////////////////////////////////
|
||||
typedef VOID *BCRYPT_ALG_HANDLE;
|
||||
typedef LONG NTSTATUS;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) NTSTATUS __stdcall BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *phAlgorithm, const WCHAR *pszAlgId, const WCHAR *pszImplementation, ULONG dwFlags);
|
||||
__declspec(dllimport) NTSTATUS __stdcall BCryptGenRandom (BCRYPT_ALG_HANDLE hAlgorithm, UCHAR *pbBuffer, ULONG cbBuffer, ULONG dwFlags);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/shellapi.h /////////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) HINSTANCE __stdcall ShellExecuteW(HWND hwnd, WCHAR const *lpOperation, WCHAR const *lpFile, WCHAR const *lpParameters, WCHAR const *lpDirectory, INT nShowCmd);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/debugapi.h /////////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall IsDebuggerPresent();
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/namedpipeapi.h /////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall CreatePipe (HANDLE *hReadPipe, HANDLE *hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize);
|
||||
__declspec(dllimport) BOOL __stdcall PeekNamedPipe(HANDLE hNamedPipe, VOID *lpBuffer, DWORD nBufferSize, DWORD *lpBytesRead, DWORD *lpTotalBytesAvail, DWORD *lpBytesLeftThisMessage);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/handleapi.h ////////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall SetHandleInformation(HANDLE hObject, DWORD dwMask, DWORD dwFlags);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/commdlg.h //////////////////////////////////////////////////////////////////////////
|
||||
typedef UINT_PTR (__stdcall *LPOFNHOOKPROC)(HWND, UINT, WPARAM, LPARAM);
|
||||
@@ -1478,18 +1989,26 @@
|
||||
#define OFN_EX_NOPLACESBAR 0x00000001
|
||||
#endif // (_WIN32_WINNT >= 0x0500)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall GetSaveFileNameW(LPOPENFILENAMEW);
|
||||
__declspec(dllimport) BOOL __stdcall GetOpenFileNameW(LPOPENFILENAMEW);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/shlwapi.h //////////////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) BOOL __stdcall PathRelativePathToW(WCHAR *pszPath, WCHAR const *pszFrom, DWORD dwAttrFrom, WCHAR const *pszTo, DWORD dwAttrTo);
|
||||
__declspec(dllimport) BOOL __stdcall PathIsRelativeW(WCHAR *pszPath);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
// NOTE: um/pathcch.h //////////////////////////////////////////////////////////////////////////
|
||||
typedef enum PATHCCH_OPTIONS
|
||||
@@ -1535,16 +2054,24 @@
|
||||
PATHCCH_CANONICALIZE_SLASHES = 0x040,
|
||||
} PATHCCH_OPTIONS;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) HRESULT __stdcall PathCchCanonicalizeEx(PWSTR pszPathOut, size_t cchPathOut, WCHAR const *pszPathIn, ULONG dwFlags);
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
// NOTE: um/errhandlingapi.h ///////////////////////////////////////////////////////////////////
|
||||
#if defined(__cplusplus)
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
__declspec(dllimport) VOID __stdcall RaiseException(DWORD dwExceptionCode, DWORD dwExceptionFlags, DWORD nNumberOfArguments, const ULONG_PTR* lpArguments);
|
||||
#if defined(__cplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
// NOTE: include/excpt.h ///////////////////////////////////////////////////////////////////
|
||||
#define EXCEPTION_EXECUTE_HANDLER 1
|
||||
@@ -1561,4 +2088,21 @@
|
||||
|
||||
DN_MSVC_WARNING_POP
|
||||
#endif // !defined(_INC_WINDOWS)
|
||||
|
||||
// NOTE: ntpoapi.h ///////////////////////////////////////////////////////////////////////////////
|
||||
// NOTE: PROCESSOR_POWER_INFORMATION was omitted from the Windows SDK's WinNT.h even though it is
|
||||
// documented by Microsoft. It is available in ntpoapi.h, but including that header would pull in
|
||||
// the WDK, so define the documented structure locally instead.
|
||||
#if !defined(_NTPOAPI_H) && !defined(__NTPOAPI_H)
|
||||
typedef struct _PROCESSOR_POWER_INFORMATION
|
||||
{
|
||||
ULONG Number;
|
||||
ULONG MaxMhz;
|
||||
ULONG CurrentMhz;
|
||||
ULONG MhzLimit;
|
||||
ULONG MaxIdleState;
|
||||
ULONG CurrentIdleState;
|
||||
} PROCESSOR_POWER_INFORMATION, *PPROCESSOR_POWER_INFORMATION;
|
||||
#endif
|
||||
|
||||
#endif // !defined(DN_OS_WINDOWS_H)
|
||||
Reference in new issue
Block a user