VirtualBox

Changeset 85088 in vbox for trunk/include/iprt/nt


Ignore:
Timestamp:
Jul 7, 2020 5:08:28 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
138997
Message:

iprt/nt/nt.h: Introducing RT_DECL_NTAPI. bugref:9794

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/nt/nt.h

    r82968 r85088  
    301301/** Constant UNICODE_STRING initializer. */
    302302#define RTNT_CONSTANT_UNISTR(a_String)   { sizeof(a_String) - sizeof(WCHAR), sizeof(a_String), (WCHAR *)a_String }
    303 /** @}  */
     303
     304/** Declaration wrapper for NT apis.
     305 * Adds nothrow.  Don't use with callbacks. */
     306#define RT_DECL_NTAPI(type) DECL_NOTHROW(NTSYSAPI type NTAPI)
     307/** @} */
    304308
    305309
     
    15941598
    15951599#ifdef IPRT_NT_USE_WINTERNL
    1596 NTSYSAPI NTSTATUS NTAPI NtCreateSection(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PLARGE_INTEGER, ULONG, ULONG, HANDLE);
     1600RT_DECL_NTAPI(NTSTATUS) NtCreateSection(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PLARGE_INTEGER, ULONG, ULONG, HANDLE);
    15971601typedef enum _SECTION_INHERIT
    15981602{
     
    16011605} SECTION_INHERIT;
    16021606#endif
    1603 NTSYSAPI NTSTATUS NTAPI NtMapViewOfSection(HANDLE, HANDLE, PVOID *, ULONG, SIZE_T, PLARGE_INTEGER, PSIZE_T, SECTION_INHERIT,
     1607RT_DECL_NTAPI(NTSTATUS) NtMapViewOfSection(HANDLE, HANDLE, PVOID *, ULONG, SIZE_T, PLARGE_INTEGER, PSIZE_T, SECTION_INHERIT,
    16041608                                           ULONG, ULONG);
    1605 NTSYSAPI NTSTATUS NTAPI NtFlushVirtualMemory(HANDLE, PVOID *, PSIZE_T, PIO_STATUS_BLOCK);
    1606 NTSYSAPI NTSTATUS NTAPI NtUnmapViewOfSection(HANDLE, PVOID);
    1607 
    1608 NTSYSAPI NTSTATUS NTAPI NtOpenProcess(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PCLIENT_ID);
    1609 NTSYSAPI NTSTATUS NTAPI ZwOpenProcess(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PCLIENT_ID);
    1610 NTSYSAPI NTSTATUS NTAPI NtOpenThread(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PCLIENT_ID);
    1611 NTSYSAPI NTSTATUS NTAPI ZwOpenThread(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PCLIENT_ID);
    1612 NTSYSAPI NTSTATUS NTAPI NtAlertThread(HANDLE hThread);
     1609RT_DECL_NTAPI(NTSTATUS) NtFlushVirtualMemory(HANDLE, PVOID *, PSIZE_T, PIO_STATUS_BLOCK);
     1610RT_DECL_NTAPI(NTSTATUS) NtUnmapViewOfSection(HANDLE, PVOID);
     1611
     1612RT_DECL_NTAPI(NTSTATUS) NtOpenProcess(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PCLIENT_ID);
     1613RT_DECL_NTAPI(NTSTATUS) ZwOpenProcess(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PCLIENT_ID);
     1614RT_DECL_NTAPI(NTSTATUS) NtOpenThread(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PCLIENT_ID);
     1615RT_DECL_NTAPI(NTSTATUS) ZwOpenThread(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PCLIENT_ID);
     1616RT_DECL_NTAPI(NTSTATUS) NtAlertThread(HANDLE hThread);
    16131617#ifdef IPRT_NT_USE_WINTERNL
    1614 NTSYSAPI NTSTATUS NTAPI ZwAlertThread(HANDLE hThread);
    1615 #endif
    1616 NTSYSAPI NTSTATUS NTAPI NtTestAlert(void);
     1618RT_DECL_NTAPI(NTSTATUS) ZwAlertThread(HANDLE hThread);
     1619#endif
     1620RT_DECL_NTAPI(NTSTATUS) NtTestAlert(void);
    16171621
    16181622#ifdef IPRT_NT_USE_WINTERNL
    1619 NTSYSAPI NTSTATUS NTAPI NtOpenProcessToken(HANDLE, ACCESS_MASK, PHANDLE);
    1620 NTSYSAPI NTSTATUS NTAPI NtOpenThreadToken(HANDLE, ACCESS_MASK, BOOLEAN, PHANDLE);
    1621 #endif
    1622 NTSYSAPI NTSTATUS NTAPI ZwOpenProcessToken(HANDLE, ACCESS_MASK, PHANDLE);
    1623 NTSYSAPI NTSTATUS NTAPI ZwOpenThreadToken(HANDLE, ACCESS_MASK, BOOLEAN, PHANDLE);
     1623RT_DECL_NTAPI(NTSTATUS) NtOpenProcessToken(HANDLE, ACCESS_MASK, PHANDLE);
     1624RT_DECL_NTAPI(NTSTATUS) NtOpenThreadToken(HANDLE, ACCESS_MASK, BOOLEAN, PHANDLE);
     1625#endif
     1626RT_DECL_NTAPI(NTSTATUS) ZwOpenProcessToken(HANDLE, ACCESS_MASK, PHANDLE);
     1627RT_DECL_NTAPI(NTSTATUS) ZwOpenThreadToken(HANDLE, ACCESS_MASK, BOOLEAN, PHANDLE);
    16241628
    16251629#ifdef IPRT_NT_USE_WINTERNL
     
    17711775} FS_INFORMATION_CLASS;
    17721776typedef FS_INFORMATION_CLASS *PFS_INFORMATION_CLASS;
    1773 NTSYSAPI NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FS_INFORMATION_CLASS);
    1774 NTSYSAPI NTSTATUS NTAPI NtSetVolumeInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FS_INFORMATION_CLASS);
     1777RT_DECL_NTAPI(NTSTATUS) NtQueryVolumeInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FS_INFORMATION_CLASS);
     1778RT_DECL_NTAPI(NTSTATUS) NtSetVolumeInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FS_INFORMATION_CLASS);
    17751779
    17761780#ifdef IPRT_NT_USE_WINTERNL
     
    24432447} FILE_INFORMATION_CLASS;
    24442448typedef FILE_INFORMATION_CLASS *PFILE_INFORMATION_CLASS;
    2445 NTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS);
    2446 NTSYSAPI NTSTATUS NTAPI NtQueryDirectoryFile(HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, PVOID, ULONG,
     2449RT_DECL_NTAPI(NTSTATUS) NtQueryInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS);
     2450RT_DECL_NTAPI(NTSTATUS) NtQueryDirectoryFile(HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, PVOID, ULONG,
    24472451                                             FILE_INFORMATION_CLASS, BOOLEAN, PUNICODE_STRING, BOOLEAN);
    2448 NTSYSAPI NTSTATUS NTAPI NtSetInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS);
     2452RT_DECL_NTAPI(NTSTATUS) NtSetInformationFile(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG, FILE_INFORMATION_CLASS);
    24492453#endif /* IPRT_NT_USE_WINTERNL */
    2450 NTSYSAPI NTSTATUS NTAPI NtQueryAttributesFile(POBJECT_ATTRIBUTES, PFILE_BASIC_INFORMATION);
    2451 NTSYSAPI NTSTATUS NTAPI NtQueryFullAttributesFile(POBJECT_ATTRIBUTES, PFILE_NETWORK_OPEN_INFORMATION);
     2454RT_DECL_NTAPI(NTSTATUS) NtQueryAttributesFile(POBJECT_ATTRIBUTES, PFILE_BASIC_INFORMATION);
     2455RT_DECL_NTAPI(NTSTATUS) NtQueryFullAttributesFile(POBJECT_ATTRIBUTES, PFILE_NETWORK_OPEN_INFORMATION);
    24522456
    24532457
     
    25712575    MaxKeyInfoClass
    25722576} KEY_INFORMATION_CLASS;
    2573 NTSYSAPI NTSTATUS NTAPI NtQueryKey(HANDLE, KEY_INFORMATION_CLASS, PVOID, ULONG, PULONG);
    2574 NTSYSAPI NTSTATUS NTAPI NtEnumerateKey(HANDLE, ULONG, KEY_INFORMATION_CLASS, PVOID, ULONG, PULONG);
     2577RT_DECL_NTAPI(NTSTATUS) NtQueryKey(HANDLE, KEY_INFORMATION_CLASS, PVOID, ULONG, PULONG);
     2578RT_DECL_NTAPI(NTSTATUS) NtEnumerateKey(HANDLE, ULONG, KEY_INFORMATION_CLASS, PVOID, ULONG, PULONG);
    25752579
    25762580typedef struct _MEMORY_SECTION_NAME
     
    26912695} PROCESSINFOCLASS;
    26922696AssertCompile(ProcessSequenceNumber == 0x5c);
    2693 NTSYSAPI NTSTATUS NTAPI NtQueryInformationProcess(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG);
     2697RT_DECL_NTAPI(NTSTATUS) NtQueryInformationProcess(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG);
    26942698#if ARCH_BITS == 32
    26952699/** 64-bit API pass thru to WOW64 processes. */
    2696 NTSYSAPI NTSTATUS NTAPI NtWow64QueryInformationProcess64(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG);
     2700RT_DECL_NTAPI(NTSTATUS) NtWow64QueryInformationProcess64(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG);
    26972701#endif
    26982702
     
    27362740    MaxThreadInfoClass
    27372741} THREADINFOCLASS;
    2738 NTSYSAPI NTSTATUS NTAPI NtSetInformationThread(HANDLE, THREADINFOCLASS, LPCVOID, ULONG);
    2739 
    2740 NTSYSAPI NTSTATUS NTAPI NtQueryInformationToken(HANDLE, TOKEN_INFORMATION_CLASS, PVOID, ULONG, PULONG);
    2741 NTSYSAPI NTSTATUS NTAPI ZwQueryInformationToken(HANDLE, TOKEN_INFORMATION_CLASS, PVOID, ULONG, PULONG);
    2742 
    2743 NTSYSAPI NTSTATUS NTAPI NtReadFile(HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER, PULONG);
    2744 NTSYSAPI NTSTATUS NTAPI NtWriteFile(HANDLE, HANDLE, PIO_APC_ROUTINE, void const *, PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER, PULONG);
    2745 NTSYSAPI NTSTATUS NTAPI NtFlushBuffersFile(HANDLE, PIO_STATUS_BLOCK);
    2746 NTSYSAPI NTSTATUS NTAPI NtCancelIoFile(HANDLE, PIO_STATUS_BLOCK);
    2747 
    2748 NTSYSAPI NTSTATUS NTAPI NtReadVirtualMemory(HANDLE, PVOID, PVOID, SIZE_T, PSIZE_T);
    2749 NTSYSAPI NTSTATUS NTAPI NtWriteVirtualMemory(HANDLE, PVOID, void const *, SIZE_T, PSIZE_T);
    2750 
    2751 NTSYSAPI NTSTATUS NTAPI RtlAddAccessAllowedAce(PACL, ULONG, ULONG, PSID);
    2752 NTSYSAPI NTSTATUS NTAPI RtlCopySid(ULONG, PSID, PSID);
    2753 NTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL, ULONG, ULONG);
    2754 NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR, ULONG);
    2755 NTSYSAPI BOOLEAN  NTAPI RtlEqualSid(PSID, PSID);
    2756 NTSYSAPI NTSTATUS NTAPI RtlGetVersion(PRTL_OSVERSIONINFOW);
    2757 NTSYSAPI NTSTATUS NTAPI RtlInitializeSid(PSID, PSID_IDENTIFIER_AUTHORITY, UCHAR);
    2758 NTSYSAPI NTSTATUS NTAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN);
    2759 NTSYSAPI PULONG   NTAPI RtlSubAuthoritySid(PSID, ULONG);
     2742RT_DECL_NTAPI(NTSTATUS) NtSetInformationThread(HANDLE, THREADINFOCLASS, LPCVOID, ULONG);
     2743
     2744RT_DECL_NTAPI(NTSTATUS) NtQueryInformationToken(HANDLE, TOKEN_INFORMATION_CLASS, PVOID, ULONG, PULONG);
     2745RT_DECL_NTAPI(NTSTATUS) ZwQueryInformationToken(HANDLE, TOKEN_INFORMATION_CLASS, PVOID, ULONG, PULONG);
     2746
     2747RT_DECL_NTAPI(NTSTATUS) NtReadFile(HANDLE, HANDLE, PIO_APC_ROUTINE, PVOID, PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER, PULONG);
     2748RT_DECL_NTAPI(NTSTATUS) NtWriteFile(HANDLE, HANDLE, PIO_APC_ROUTINE, void const *, PIO_STATUS_BLOCK, PVOID, ULONG, PLARGE_INTEGER, PULONG);
     2749RT_DECL_NTAPI(NTSTATUS) NtFlushBuffersFile(HANDLE, PIO_STATUS_BLOCK);
     2750RT_DECL_NTAPI(NTSTATUS) NtCancelIoFile(HANDLE, PIO_STATUS_BLOCK);
     2751
     2752RT_DECL_NTAPI(NTSTATUS) NtReadVirtualMemory(HANDLE, PVOID, PVOID, SIZE_T, PSIZE_T);
     2753RT_DECL_NTAPI(NTSTATUS) NtWriteVirtualMemory(HANDLE, PVOID, void const *, SIZE_T, PSIZE_T);
     2754
     2755RT_DECL_NTAPI(NTSTATUS) RtlAddAccessAllowedAce(PACL, ULONG, ULONG, PSID);
     2756RT_DECL_NTAPI(NTSTATUS) RtlCopySid(ULONG, PSID, PSID);
     2757RT_DECL_NTAPI(NTSTATUS) RtlCreateAcl(PACL, ULONG, ULONG);
     2758RT_DECL_NTAPI(NTSTATUS) RtlCreateSecurityDescriptor(PSECURITY_DESCRIPTOR, ULONG);
     2759RT_DECL_NTAPI(BOOLEAN) RtlEqualSid(PSID, PSID);
     2760RT_DECL_NTAPI(NTSTATUS) RtlGetVersion(PRTL_OSVERSIONINFOW);
     2761RT_DECL_NTAPI(NTSTATUS) RtlInitializeSid(PSID, PSID_IDENTIFIER_AUTHORITY, UCHAR);
     2762RT_DECL_NTAPI(NTSTATUS) RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN);
     2763RT_DECL_NTAPI(PULONG)  RtlSubAuthoritySid(PSID, ULONG);
    27602764
    27612765#endif /* IPRT_NT_USE_WINTERNL */
     
    28042808# define NtQueryObject ZwQueryObject
    28052809#endif
    2806 NTSYSAPI NTSTATUS NTAPI NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
    2807 NTSYSAPI NTSTATUS NTAPI NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
    2808 NTSYSAPI NTSTATUS NTAPI NtDuplicateObject(HANDLE, HANDLE, HANDLE, PHANDLE, ACCESS_MASK, ULONG, ULONG);
    2809 
    2810 NTSYSAPI NTSTATUS NTAPI NtOpenDirectoryObject(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
     2810RT_DECL_NTAPI(NTSTATUS) NtQueryObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
     2811RT_DECL_NTAPI(NTSTATUS) NtSetInformationObject(HANDLE, OBJECT_INFORMATION_CLASS, PVOID, ULONG);
     2812RT_DECL_NTAPI(NTSTATUS) NtDuplicateObject(HANDLE, HANDLE, HANDLE, PHANDLE, ACCESS_MASK, ULONG, ULONG);
     2813
     2814RT_DECL_NTAPI(NTSTATUS) NtOpenDirectoryObject(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
    28112815
    28122816typedef struct _OBJECT_DIRECTORY_INFORMATION
     
    28162820} OBJECT_DIRECTORY_INFORMATION;
    28172821typedef OBJECT_DIRECTORY_INFORMATION *POBJECT_DIRECTORY_INFORMATION;
    2818 NTSYSAPI NTSTATUS NTAPI NtQueryDirectoryObject(HANDLE, PVOID, ULONG, BOOLEAN, BOOLEAN, PULONG, PULONG);
    2819 
    2820 NTSYSAPI NTSTATUS NTAPI NtSuspendProcess(HANDLE);
    2821 NTSYSAPI NTSTATUS NTAPI NtResumeProcess(HANDLE);
     2822RT_DECL_NTAPI(NTSTATUS) NtQueryDirectoryObject(HANDLE, PVOID, ULONG, BOOLEAN, BOOLEAN, PULONG, PULONG);
     2823
     2824RT_DECL_NTAPI(NTSTATUS) NtSuspendProcess(HANDLE);
     2825RT_DECL_NTAPI(NTSTATUS) NtResumeProcess(HANDLE);
    28222826/** @name ProcessDefaultHardErrorMode bit definitions.
    28232827 * @{ */
     
    28272831#define PROCESS_HARDERR_NO_OPEN_FILE_ERROR          UINT32_C(0x00008000)
    28282832/** @} */
    2829 NTSYSAPI NTSTATUS NTAPI NtSetInformationProcess(HANDLE, PROCESSINFOCLASS, PVOID, ULONG);
    2830 NTSYSAPI NTSTATUS NTAPI NtTerminateProcess(HANDLE, LONG);
     2833RT_DECL_NTAPI(NTSTATUS) NtSetInformationProcess(HANDLE, PROCESSINFOCLASS, PVOID, ULONG);
     2834RT_DECL_NTAPI(NTSTATUS) NtTerminateProcess(HANDLE, LONG);
    28312835
    28322836/** Returned by NtQUerySection with SectionBasicInformation. */
     
    28852889    MaxSectionInfoClass
    28862890} SECTION_INFORMATION_CLASS;
    2887 NTSYSAPI NTSTATUS NTAPI NtQuerySection(HANDLE, SECTION_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
    2888 
    2889 NTSYSAPI NTSTATUS NTAPI NtCreateSymbolicLinkObject(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PUNICODE_STRING pTarget);
    2890 NTSYSAPI NTSTATUS NTAPI NtOpenSymbolicLinkObject(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
    2891 NTSYSAPI NTSTATUS NTAPI NtQuerySymbolicLinkObject(HANDLE, PUNICODE_STRING, PULONG);
     2891RT_DECL_NTAPI(NTSTATUS) NtQuerySection(HANDLE, SECTION_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
     2892
     2893RT_DECL_NTAPI(NTSTATUS) NtCreateSymbolicLinkObject(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PUNICODE_STRING pTarget);
     2894RT_DECL_NTAPI(NTSTATUS) NtOpenSymbolicLinkObject(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
     2895RT_DECL_NTAPI(NTSTATUS) NtQuerySymbolicLinkObject(HANDLE, PUNICODE_STRING, PULONG);
    28922896#ifndef SYMBOLIC_LINK_QUERY
    28932897# define SYMBOLIC_LINK_QUERY        UINT32_C(0x00000001)
     
    28972901#endif
    28982902
    2899 NTSYSAPI NTSTATUS NTAPI NtQueryInformationThread(HANDLE, THREADINFOCLASS, PVOID, ULONG, PULONG);
    2900 NTSYSAPI NTSTATUS NTAPI NtResumeThread(HANDLE, PULONG);
    2901 NTSYSAPI NTSTATUS NTAPI NtSuspendThread(HANDLE, PULONG);
    2902 NTSYSAPI NTSTATUS NTAPI NtTerminateThread(HANDLE, LONG);
    2903 NTSYSAPI NTSTATUS NTAPI NtGetContextThread(HANDLE, PCONTEXT);
    2904 NTSYSAPI NTSTATUS NTAPI NtSetContextThread(HANDLE, PCONTEXT);
    2905 NTSYSAPI NTSTATUS NTAPI ZwYieldExecution(void);
     2903RT_DECL_NTAPI(NTSTATUS) NtQueryInformationThread(HANDLE, THREADINFOCLASS, PVOID, ULONG, PULONG);
     2904RT_DECL_NTAPI(NTSTATUS) NtResumeThread(HANDLE, PULONG);
     2905RT_DECL_NTAPI(NTSTATUS) NtSuspendThread(HANDLE, PULONG);
     2906RT_DECL_NTAPI(NTSTATUS) NtTerminateThread(HANDLE, LONG);
     2907RT_DECL_NTAPI(NTSTATUS) NtGetContextThread(HANDLE, PCONTEXT);
     2908RT_DECL_NTAPI(NTSTATUS) NtSetContextThread(HANDLE, PCONTEXT);
     2909RT_DECL_NTAPI(NTSTATUS) ZwYieldExecution(void);
    29062910
    29072911
     
    29422946# define NtQueryVirtualMemory ZwQueryVirtualMemory
    29432947#endif
    2944 NTSYSAPI NTSTATUS NTAPI NtQueryVirtualMemory(HANDLE, void const *, MEMORY_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
     2948RT_DECL_NTAPI(NTSTATUS) NtQueryVirtualMemory(HANDLE, void const *, MEMORY_INFORMATION_CLASS, PVOID, SIZE_T, PSIZE_T);
    29452949#ifdef IPRT_NT_USE_WINTERNL
    2946 NTSYSAPI NTSTATUS NTAPI NtAllocateVirtualMemory(HANDLE, PVOID *, ULONG, PSIZE_T, ULONG, ULONG);
    2947 #endif
    2948 NTSYSAPI NTSTATUS NTAPI NtFreeVirtualMemory(HANDLE, PVOID *, PSIZE_T, ULONG);
    2949 NTSYSAPI NTSTATUS NTAPI NtProtectVirtualMemory(HANDLE, PVOID *, PSIZE_T, ULONG, PULONG);
     2950RT_DECL_NTAPI(NTSTATUS) NtAllocateVirtualMemory(HANDLE, PVOID *, ULONG, PSIZE_T, ULONG, ULONG);
     2951#endif
     2952RT_DECL_NTAPI(NTSTATUS) NtFreeVirtualMemory(HANDLE, PVOID *, PSIZE_T, ULONG);
     2953RT_DECL_NTAPI(NTSTATUS) NtProtectVirtualMemory(HANDLE, PVOID *, PSIZE_T, ULONG, PULONG);
    29502954
    29512955typedef enum _SYSTEM_INFORMATION_CLASS
     
    31983202typedef RTL_PROCESS_MODULES *PRTL_PROCESS_MODULES;
    31993203
    3200 NTSYSAPI NTSTATUS NTAPI NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG);
     3204RT_DECL_NTAPI(NTSTATUS) NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG);
    32013205#ifndef IPRT_NT_MAP_TO_ZW
    3202 NTSYSAPI NTSTATUS NTAPI ZwQuerySystemInformation(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG);
    3203 #endif
    3204 
    3205 NTSYSAPI NTSTATUS NTAPI NtSetTimerResolution(ULONG cNtTicksWanted, BOOLEAN fSetResolution, PULONG pcNtTicksCur);
    3206 NTSYSAPI NTSTATUS NTAPI NtQueryTimerResolution(PULONG pcNtTicksMin, PULONG pcNtTicksMax, PULONG pcNtTicksCur);
    3207 
    3208 NTSYSAPI NTSTATUS NTAPI NtDelayExecution(BOOLEAN, PLARGE_INTEGER);
    3209 NTSYSAPI NTSTATUS NTAPI NtYieldExecution(void);
     3206RT_DECL_NTAPI(NTSTATUS) ZwQuerySystemInformation(SYSTEM_INFORMATION_CLASS, PVOID, ULONG, PULONG);
     3207#endif
     3208
     3209RT_DECL_NTAPI(NTSTATUS) NtSetTimerResolution(ULONG cNtTicksWanted, BOOLEAN fSetResolution, PULONG pcNtTicksCur);
     3210RT_DECL_NTAPI(NTSTATUS) NtQueryTimerResolution(PULONG pcNtTicksMin, PULONG pcNtTicksMax, PULONG pcNtTicksCur);
     3211
     3212RT_DECL_NTAPI(NTSTATUS) NtDelayExecution(BOOLEAN, PLARGE_INTEGER);
     3213RT_DECL_NTAPI(NTSTATUS) NtYieldExecution(void);
    32103214#ifndef IPRT_NT_USE_WINTERNL
    3211 NTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(HANDLE, BOOLEAN PLARGE_INTEGER);
     3215RT_DECL_NTAPI(NTSTATUS) NtWaitForSingleObject(HANDLE, BOOLEAN PLARGE_INTEGER);
    32123216#endif
    32133217typedef NTSYSAPI NTSTATUS (NTAPI *PFNNTWAITFORSINGLEOBJECT)(HANDLE, BOOLEAN, PLARGE_INTEGER);
    32143218typedef enum _OBJECT_WAIT_TYPE { WaitAllObjects = 0, WaitAnyObject = 1, ObjectWaitTypeHack = 0x7fffffff } OBJECT_WAIT_TYPE;
    3215 NTSYSAPI NTSTATUS NTAPI NtWaitForMultipleObjects(ULONG, PHANDLE, OBJECT_WAIT_TYPE, BOOLEAN, PLARGE_INTEGER);
    3216 
    3217 NTSYSAPI NTSTATUS NTAPI NtQuerySecurityObject(HANDLE, ULONG, PSECURITY_DESCRIPTOR, ULONG, PULONG);
     3219RT_DECL_NTAPI(NTSTATUS) NtWaitForMultipleObjects(ULONG, PHANDLE, OBJECT_WAIT_TYPE, BOOLEAN, PLARGE_INTEGER);
     3220
     3221RT_DECL_NTAPI(NTSTATUS) NtQuerySecurityObject(HANDLE, ULONG, PSECURITY_DESCRIPTOR, ULONG, PULONG);
    32183222
    32193223#ifdef IPRT_NT_USE_WINTERNL
     
    32263230} EVENT_TYPE;
    32273231#endif
    3228 NTSYSAPI NTSTATUS NTAPI NtCreateEvent(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, EVENT_TYPE, BOOLEAN);
    3229 NTSYSAPI NTSTATUS NTAPI NtOpenEvent(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
     3232RT_DECL_NTAPI(NTSTATUS) NtCreateEvent(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, EVENT_TYPE, BOOLEAN);
     3233RT_DECL_NTAPI(NTSTATUS) NtOpenEvent(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
    32303234typedef NTSYSAPI NTSTATUS (NTAPI *PFNNTCLEAREVENT)(HANDLE);
    3231 NTSYSAPI NTSTATUS NTAPI NtClearEvent(HANDLE);
    3232 NTSYSAPI NTSTATUS NTAPI NtResetEvent(HANDLE, PULONG);
    3233 NTSYSAPI NTSTATUS NTAPI NtSetEvent(HANDLE, PULONG);
     3235RT_DECL_NTAPI(NTSTATUS) NtClearEvent(HANDLE);
     3236RT_DECL_NTAPI(NTSTATUS) NtResetEvent(HANDLE, PULONG);
     3237RT_DECL_NTAPI(NTSTATUS) NtSetEvent(HANDLE, PULONG);
    32343238typedef NTSYSAPI NTSTATUS (NTAPI *PFNNTSETEVENT)(HANDLE, PULONG);
    32353239typedef enum _EVENT_INFORMATION_CLASS
     
    32443248} EVENT_BASIC_INFORMATION;
    32453249typedef EVENT_BASIC_INFORMATION *PEVENT_BASIC_INFORMATION;
    3246 NTSYSAPI NTSTATUS NTAPI NtQueryEvent(HANDLE, EVENT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
     3250RT_DECL_NTAPI(NTSTATUS) NtQueryEvent(HANDLE, EVENT_INFORMATION_CLASS, PVOID, ULONG, PULONG);
    32473251
    32483252#ifdef IPRT_NT_USE_WINTERNL
     
    32673271typedef KEY_VALUE_PARTIAL_INFORMATION *PKEY_VALUE_PARTIAL_INFORMATION;
    32683272#endif
    3269 NTSYSAPI NTSTATUS NTAPI NtOpenKey(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
    3270 NTSYSAPI NTSTATUS NTAPI NtQueryValueKey(HANDLE, PUNICODE_STRING, KEY_VALUE_INFORMATION_CLASS, PVOID, ULONG, PULONG);
    3271 
    3272 
    3273 NTSYSAPI NTSTATUS NTAPI RtlAddAccessDeniedAce(PACL, ULONG, ULONG, PSID);
     3273RT_DECL_NTAPI(NTSTATUS) NtOpenKey(PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES);
     3274RT_DECL_NTAPI(NTSTATUS) NtQueryValueKey(HANDLE, PUNICODE_STRING, KEY_VALUE_INFORMATION_CLASS, PVOID, ULONG, PULONG);
     3275
     3276
     3277RT_DECL_NTAPI(NTSTATUS) RtlAddAccessDeniedAce(PACL, ULONG, ULONG, PSID);
    32743278
    32753279
     
    33413345
    33423346
    3343 NTSYSAPI NTSTATUS NTAPI RtlCreateUserProcess(PUNICODE_STRING, ULONG, PRTL_USER_PROCESS_PARAMETERS, PSECURITY_DESCRIPTOR,
     3347RT_DECL_NTAPI(NTSTATUS) RtlCreateUserProcess(PUNICODE_STRING, ULONG, PRTL_USER_PROCESS_PARAMETERS, PSECURITY_DESCRIPTOR,
    33443348                                             PSECURITY_DESCRIPTOR, HANDLE, BOOLEAN, HANDLE, HANDLE, PRTL_USER_PROCESS_INFORMATION);
    3345 NTSYSAPI NTSTATUS NTAPI RtlCreateProcessParameters(PRTL_USER_PROCESS_PARAMETERS *, PUNICODE_STRING ImagePathName,
     3349RT_DECL_NTAPI(NTSTATUS) RtlCreateProcessParameters(PRTL_USER_PROCESS_PARAMETERS *, PUNICODE_STRING ImagePathName,
    33463350                                                   PUNICODE_STRING DllPath, PUNICODE_STRING CurrentDirectory,
    33473351                                                   PUNICODE_STRING CommandLine, PUNICODE_STRING Environment,
    33483352                                                   PUNICODE_STRING WindowTitle, PUNICODE_STRING DesktopInfo,
    33493353                                                   PUNICODE_STRING ShellInfo, PUNICODE_STRING RuntimeInfo);
    3350 NTSYSAPI VOID     NTAPI RtlDestroyProcessParameters(PRTL_USER_PROCESS_PARAMETERS);
    3351 NTSYSAPI NTSTATUS NTAPI RtlCreateUserThread(HANDLE, PSECURITY_DESCRIPTOR, BOOLEAN, ULONG, SIZE_T, SIZE_T,
     3354RT_DECL_NTAPI(VOID)    RtlDestroyProcessParameters(PRTL_USER_PROCESS_PARAMETERS);
     3355RT_DECL_NTAPI(NTSTATUS) RtlCreateUserThread(HANDLE, PSECURITY_DESCRIPTOR, BOOLEAN, ULONG, SIZE_T, SIZE_T,
    33523356                                            PFNRT, PVOID, PHANDLE, PCLIENT_ID);
    33533357
     
    33653369#endif
    33663370
    3367 /*NTSYSAPI ULONG NTAPI RtlNtStatusToDosError(NTSTATUS rcNt);*/
     3371/*RT_DECL_NTAPI(ULONG) RtlNtStatusToDosError(NTSTATUS rcNt);*/
    33683372
    33693373/** @def RTL_QUERY_REGISTRY_TYPECHECK
     
    33903394typedef ULONG KEPROCESSORINDEX; /**< Bitmap indexes != process numbers, apparently. */
    33913395
    3392 NTSYSAPI VOID     NTAPI KeInitializeAffinityEx(PKAFFINITY_EX pAffinity);
     3396RT_DECL_NTAPI(VOID)          KeInitializeAffinityEx(PKAFFINITY_EX pAffinity);
    33933397typedef  VOID    (NTAPI *PFNKEINITIALIZEAFFINITYEX)(PKAFFINITY_EX pAffinity);
    3394 NTSYSAPI VOID     NTAPI KeAddProcessorAffinityEx(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
     3398RT_DECL_NTAPI(VOID)          KeAddProcessorAffinityEx(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
    33953399typedef  VOID    (NTAPI *PFNKEADDPROCESSORAFFINITYEX)(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
    3396 NTSYSAPI VOID     NTAPI KeRemoveProcessorAffinityEx(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
     3400RT_DECL_NTAPI(VOID)          KeRemoveProcessorAffinityEx(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
    33973401typedef  VOID    (NTAPI *PFNKEREMOVEPROCESSORAFFINITYEX)(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
    3398 NTSYSAPI BOOLEAN  NTAPI KeInterlockedSetProcessorAffinityEx(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
     3402RT_DECL_NTAPI(BOOLEAN)      KeInterlockedSetProcessorAffinityEx(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
    33993403typedef  BOOLEAN (NTAPI *PFNKEINTERLOCKEDSETPROCESSORAFFINITYEX)(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
    3400 NTSYSAPI BOOLEAN  NTAPI KeInterlockedClearProcessorAffinityEx(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
     3404RT_DECL_NTAPI(BOOLEAN)      KeInterlockedClearProcessorAffinityEx(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
    34013405typedef  BOOLEAN (NTAPI *PFNKEINTERLOCKEDCLEARPROCESSORAFFINITYEX)(PKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
    3402 NTSYSAPI BOOLEAN  NTAPI KeCheckProcessorAffinityEx(PCKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
     3406RT_DECL_NTAPI(BOOLEAN)      KeCheckProcessorAffinityEx(PCKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
    34033407typedef  BOOLEAN (NTAPI *PFNKECHECKPROCESSORAFFINITYEX)(PCKAFFINITY_EX pAffinity, KEPROCESSORINDEX idxProcessor);
    3404 NTSYSAPI VOID     NTAPI KeCopyAffinityEx(PKAFFINITY_EX pDst, PCKAFFINITY_EX pSrc);
     3408RT_DECL_NTAPI(VOID)          KeCopyAffinityEx(PKAFFINITY_EX pDst, PCKAFFINITY_EX pSrc);
    34053409typedef  VOID    (NTAPI *PFNKECOPYAFFINITYEX)(PKAFFINITY_EX pDst, PCKAFFINITY_EX pSrc);
    3406 NTSYSAPI VOID     NTAPI KeComplementAffinityEx(PKAFFINITY_EX pResult, PCKAFFINITY_EX pIn);
     3410RT_DECL_NTAPI(VOID)          KeComplementAffinityEx(PKAFFINITY_EX pResult, PCKAFFINITY_EX pIn);
    34073411typedef  VOID    (NTAPI *PFNKECOMPLEMENTAFFINITYEX)(PKAFFINITY_EX pResult, PCKAFFINITY_EX pIn);
    3408 NTSYSAPI BOOLEAN  NTAPI KeAndAffinityEx(PCKAFFINITY_EX pIn1, PCKAFFINITY_EX pIn2, PKAFFINITY_EX pResult OPTIONAL);
     3412RT_DECL_NTAPI(BOOLEAN)      KeAndAffinityEx(PCKAFFINITY_EX pIn1, PCKAFFINITY_EX pIn2, PKAFFINITY_EX pResult OPTIONAL);
    34093413typedef  BOOLEAN (NTAPI *PFNKEANDAFFINITYEX)(PCKAFFINITY_EX pIn1, PCKAFFINITY_EX pIn2, PKAFFINITY_EX pResult OPTIONAL);
    3410 NTSYSAPI BOOLEAN  NTAPI KeOrAffinityEx(PCKAFFINITY_EX pIn1, PCKAFFINITY_EX pIn2, PKAFFINITY_EX pResult OPTIONAL);
     3414RT_DECL_NTAPI(BOOLEAN)      KeOrAffinityEx(PCKAFFINITY_EX pIn1, PCKAFFINITY_EX pIn2, PKAFFINITY_EX pResult OPTIONAL);
    34113415typedef  BOOLEAN (NTAPI *PFNKEORAFFINITYEX)(PCKAFFINITY_EX pIn1, PCKAFFINITY_EX pIn2, PKAFFINITY_EX pResult OPTIONAL);
    34123416/** Works like anding the complemented subtrahend with the minuend. */
    3413 NTSYSAPI BOOLEAN  NTAPI KeSubtractAffinityEx(PCKAFFINITY_EX pMinuend, PCKAFFINITY_EX pSubtrahend, PKAFFINITY_EX pResult OPTIONAL);
     3417RT_DECL_NTAPI(BOOLEAN)      KeSubtractAffinityEx(PCKAFFINITY_EX pMinuend, PCKAFFINITY_EX pSubtrahend, PKAFFINITY_EX pResult OPTIONAL);
    34143418typedef  BOOLEAN (NTAPI *PFNKESUBTRACTAFFINITYEX)(PCKAFFINITY_EX pMinuend, PCKAFFINITY_EX pSubtrahend, PKAFFINITY_EX pResult OPTIONAL);
    3415 NTSYSAPI BOOLEAN  NTAPI KeIsEqualAffinityEx(PCKAFFINITY_EX pLeft, PCKAFFINITY_EX pRight);
     3419RT_DECL_NTAPI(BOOLEAN)      KeIsEqualAffinityEx(PCKAFFINITY_EX pLeft, PCKAFFINITY_EX pRight);
    34163420typedef  BOOLEAN (NTAPI *PFNKEISEQUALAFFINITYEX)(PCKAFFINITY_EX pLeft, PCKAFFINITY_EX pRight);
    3417 NTSYSAPI BOOLEAN  NTAPI KeIsEmptyAffinityEx(PCKAFFINITY_EX pAffinity);
     3421RT_DECL_NTAPI(BOOLEAN)      KeIsEmptyAffinityEx(PCKAFFINITY_EX pAffinity);
    34183422typedef  BOOLEAN (NTAPI *PFNKEISEMPTYAFFINITYEX)(PCKAFFINITY_EX pAffinity);
    3419 NTSYSAPI BOOLEAN  NTAPI KeIsSubsetAffinityEx(PCKAFFINITY_EX pSubset, PCKAFFINITY_EX pSuperSet);
     3423RT_DECL_NTAPI(BOOLEAN)      KeIsSubsetAffinityEx(PCKAFFINITY_EX pSubset, PCKAFFINITY_EX pSuperSet);
    34203424typedef  BOOLEAN (NTAPI *PFNKEISSUBSETAFFINITYEX)(PCKAFFINITY_EX pSubset, PCKAFFINITY_EX pSuperSet);
    3421 NTSYSAPI ULONG    NTAPI KeCountSetBitsAffinityEx(PCKAFFINITY_EX pAffinity);
     3425RT_DECL_NTAPI(ULONG)    KeCountSetBitsAffinityEx(PCKAFFINITY_EX pAffinity);
    34223426typedef  ULONG   (NTAPI *PFNKECOUNTSETAFFINITYEX)(PCKAFFINITY_EX pAffinity);
    3423 NTSYSAPI KEPROCESSORINDEX  NTAPI KeFindFirstSetLeftAffinityEx(PCKAFFINITY_EX pAffinity);
     3427RT_DECL_NTAPI(KEPROCESSORINDEX)      KeFindFirstSetLeftAffinityEx(PCKAFFINITY_EX pAffinity);
    34243428typedef  KEPROCESSORINDEX (NTAPI *PFNKEFINDFIRSTSETLEFTAFFINITYEX)(PCKAFFINITY_EX pAffinity);
    34253429typedef  NTSTATUS (NTAPI *PFNKEGETPROCESSORNUMBERFROMINDEX)(KEPROCESSORINDEX idxProcessor, PPROCESSOR_NUMBER pProcNumber);
     
    34413445typedef  LOGICAL  (NTAPI *PFNKESHOULDYIELDPROCESSOR)(void);
    34423446
    3443 NTSYSAPI BOOLEAN  NTAPI ObFindHandleForObject(PEPROCESS pProcess, PVOID pvObject, POBJECT_TYPE pObjectType,
     3447RT_DECL_NTAPI(BOOLEAN) ObFindHandleForObject(PEPROCESS pProcess, PVOID pvObject, POBJECT_TYPE pObjectType,
    34443448                                              PVOID pvOptionalConditions, PHANDLE phFound);
    3445 NTSYSAPI NTSTATUS NTAPI ObReferenceObjectByName(PUNICODE_STRING pObjectPath, ULONG fAttributes, PACCESS_STATE pAccessState,
     3449RT_DECL_NTAPI(NTSTATUS) ObReferenceObjectByName(PUNICODE_STRING pObjectPath, ULONG fAttributes, PACCESS_STATE pAccessState,
    34463450                                                ACCESS_MASK fDesiredAccess, POBJECT_TYPE pObjectType,
    34473451                                                KPROCESSOR_MODE enmAccessMode, PVOID pvParseContext, PVOID *ppvObject);
    3448 NTSYSAPI HANDLE   NTAPI PsGetProcessInheritedFromUniqueProcessId(PEPROCESS);
    3449 NTSYSAPI UCHAR *  NTAPI PsGetProcessImageFileName(PEPROCESS);
    3450 NTSYSAPI BOOLEAN  NTAPI PsIsProcessBeingDebugged(PEPROCESS);
    3451 NTSYSAPI ULONG    NTAPI PsGetProcessSessionId(PEPROCESS);
     3452RT_DECL_NTAPI(HANDLE)  PsGetProcessInheritedFromUniqueProcessId(PEPROCESS);
     3453RT_DECL_NTAPI(UCHAR *) PsGetProcessImageFileName(PEPROCESS);
     3454RT_DECL_NTAPI(BOOLEAN) PsIsProcessBeingDebugged(PEPROCESS);
     3455RT_DECL_NTAPI(ULONG)    PsGetProcessSessionId(PEPROCESS);
    34523456extern DECLIMPORT(POBJECT_TYPE *) LpcPortObjectType;            /**< In vista+ this is the ALPC port object type. */
    34533457extern DECLIMPORT(POBJECT_TYPE *) LpcWaitablePortObjectType;    /**< In vista+ this is the ALPC port object type. */
     
    34803484#define CSR_MSG_NO_CREATED_PROCESS    UINT32_C(0x10000)
    34813485#define CSR_MSG_NO_CREATED_THREAD     UINT32_C(0x10001)
    3482 NTSYSAPI NTSTATUS NTAPI CsrClientCallServer(PVOID, PVOID, ULONG, SIZE_T);
    3483 #endif
    3484 
    3485 NTSYSAPI VOID NTAPI     LdrInitializeThunk(PVOID, PVOID, PVOID);
     3486RT_DECL_NTAPI(NTSTATUS) CsrClientCallServer(PVOID, PVOID, ULONG, SIZE_T);
     3487#endif
     3488
     3489RT_DECL_NTAPI(VOID)     LdrInitializeThunk(PVOID, PVOID, PVOID);
    34863490
    34873491typedef struct _LDR_DLL_LOADED_NOTIFICATION_DATA
     
    35083512#define LDR_DLL_NOTIFICATION_REASON_LOADED      UINT32_C(1)
    35093513#define LDR_DLL_NOTIFICATION_REASON_UNLOADED    UINT32_C(2)
    3510 NTSYSAPI NTSTATUS NTAPI LdrRegisterDllNotification(ULONG fFlags, PLDR_DLL_NOTIFICATION_FUNCTION pfnCallback, PVOID pvUser,
     3514RT_DECL_NTAPI(NTSTATUS) LdrRegisterDllNotification(ULONG fFlags, PLDR_DLL_NOTIFICATION_FUNCTION pfnCallback, PVOID pvUser,
    35113515                                                   PVOID *pvCookie);
    35123516typedef NTSTATUS (NTAPI *PFNLDRREGISTERDLLNOTIFICATION)(ULONG, PLDR_DLL_NOTIFICATION_FUNCTION, PVOID, PVOID *);
    3513 NTSYSAPI NTSTATUS NTAPI LdrUnregisterDllNotification(PVOID pvCookie);
     3517RT_DECL_NTAPI(NTSTATUS) LdrUnregisterDllNotification(PVOID pvCookie);
    35143518typedef NTSTATUS (NTAPI *PFNLDRUNREGISTERDLLNOTIFICATION)(PVOID);
    35153519
    3516 NTSYSAPI NTSTATUS NTAPI LdrLoadDll(IN PWSTR pwszSearchPathOrFlags OPTIONAL, IN PULONG pfFlags OPTIONAL,
     3520RT_DECL_NTAPI(NTSTATUS) LdrLoadDll(IN PWSTR pwszSearchPathOrFlags OPTIONAL, IN PULONG pfFlags OPTIONAL,
    35173521                                   IN PCUNICODE_STRING pName, OUT PHANDLE phMod);
    35183522typedef NTSTATUS (NTAPI *PFNLDRLOADDLL)(IN PWSTR pwszSearchPathOrFlags OPTIONAL, IN PULONG pfFlags OPTIONAL,
    35193523                                        IN PCUNICODE_STRING pName, OUT PHANDLE phMod);
    3520 NTSYSAPI NTSTATUS NTAPI LdrUnloadDll(IN HANDLE hMod);
     3524RT_DECL_NTAPI(NTSTATUS) LdrUnloadDll(IN HANDLE hMod);
    35213525typedef NTSTATUS (NTAPI *PFNLDRUNLOADDLL)(IN HANDLE hMod);
    3522 NTSYSAPI NTSTATUS NTAPI LdrGetDllHandle(IN PCWSTR pwszDllPath OPTIONAL, IN PULONG pfFlags OPTIONAL,
     3526RT_DECL_NTAPI(NTSTATUS) LdrGetDllHandle(IN PCWSTR pwszDllPath OPTIONAL, IN PULONG pfFlags OPTIONAL,
    35233527                                        IN PCUNICODE_STRING pName, OUT PHANDLE phDll);
    35243528typedef NTSTATUS (NTAPI *PFNLDRGETDLLHANDLE)(IN PCWSTR pwszDllPath OPTIONAL, IN PULONG pfFlags OPTIONAL,
     
    35273531#define LDRGETDLLHANDLEEX_F_PIN                 RT_BIT_32(1)
    35283532/** @since Windows XP. */
    3529 NTSYSAPI NTSTATUS NTAPI LdrGetDllHandleEx(IN ULONG fFlags, IN PCWSTR pwszDllPath OPTIONAL, IN PULONG pfFlags OPTIONAL,
     3533RT_DECL_NTAPI(NTSTATUS) LdrGetDllHandleEx(IN ULONG fFlags, IN PCWSTR pwszDllPath OPTIONAL, IN PULONG pfFlags OPTIONAL,
    35303534                                          IN PCUNICODE_STRING pName, OUT PHANDLE phDll);
    35313535/** @since Windows XP. */
     
    35333537                                               IN PCUNICODE_STRING pName, OUT PHANDLE phDll);
    35343538/** @since Windows 7. */
    3535 NTSYSAPI NTSTATUS NTAPI LdrGetDllHandleByMapping(IN PVOID pvBase, OUT PHANDLE phDll);
     3539RT_DECL_NTAPI(NTSTATUS) LdrGetDllHandleByMapping(IN PVOID pvBase, OUT PHANDLE phDll);
    35363540/** @since Windows 7. */
    35373541typedef NTSTATUS (NTAPI *PFNLDRGETDLLHANDLEBYMAPPING)(IN PVOID pvBase, OUT PHANDLE phDll);
    35383542/** @since Windows 7. */
    3539 NTSYSAPI NTSTATUS NTAPI LdrGetDllHandleByName(IN PCUNICODE_STRING pName OPTIONAL, IN PCUNICODE_STRING pFullName OPTIONAL,
     3543RT_DECL_NTAPI(NTSTATUS) LdrGetDllHandleByName(IN PCUNICODE_STRING pName OPTIONAL, IN PCUNICODE_STRING pFullName OPTIONAL,
    35403544                                              OUT PHANDLE phDll);
    35413545/** @since Windows 7. */
     
    35433547                                                   OUT PHANDLE phDll);
    35443548#define LDRADDREFDLL_F_PIN                      RT_BIT_32(0)
    3545 NTSYSAPI NTSTATUS NTAPI LdrAddRefDll(IN ULONG fFlags, IN HANDLE hDll);
     3549RT_DECL_NTAPI(NTSTATUS) LdrAddRefDll(IN ULONG fFlags, IN HANDLE hDll);
    35463550typedef NTSTATUS (NTAPI *PFNLDRADDREFDLL)(IN ULONG fFlags, IN HANDLE hDll);
    3547 NTSYSAPI NTSTATUS NTAPI LdrGetProcedureAddress(IN HANDLE hDll, IN ANSI_STRING const *pSymbol OPTIONAL,
     3551RT_DECL_NTAPI(NTSTATUS) LdrGetProcedureAddress(IN HANDLE hDll, IN ANSI_STRING const *pSymbol OPTIONAL,
    35483552                                               IN ULONG uOrdinal OPTIONAL, OUT PVOID *ppvSymbol);
    35493553typedef NTSTATUS (NTAPI *PFNLDRGETPROCEDUREADDRESS)(IN HANDLE hDll, IN PCANSI_STRING pSymbol OPTIONAL,
     
    35513555#define LDRGETPROCEDUREADDRESSEX_F_DONT_RECORD_FORWARDER RT_BIT_32(0)
    35523556/** @since Windows Vista. */
    3553 NTSYSAPI NTSTATUS NTAPI LdrGetProcedureAddressEx(IN HANDLE hDll, IN ANSI_STRING const *pSymbol OPTIONAL,
     3557RT_DECL_NTAPI(NTSTATUS) LdrGetProcedureAddressEx(IN HANDLE hDll, IN ANSI_STRING const *pSymbol OPTIONAL,
    35543558                                                 IN ULONG uOrdinal OPTIONAL, OUT PVOID *ppvSymbol, ULONG fFlags);
    35553559/** @since Windows Vista. */
     
    35623566#define LDRLOCKLOADERLOCK_DISP_NOT_ACQUIRED UINT32_C(2)
    35633567/** @since Windows XP. */
    3564 NTSYSAPI NTSTATUS NTAPI LdrLockLoaderLock(IN ULONG fFlags, OUT PULONG puDisposition OPTIONAL, OUT PVOID *ppvCookie);
     3568RT_DECL_NTAPI(NTSTATUS) LdrLockLoaderLock(IN ULONG fFlags, OUT PULONG puDisposition OPTIONAL, OUT PVOID *ppvCookie);
    35653569/** @since Windows XP. */
    35663570typedef NTSTATUS (NTAPI *PFNLDRLOCKLOADERLOCK)(IN ULONG fFlags, OUT PULONG puDisposition OPTIONAL, OUT PVOID *ppvCookie);
    35673571#define LDRUNLOCKLOADERLOCK_F_RAISE_ERRORS  RT_BIT_32(0)
    35683572/** @since Windows XP. */
    3569 NTSYSAPI NTSTATUS NTAPI LdrUnlockLoaderLock(IN ULONG fFlags, OUT PVOID pvCookie);
     3573RT_DECL_NTAPI(NTSTATUS) LdrUnlockLoaderLock(IN ULONG fFlags, OUT PVOID pvCookie);
    35703574/** @since Windows XP. */
    35713575typedef NTSTATUS (NTAPI *PFNLDRUNLOCKLOADERLOCK)(IN ULONG fFlags, OUT PVOID pvCookie);
    35723576
    3573 NTSYSAPI NTSTATUS NTAPI RtlExpandEnvironmentStrings_U(PVOID, PUNICODE_STRING, PUNICODE_STRING, PULONG);
    3574 NTSYSAPI VOID NTAPI     RtlExitUserProcess(NTSTATUS rcExitCode); /**< Vista and later. */
    3575 NTSYSAPI VOID NTAPI     RtlExitUserThread(NTSTATUS rcExitCode);
    3576 NTSYSAPI NTSTATUS NTAPI RtlDosApplyFileIsolationRedirection_Ustr(IN ULONG fFlags,
     3577RT_DECL_NTAPI(NTSTATUS) RtlExpandEnvironmentStrings_U(PVOID, PUNICODE_STRING, PUNICODE_STRING, PULONG);
     3578RT_DECL_NTAPI(VOID)     RtlExitUserProcess(NTSTATUS rcExitCode); /**< Vista and later. */
     3579RT_DECL_NTAPI(VOID)     RtlExitUserThread(NTSTATUS rcExitCode);
     3580RT_DECL_NTAPI(NTSTATUS) RtlDosApplyFileIsolationRedirection_Ustr(IN ULONG fFlags,
    35773581                                                                 IN PCUNICODE_STRING pOrgName,
    35783582                                                                 IN PUNICODE_STRING pDefaultSuffix,
     
    35853589/** @since Windows 8.
    35863590 * @note Status code is always zero in windows 10 build 14393. */
    3587 NTSYSAPI NTSTATUS NTAPI ApiSetQueryApiSetPresence(IN PCUNICODE_STRING pAllegedApiSetDll, OUT PBOOLEAN pfPresent);
     3591RT_DECL_NTAPI(NTSTATUS) ApiSetQueryApiSetPresence(IN PCUNICODE_STRING pAllegedApiSetDll, OUT PBOOLEAN pfPresent);
    35883592/** @copydoc ApiSetQueryApiSetPresence */
    35893593typedef NTSTATUS (NTAPI *PFNAPISETQUERYAPISETPRESENCE)(IN PCUNICODE_STRING pAllegedApiSetDll, OUT PBOOLEAN pfPresent);
     
    36083612} RTL_HEAP_PARAMETERS;
    36093613typedef RTL_HEAP_PARAMETERS *PRTL_HEAP_PARAMETERS;
    3610 NTSYSAPI PVOID NTAPI RtlCreateHeap(ULONG fFlags, PVOID pvHeapBase, SIZE_T cbReserve, SIZE_T cbCommit, PVOID pvLock,
     3614RT_DECL_NTAPI(PVOID) RtlCreateHeap(ULONG fFlags, PVOID pvHeapBase, SIZE_T cbReserve, SIZE_T cbCommit, PVOID pvLock,
    36113615                                   PRTL_HEAP_PARAMETERS pParameters);
    36123616/** @name Heap flags (for RtlCreateHeap).
     
    36613665#  define HEAP_TAG_MASK                 (HEAP_MAXIMUM_TAG << HEAP_TAG_SHIFT)
    36623666/** @}  */
    3663 NTSYSAPI PVOID NTAPI    RtlAllocateHeap(HANDLE hHeap, ULONG fFlags, SIZE_T cb);
    3664 NTSYSAPI PVOID NTAPI    RtlReAllocateHeap(HANDLE hHeap, ULONG fFlags, PVOID pvOld, SIZE_T cbNew);
    3665 NTSYSAPI BOOLEAN NTAPI  RtlFreeHeap(HANDLE hHeap, ULONG fFlags, PVOID pvMem);
     3667RT_DECL_NTAPI(PVOID)        RtlAllocateHeap(HANDLE hHeap, ULONG fFlags, SIZE_T cb);
     3668RT_DECL_NTAPI(PVOID)        RtlReAllocateHeap(HANDLE hHeap, ULONG fFlags, PVOID pvOld, SIZE_T cbNew);
     3669RT_DECL_NTAPI(BOOLEAN)      RtlFreeHeap(HANDLE hHeap, ULONG fFlags, PVOID pvMem);
    36663670# endif /* IPRT_NT_USE_WINTERNL */
    3667 NTSYSAPI SIZE_T NTAPI   RtlCompactHeap(HANDLE hHeap, ULONG fFlags);
    3668 NTSYSAPI VOID NTAPI     RtlFreeUnicodeString(PUNICODE_STRING);
    3669 NTSYSAPI SIZE_T NTAPI   RtlSizeHeap(HANDLE hHeap, ULONG fFlags, PVOID pvMem);
    3670 NTSYSAPI NTSTATUS NTAPI RtlGetLastNtStatus(VOID);
    3671 NTSYSAPI ULONG NTAPI    RtlGetLastWin32Error(VOID);
    3672 NTSYSAPI VOID NTAPI     RtlSetLastWin32Error(ULONG uError);
    3673 NTSYSAPI VOID NTAPI     RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS rcNt);
    3674 NTSYSAPI VOID NTAPI     RtlRestoreLastWin32Error(ULONG uError);
    3675 NTSYSAPI BOOLEAN NTAPI  RtlQueryPerformanceCounter(PLARGE_INTEGER);
    3676 NTSYSAPI uint64_t NTAPI RtlGetSystemTimePrecise(VOID);
     3671RT_DECL_NTAPI(SIZE_T)       RtlCompactHeap(HANDLE hHeap, ULONG fFlags);
     3672RT_DECL_NTAPI(VOID)         RtlFreeUnicodeString(PUNICODE_STRING);
     3673RT_DECL_NTAPI(SIZE_T)       RtlSizeHeap(HANDLE hHeap, ULONG fFlags, PVOID pvMem);
     3674RT_DECL_NTAPI(NTSTATUS)    RtlGetLastNtStatus(VOID);
     3675RT_DECL_NTAPI(ULONG)        RtlGetLastWin32Error(VOID);
     3676RT_DECL_NTAPI(VOID)         RtlSetLastWin32Error(ULONG uError);
     3677RT_DECL_NTAPI(VOID)         RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS rcNt);
     3678RT_DECL_NTAPI(VOID)         RtlRestoreLastWin32Error(ULONG uError);
     3679RT_DECL_NTAPI(BOOLEAN)      RtlQueryPerformanceCounter(PLARGE_INTEGER);
     3680RT_DECL_NTAPI(uint64_t)    RtlGetSystemTimePrecise(VOID);
    36773681typedef uint64_t (NTAPI * PFNRTLGETSYSTEMTIMEPRECISE)(VOID);
    3678 NTSYSAPI uint64_t NTAPI RtlGetInterruptTimePrecise(uint64_t *puPerfTime);
     3682RT_DECL_NTAPI(uint64_t)    RtlGetInterruptTimePrecise(uint64_t *puPerfTime);
    36793683typedef uint64_t (NTAPI * PFNRTLGETINTERRUPTTIMEPRECISE)(uint64_t *);
    3680 NTSYSAPI BOOLEAN NTAPI RtlQueryUnbiasedInterruptTime(uint64_t *puInterruptTime);
     3684RT_DECL_NTAPI(BOOLEAN)      RtlQueryUnbiasedInterruptTime(uint64_t *puInterruptTime);
    36813685typedef BOOLEAN (NTAPI * PFNRTLQUERYUNBIASEDINTERRUPTTIME)(uint64_t *);
    36823686
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette