--- trunk/reactos/include/ndk/rtlfuncs.h 2005-09-05 17:35:31 UTC (rev 17659)
+++ trunk/reactos/include/ndk/rtlfuncs.h 2005-09-05 18:06:20 UTC (rev 17660)
@@ -17,15 +17,17 @@
/*
* Error and Exception Functions
*/
+NTSYSAPI
PVOID
-STDCALL
+NTAPI
RtlAddVectoredExceptionHandler(
IN ULONG FirstHandler,
IN PVECTORED_EXCEPTION_HANDLER VectoredHandler
);
+NTSYSAPI
VOID
-STDCALL
+NTAPI
RtlAssert(
PVOID FailedAssertion,
PVOID FileName,
@@ -33,53 +35,62 @@
PCHAR Message
);
+NTSYSAPI
PVOID
-STDCALL
+NTAPI
RtlEncodePointer(IN PVOID Pointer);
+NTSYSAPI
PVOID
-STDCALL
+NTAPI
RtlDecodePointer(IN PVOID Pointer);
+NTSYSAPI
ULONG
-STDCALL
+NTAPI
RtlNtStatusToDosError(IN NTSTATUS Status);
+NTSYSAPI
VOID
-STDCALL
+NTAPI
RtlRaiseException(IN PEXCEPTION_RECORD ExceptionRecord);
+NTSYSAPI
VOID
-STDCALL
+NTAPI
RtlRaiseStatus(NTSTATUS Status);
+NTSYSAPI
LONG
-STDCALL
+NTAPI
RtlUnhandledExceptionFilter(struct _EXCEPTION_POINTERS* ExceptionInfo);
+NTSYSAPI
VOID
-STDCALL
+NTAPI
RtlUnwind(
PEXCEPTION_REGISTRATION RegistrationFrame,
PVOID ReturnAddress,
PEXCEPTION_RECORD ExceptionRecord,
- DWORD EaxValue
+ ULONG EaxValue
);
/*
* Heap Functions
*/
+NTSYSAPI
PVOID
-STDCALL
+NTAPI
RtlAllocateHeap(
IN HANDLE HeapHandle,
IN ULONG Flags,
IN ULONG Size
);
+NTSYSAPI
PVOID
-STDCALL
+NTAPI
RtlCreateHeap(
IN ULONG Flags,
IN PVOID BaseAddress OPTIONAL,
@@ -89,19 +100,21 @@
IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL
);
-DWORD
-STDCALL
+ULONG
+NTAPI
RtlCompactHeap(
HANDLE heap,
ULONG flags
);
+NTSYSAPI
HANDLE
-STDCALL
+NTAPI
RtlDestroyHeap(HANDLE hheap);
+NTSYSAPI
BOOLEAN
-STDCALL
+NTAPI
RtlFreeHeap(
IN HANDLE HeapHandle,
IN ULONG Flags,
@@ -109,14 +122,14 @@
);
ULONG
-STDCALL
+NTAPI
RtlGetProcessHeaps(
ULONG HeapCount,
HANDLE *HeapArray
);
PVOID
-STDCALL
+NTAPI
RtlReAllocateHeap(
HANDLE Heap,
ULONG Flags,
@@ -125,15 +138,15 @@
);
BOOLEAN
-STDCALL
+NTAPI
RtlLockHeap(IN HANDLE Heap);
BOOLEAN
-STDCALL
+NTAPI
RtlUnlockHeap(IN HANDLE Heap);
ULONG
-STDCALL
+NTAPI
RtlSizeHeap(
IN PVOID HeapHandle,
IN ULONG Flags,
@@ -141,7 +154,7 @@
);
BOOLEAN
-STDCALL
+NTAPI
RtlValidateHeap(
HANDLE Heap,
ULONG Flags,
@@ -154,16 +167,18 @@
/*
* Security Functions
*/
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlAbsoluteToSelfRelativeSD(
IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor,
- IN OUT PISECURITY_DESCRIPTOR_RELATIVE SelfRelativeSecurityDescriptor,
+ IN OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor,
IN PULONG BufferLength
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlAddAccessAllowedAce(
PACL Acl,
ULONG Revision,
@@ -172,17 +187,17 @@
);
NTSTATUS
-STDCALL
+NTAPI
RtlAddAccessAllowedAceEx(
IN OUT PACL pAcl,
- IN DWORD dwAceRevision,
- IN DWORD AceFlags,
- IN DWORD AccessMask,
+ IN ULONG dwAceRevision,
+ IN ULONG AceFlags,
+ IN ULONG AccessMask,
IN PSID pSid
);
NTSTATUS
-STDCALL
+NTAPI
RtlAddAccessDeniedAce(
PACL Acl,
ULONG Revision,
@@ -191,7 +206,7 @@
);
NTSTATUS
-STDCALL
+NTAPI
RtlAddAccessDeniedAceEx(
IN OUT PACL Acl,
IN ULONG Revision,
@@ -201,7 +216,7 @@
);
NTSTATUS
-STDCALL
+NTAPI
RtlAddAuditAccessAceEx(
IN OUT PACL Acl,
IN ULONG Revision,
@@ -212,18 +227,19 @@
IN BOOLEAN Failure
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlAddAce(
PACL Acl,
- ULONG Revision,
- ULONG StartingIndex,
- PACE AceList,
+ ULONG AceRevision,
+ ULONG StartingAceIndex,
+ PVOID AceList,
ULONG AceListLength
);
NTSTATUS
-STDCALL
+NTAPI
RtlAddAuditAccessAce(
PACL Acl,
ULONG Revision,
@@ -234,7 +250,7 @@
);
NTSTATUS
-STDCALL
+NTAPI
RtlAdjustPrivilege(
IN ULONG Privilege,
IN BOOLEAN NewValue,
@@ -242,8 +258,9 @@
OUT PBOOLEAN OldValue
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlAllocateAndInitializeSid(
IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
IN UCHAR SubAuthorityCount,
@@ -259,28 +276,29 @@
);
BOOLEAN
-STDCALL
+NTAPI
RtlAreAllAccessesGranted(
ACCESS_MASK GrantedAccess,
ACCESS_MASK DesiredAccess
);
BOOLEAN
-STDCALL
+NTAPI
RtlAreAnyAccessesGranted(
ACCESS_MASK GrantedAccess,
ACCESS_MASK DesiredAccess
);
+NTSYSAPI
VOID
-STDCALL
+NTAPI
RtlCopyLuid(
IN PLUID LuidDest,
IN PLUID LuidSrc
);
VOID
-STDCALL
+NTAPI
RtlCopyLuidAndAttributesArray(
ULONG Count,
PLUID_AND_ATTRIBUTES Src,
@@ -288,7 +306,7 @@
);
NTSTATUS
-STDCALL
+NTAPI
RtlCopySidAndAttributesArray(
ULONG Count,
PSID_AND_ATTRIBUTES Src,
@@ -300,95 +318,105 @@
);
NTSTATUS
-STDCALL
+NTAPI
RtlConvertSidToUnicodeString(
OUT PUNICODE_STRING DestinationString,
IN PSID Sid,
IN BOOLEAN AllocateDestinationString
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlCopySid(
IN ULONG Length,
IN PSID Destination,
IN PSID Source
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlCreateAcl(
PACL Acl,
ULONG AclSize,
ULONG AclRevision
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlCreateSecurityDescriptor(
PSECURITY_DESCRIPTOR SecurityDescriptor,
ULONG Revision
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlCreateSecurityDescriptorRelative(
PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor,
ULONG Revision
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlDeleteAce(
PACL Acl,
ULONG AceIndex
);
+NTSYSAPI
BOOLEAN
-STDCALL
+NTAPI
RtlEqualPrefixSid(
PSID Sid1,
PSID Sid2
);
+NTSYSAPI
BOOLEAN
-STDCALL
+NTAPI
RtlEqualSid (
IN PSID Sid1,
IN PSID Sid2
);
BOOLEAN
-STDCALL
+NTAPI
RtlFirstFreeAce(
PACL Acl,
PACE* Ace
);
+NTSYSAPI
PVOID
-STDCALL
+NTAPI
RtlFreeSid (
IN PSID Sid
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlGetAce(
PACL Acl,
ULONG AceIndex,
- PACE *Ace
+ PVOID *Ace
);
NTSTATUS
-STDCALL
+NTAPI
RtlGetControlSecurityDescriptor(
PSECURITY_DESCRIPTOR SecurityDescriptor,
PSECURITY_DESCRIPTOR_CONTROL Control,
PULONG Revision
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlGetDaclSecurityDescriptor(
IN PSECURITY_DESCRIPTOR SecurityDescriptor,
OUT PBOOLEAN DaclPresent,
@@ -396,8 +424,9 @@
OUT PBOOLEAN DaclDefaulted
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlGetSaclSecurityDescriptor(
PSECURITY_DESCRIPTOR SecurityDescriptor,
PBOOLEAN SaclPresent,
@@ -405,62 +434,72 @@
PBOOLEAN SaclDefaulted
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlGetGroupSecurityDescriptor(
IN PSECURITY_DESCRIPTOR SecurityDescriptor,
OUT PSID *Group,
OUT PBOOLEAN GroupDefaulted
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlGetOwnerSecurityDescriptor(
IN PSECURITY_DESCRIPTOR SecurityDescriptor,
OUT PSID *Owner,
OUT PBOOLEAN OwnerDefaulted
);
+NTSYSAPI
BOOLEAN
-STDCALL
+NTAPI
RtlGetSecurityDescriptorRMControl(
PSECURITY_DESCRIPTOR SecurityDescriptor,
PUCHAR RMControl
);
+NTSYSAPI
PSID_IDENTIFIER_AUTHORITY
-STDCALL
+NTAPI
RtlIdentifierAuthoritySid(PSID Sid);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlImpersonateSelf(IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlInitializeSid(
IN OUT PSID Sid,
IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
IN UCHAR SubAuthorityCount
);
+NTSYSAPI
ULONG
-STDCALL
-RtlLengthRequiredSid(IN UCHAR SubAuthorityCount);
+NTAPI
+RtlLengthRequiredSid(IN ULONG SubAuthorityCount);
+NTSYSAPI
ULONG
-STDCALL
+NTAPI
RtlLengthSid(IN PSID Sid);
+NTSYSAPI
VOID
-STDCALL
+NTAPI
RtlMapGenericMask(
PACCESS_MASK AccessMask,
PGENERIC_MAPPING GenericMapping
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlQueryInformationAcl(
PACL Acl,
PVOID Information,
@@ -468,10 +507,11 @@
ACL_INFORMATION_CLASS InformationClass
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlSelfRelativeToAbsoluteSD(
- IN PISECURITY_DESCRIPTOR_RELATIVE SelfRelativeSD,
+ IN PSECURITY_DESCRIPTOR SelfRelativeSD,
OUT PSECURITY_DESCRIPTOR AbsoluteSD,
IN PULONG AbsoluteSDSize,
IN PACL Dacl,
@@ -484,16 +524,18 @@
IN PULONG PrimaryGroupSize
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlSetControlSecurityDescriptor(
IN PSECURITY_DESCRIPTOR SecurityDescriptor,
IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
IN SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlSetDaclSecurityDescriptor (
PSECURITY_DESCRIPTOR SecurityDescriptor,
BOOLEAN DaclPresent,
@@ -501,16 +543,18 @@
BOOLEAN DaclDefaulted
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlSetGroupSecurityDescriptor(
IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
IN PSID Group,
IN BOOLEAN GroupDefaulted
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlSetInformationAcl(
PACL Acl,
PVOID Information,
@@ -518,16 +562,18 @@
ACL_INFORMATION_CLASS InformationClass
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlSetOwnerSecurityDescriptor(
IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
IN PSID Owner,
IN BOOLEAN OwnerDefaulted
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlSetSaclSecurityDescriptor(
IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
IN BOOLEAN SaclPresent,
@@ -535,54 +581,63 @@
IN BOOLEAN SaclDefaulted
);
+NTSYSAPI
VOID
-STDCALL
+NTAPI
RtlSetSecurityDescriptorRMControl(
PSECURITY_DESCRIPTOR SecurityDescriptor,
PUCHAR RMControl
);
+NTSYSAPI
PUCHAR
-STDCALL
+NTAPI
RtlSubAuthorityCountSid(
IN PSID Sid
);
+NTSYSAPI
PULONG
-STDCALL
+NTAPI
RtlSubAuthoritySid(
IN PSID Sid,
IN ULONG SubAuthority
);
+NTSYSAPI
BOOLEAN
-STDCALL
+NTAPI
RtlValidRelativeSecurityDescriptor(
- IN PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptorInput,
+ IN PSECURITY_DESCRIPTOR SecurityDescriptorInput,
IN ULONG SecurityDescriptorLength,
IN SECURITY_INFORMATION RequiredInformation
);
+NTSYSAPI
BOOLEAN
-STDCALL
+NTAPI
RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor);
+NTSYSAPI
BOOLEAN
-STDCALL
+NTAPI
RtlValidSid(IN PSID Sid);
+NTSYSAPI
BOOLEAN
-STDCALL
+NTAPI
RtlValidAcl(PACL Acl);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlDeleteSecurityObject(
IN PSECURITY_DESCRIPTOR *ObjectDescriptor
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlNewSecurityObject(
IN PSECURITY_DESCRIPTOR ParentDescriptor,
IN PSECURITY_DESCRIPTOR CreatorDescriptor,
@@ -592,8 +647,9 @@
IN PGENERIC_MAPPING GenericMapping
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlQuerySecurityObject(
IN PSECURITY_DESCRIPTOR ObjectDescriptor,
IN SECURITY_INFORMATION SecurityInformation,
@@ -602,8 +658,9 @@
OUT PULONG ReturnLength
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlSetSecurityObject(
IN SECURITY_INFORMATION SecurityInformation,
IN PSECURITY_DESCRIPTOR ModificationDescriptor,
@@ -615,8 +672,9 @@
/*
* Single-Character Functions
*/
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlLargeIntegerToChar(
IN PLARGE_INTEGER Value,
IN ULONG Base,
@@ -624,20 +682,24 @@
IN OUT PCHAR String
);
+NTSYSAPI
CHAR
-STDCALL
+NTAPI
RtlUpperChar(CHAR Source);
+NTSYSAPI
WCHAR
-STDCALL
+NTAPI
RtlUpcaseUnicodeChar(WCHAR Source);
+NTSYSAPI
WCHAR
-STDCALL
+NTAPI
RtlDowncaseUnicodeChar(IN WCHAR Source);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlIntegerToChar(
IN ULONG Value,
IN ULONG Base,
@@ -645,8 +707,9 @@
IN OUT PCHAR String
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlIntegerToUnicode(
IN ULONG Value,
IN ULONG Base OPTIONAL,
@@ -654,70 +717,102 @@
IN OUT LPWSTR String
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlIntegerToUnicodeString(
IN ULONG Value,
IN ULONG Base,
IN OUT PUNICODE_STRING String
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlCharToInteger(
PCSZ String,
ULONG Base,
PULONG Value
);
+#if (defined(_M_IX86) && (_MSC_FULL_VER > 13009037)) || ((defined(_M_AMD64) || defined(_M_IA64)) && (_MSC_FULL_VER > 13009175))
+unsigned short __cdecl _byteswap_ushort(unsigned short);
+unsigned long __cdecl _byteswap_ulong (unsigned long);
+unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64);
+#pragma intrinsic(_byteswap_ushort)
+#pragma intrinsic(_byteswap_ulong)
+#pragma intrinsic(_byteswap_uint64)
+#define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x))
+#define RtlUlongByteSwap(_x) _byteswap_ulong((_x))
+#define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
+#else
+
USHORT
FASTCALL
RtlUshortByteSwap(IN USHORT Source);
+ULONG
+FASTCALL
+RtlUlongByteSwap(IN ULONG Source);
+
+ULONGLONG
+FASTCALL
+RtlUlonglongByteSwap(IN ULONGLONG Source);
+
+#endif
+
/*
* Unicode->Ansi String Functions
*/
+/* FIXME: Use macro */
+#undef RtlUnicodeStringToAnsiSize
+NTSYSAPI
ULONG
-STDCALL
+NTAPI
RtlUnicodeStringToAnsiSize(IN PUNICODE_STRING UnicodeString);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlUnicodeStringToAnsiString(
PANSI_STRING DestinationString,
- PUNICODE_STRING SourceString,
+ PCUNICODE_STRING SourceString,
BOOLEAN AllocateDestinationString
);
/*
* Unicode->OEM String Functions
*/
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlUpcaseUnicodeStringToOemString(
POEM_STRING DestinationString,
- PUNICODE_STRING SourceString,
+ PCUNICODE_STRING SourceString,
BOOLEAN AllocateDestinationString
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlUpcaseUnicodeStringToCountedOemString(
IN OUT POEM_STRING DestinationString,
- IN PUNICODE_STRING SourceString,
+ IN PCUNICODE_STRING SourceString,
IN BOOLEAN AllocateDestinationString
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlUnicodeStringToOemString(
POEM_STRING DestinationString,
- PUNICODE_STRING SourceString,
+ PCUNICODE_STRING SourceString,
BOOLEAN AllocateDestinationString
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlUpcaseUnicodeToOemN(
PCHAR OemString,
ULONG OemSize,
@@ -726,12 +821,16 @@
ULONG UnicodeSize
);
+/* FIXME: Use macro */
+#undef RtlUnicodeStringToOemSize
+NTSYSAPI
ULONG
-STDCALL
+NTAPI
RtlUnicodeStringToOemSize(IN PUNICODE_STRING UnicodeString);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlUnicodeToOemN(
PCHAR OemString,
ULONG OemSize,
@@ -743,8 +842,9 @@
/*
* Unicode->MultiByte String Functions
*/
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlUnicodeToMultiByteN(
PCHAR MbString,
ULONG MbSize,
@@ -753,8 +853,9 @@
ULONG UnicodeSize
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlUpcaseUnicodeToMultiByteN(
PCHAR MbString,
ULONG MbSize,
@@ -763,8 +864,9 @@
ULONG UnicodeSize
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlUnicodeToMultiByteSize(
PULONG MbSize,
PWCHAR UnicodeString,
@@ -774,20 +876,25 @@
/*
* OEM to Unicode Functions
*/
+/* FIXME: Use macro */
+#undef RtlOemStringToUnicodeSize
+NTSYSAPI
ULONG
-STDCALL
+NTAPI
RtlOemStringToUnicodeSize(POEM_STRING AnsiString);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlOemStringToUnicodeString(
PUNICODE_STRING DestinationString,
- POEM_STRING SourceString,
+ PCOEM_STRING SourceString,
BOOLEAN AllocateDestinationString
);
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlOemToUnicodeN(
PWSTR UnicodeString,
ULONG MaxBytesInUnicodeString,
@@ -800,21 +907,25 @@
* Ansi->Unicode String Functions
*/
NTSTATUS
-STDCALL
+NTAPI
RtlAnsiStringToUnicodeString(
PUNICODE_STRING DestinationString,
- PANSI_STRING SourceString,
+ PCANSI_STRING SourceString,
BOOLEAN AllocateDestinationString
);
+/* FIXME: Use macro */
+#undef RtlAnsiStringToUnicodeSize
+NTSYSAPI
ULONG
-STDCALL
+NTAPI
RtlAnsiStringToUnicodeSize(
PANSI_STRING AnsiString
);
+NTSYSAPI
BOOLEAN
-STDCALL
+NTAPI
RtlCreateUnicodeStringFromAsciiz(
OUT PUNICODE_STRING Destination,
IN PCSZ Source
@@ -823,72 +934,82 @@
/*
* Unicode String Functions
*/
+NTSYSAPI
NTSTATUS
-STDCALL
+NTAPI
RtlAppendUnicodeToString(
PUNICODE_STRING Destination,
PCWSTR Source
);
+NTSYSAPI
NTSTATUS
[truncated at 1000 lines; 1887 more skipped]