applied some NT header fixes from 3.x

git-svn-id: svn://svn.code.sf.net/p/processhacker/code@4871 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
wj32
2011-11-18 09:58:09 +00:00
parent eb257fb4e7
commit 968a05bfe4
2 changed files with 16 additions and 12 deletions
+5
View File
@@ -113,6 +113,8 @@ typedef struct _UNICODE_STRING
typedef const UNICODE_STRING *PCUNICODE_STRING;
#define RTL_CONSTANT_STRING(s) { sizeof(s) - sizeof((s)[0]), sizeof(s), s }
// Portability
typedef struct _SINGLE_LIST_ENTRY32
@@ -173,6 +175,9 @@ typedef const OBJECT_ATTRIBUTES *PCOBJECT_ATTRIBUTES;
(p)->SecurityQualityOfService = NULL; \
}
#define RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a) { sizeof(OBJECT_ATTRIBUTES), NULL, n, a, NULL, NULL }
#define RTL_INIT_OBJECT_ATTRIBUTES(n, a) RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a)
// Portability
typedef struct _OBJECT_ATTRIBUTES64
+11 -12
View File
@@ -1195,7 +1195,7 @@ FORCEINLINE VOID RtlInitString(
)
{
if (SourceString)
DestinationString->MaximumLength = DestinationString->Length = (USHORT)strlen(SourceString);
DestinationString->MaximumLength = (DestinationString->Length = (USHORT)strlen(SourceString)) + 1;
else
DestinationString->MaximumLength = DestinationString->Length = 0;
@@ -1218,7 +1218,7 @@ FORCEINLINE VOID RtlInitAnsiString(
)
{
if (SourceString)
DestinationString->MaximumLength = DestinationString->Length = (USHORT)strlen(SourceString);
DestinationString->MaximumLength = (DestinationString->Length = (USHORT)strlen(SourceString)) + 1;
else
DestinationString->MaximumLength = DestinationString->Length = 0;
@@ -1328,9 +1328,8 @@ FORCEINLINE VOID RtlInitUnicodeString(
__in_opt PWSTR SourceString
)
{
// MaximumLength should really be Length + sizeof(WCHAR), but it doesn't matter too much.
if (SourceString)
DestinationString->MaximumLength = DestinationString->Length = (USHORT)(wcslen(SourceString) * sizeof(WCHAR));
DestinationString->MaximumLength = (DestinationString->Length = (USHORT)(wcslen(SourceString) * sizeof(WCHAR))) + sizeof(WCHAR);
else
DestinationString->MaximumLength = DestinationString->Length = 0;
@@ -2579,9 +2578,9 @@ NTAPI
RtlSetEnvironmentVar(
__in_opt PWSTR *Environment,
__in_ecount(NameLength) PWSTR Name,
__in ULONG NameLength,
__in SIZE_T NameLength,
__in_ecount(ValueLength) PWSTR Value,
__in ULONG ValueLength
__in SIZE_T ValueLength
);
#endif
@@ -2602,10 +2601,10 @@ NTAPI
RtlQueryEnvironmentVariable(
__in_opt PVOID Environment,
__in_ecount(NameLength) PWSTR Name,
__in ULONG NameLength,
__in SIZE_T NameLength,
__out_ecount(ValueLength) PWSTR Value,
__in ULONG ValueLength,
__out PULONG ReturnLength
__in SIZE_T ValueLength,
__out PSIZE_T ReturnLength
);
#endif
@@ -2626,10 +2625,10 @@ NTAPI
RtlExpandEnvironmentStrings(
__in_opt PVOID Environment,
__in_ecount(SrcLength) PWSTR Src,
__in ULONG SrcLength,
__in SIZE_T SrcLength,
__out_ecount(DstLength) PWSTR Dst,
__in ULONG DstLength,
__out_opt PULONG ReturnLength
__in SIZE_T DstLength,
__out_opt PSIZE_T ReturnLength
);
#endif