ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 2011
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
20 participants
399 discussions
Start a n
N
ew thread
[ekohl] 53740: [NDK] Add the missing RtlpNt-Registry functions and move RtlpNtOpenKey into the NTOS_MODE_USER section.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Sep 18 23:59:06 2011 New Revision: 53740 URL:
http://svn.reactos.org/svn/reactos?rev=53740&view=rev
Log: [NDK] Add the missing RtlpNt-Registry functions and move RtlpNtOpenKey into the NTOS_MODE_USER section. Modified: trunk/reactos/include/ndk/rtlfuncs.h Modified: trunk/reactos/include/ndk/rtlfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev…
============================================================================== --- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Sun Sep 18 23:59:06 2011 @@ -3349,16 +3349,6 @@ NTSYSAPI NTSTATUS NTAPI -RtlpNtOpenKey( - OUT HANDLE KeyHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes, - IN ULONG Unused -); - -NTSYSAPI -NTSTATUS -NTAPI RtlOpenCurrentUser( IN ACCESS_MASK DesiredAccess, OUT PHANDLE KeyHandle @@ -3386,6 +3376,68 @@ PVOID ValueData, ULONG ValueLength ); + +#ifdef NTOS_MODE_USER +NTSYSAPI +NTSTATUS +NTAPI +RtlpNtCreateKey( + OUT HANDLE KeyHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN ULONG TitleIndex, + IN PUNICODE_STRING Class, + OUT PULONG Disposition +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlpNtEnumerateSubKey( + IN HANDLE KeyHandle, + OUT PUNICODE_STRING SubKeyName, + IN ULONG Index, + IN ULONG Unused +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlpNtMakeTemporaryKey( + IN HANDLE KeyHandle +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlpNtOpenKey( + OUT HANDLE KeyHandle, + IN ACCESS_MASK DesiredAccess, + IN POBJECT_ATTRIBUTES ObjectAttributes, + IN ULONG Unused +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlpNtQueryValueKey( + IN HANDLE KeyHandle, + OUT PULONG Type OPTIONAL, + OUT PVOID Data OPTIONAL, + IN OUT PULONG DataLength OPTIONAL, + IN ULONG Unused +); + +NTSYSAPI +NTSTATUS +NTAPI +RtlpNtSetValueKey( + IN HANDLE KeyHandle, + IN ULONG Type, + IN PVOID Data, + IN ULONG DataLength +); +#endif // // NLS Functions
13 years, 3 months
1
0
0
0
[tkreuzer] 53739: [RTL] Improve formatting, no code change
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Sep 18 22:15:37 2011 New Revision: 53739 URL:
http://svn.reactos.org/svn/reactos?rev=53739&view=rev
Log: [RTL] Improve formatting, no code change Modified: trunk/reactos/lib/rtl/unicode.c Modified: trunk/reactos/lib/rtl/unicode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/unicode.c?rev=5373…
============================================================================== --- trunk/reactos/lib/rtl/unicode.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/unicode.c [iso-8859-1] Sun Sep 18 22:15:37 2011 @@ -22,9 +22,9 @@ extern BOOLEAN NlsMbCodePageTag; extern BOOLEAN NlsMbOemCodePageTag; extern PUSHORT NlsLeadByteInfo; - extern USHORT NlsOemDefaultChar; extern USHORT NlsUnicodeDefaultChar; + /* FUNCTIONS *****************************************************************/ @@ -38,7 +38,6 @@ ULONG Size; NTSTATUS Status; WCHAR UnicodeChar = L' '; - PAGED_CODE_RTL(); if (NlsLeadByteInfo) @@ -76,9 +75,9 @@ NTSTATUS NTAPI RtlAnsiStringToUnicodeString( - IN OUT PUNICODE_STRING UniDest, - IN PANSI_STRING AnsiSource, - IN BOOLEAN AllocateDestinationString) + IN OUT PUNICODE_STRING UniDest, + IN PANSI_STRING AnsiSource, + IN BOOLEAN AllocateDestinationString) { NTSTATUS Status; ULONG Length; @@ -124,6 +123,7 @@ RtlpFreeStringMemory(UniDest->Buffer, TAG_USTR); UniDest->Buffer = NULL; } + return Status; } @@ -142,7 +142,6 @@ RtlxAnsiStringToUnicodeSize(IN PCANSI_STRING AnsiString) { ULONG Size; - PAGED_CODE_RTL(); /* Convert from Mb String to Unicode Size */ @@ -196,15 +195,15 @@ NTSTATUS NTAPI RtlAppendUnicodeStringToString( - IN OUT PUNICODE_STRING Destination, - IN PCUNICODE_STRING Source) + IN OUT PUNICODE_STRING Destination, + IN PCUNICODE_STRING Source) { USHORT SourceLength = Source->Length; PWCHAR Buffer = &Destination->Buffer[Destination->Length / sizeof(WCHAR)]; if (SourceLength) { - if ((SourceLength+ Destination->Length) > Destination->MaximumLength) + if ((SourceLength + Destination->Length) > Destination->MaximumLength) { return STATUS_BUFFER_TOO_SMALL; } @@ -255,58 +254,81 @@ ULONG RunningTotal = 0; char bMinus = 0; - while (*str != '\0' && *str <= ' ') { - str++; - } /* while */ - - if (*str == '+') { - str++; - } else if (*str == '-') { - bMinus = 1; - str++; - } /* if */ - - if (base == 0) { - base = 10; - if (str[0] == '0') { - if (str[1] == 'b') { - str += 2; - base = 2; - } else if (str[1] == 'o') { - str += 2; - base = 8; - } else if (str[1] == 'x') { - str += 2; - base = 16; - } /* if */ - } /* if */ - } else if (base != 2 && base != 8 && base != 10 && base != 16) { - return STATUS_INVALID_PARAMETER; - } /* if */ - - if (value == NULL) { - return STATUS_ACCESS_VIOLATION; - } /* if */ - - while (*str != '\0') { - chCurrent = *str; - if (chCurrent >= '0' && chCurrent <= '9') { - digit = chCurrent - '0'; - } else if (chCurrent >= 'A' && chCurrent <= 'Z') { - digit = chCurrent - 'A' + 10; - } else if (chCurrent >= 'a' && chCurrent <= 'z') { - digit = chCurrent - 'a' + 10; - } else { - digit = -1; - } /* if */ - if (digit < 0 || digit >= (int)base) { - *value = bMinus ? -RunningTotal : RunningTotal; - return STATUS_SUCCESS; - } /* if */ - - RunningTotal = RunningTotal * base + digit; - str++; - } /* while */ + /* skip leading whitespaces */ + while (*str != '\0' && *str <= ' ') str++; + + /* Check for +/- */ + if (*str == '+') + { + str++; + } + else if (*str == '-') + { + bMinus = 1; + str++; + } + + /* base = 0 means autobase */ + if (base == 0) + { + base = 10; + + if (str[0] == '0') + { + if (str[1] == 'b') + { + str += 2; + base = 2; + } + else if (str[1] == 'o') + { + str += 2; + base = 8; + } + else if (str[1] == 'x') + { + str += 2; + base = 16; + } + } + } + else if (base != 2 && base != 8 && base != 10 && base != 16) + { + return STATUS_INVALID_PARAMETER; + } + + if (value == NULL) return STATUS_ACCESS_VIOLATION; + + while (*str != '\0') + { + chCurrent = *str; + + if (chCurrent >= '0' && chCurrent <= '9') + { + digit = chCurrent - '0'; + } + else if (chCurrent >= 'A' && chCurrent <= 'Z') + { + digit = chCurrent - 'A' + 10; + } + else if (chCurrent >= 'a' && chCurrent <= 'z') + { + digit = chCurrent - 'a' + 10; + } + else + { + digit = -1; + } + + if (digit < 0 || digit >= (int)base) + { + *value = bMinus ? -RunningTotal : RunningTotal; + return STATUS_SUCCESS; + } + + RunningTotal = RunningTotal * base + digit; + str++; + } *value = bMinus ? -RunningTotal : RunningTotal; return STATUS_SUCCESS; @@ -318,28 +340,31 @@ LONG NTAPI RtlCompareString( - IN PSTRING s1, - IN PSTRING s2, - IN BOOLEAN CaseInsensitive) -{ - unsigned int len; - LONG ret = 0; - LPCSTR p1, p2; - - len = min(s1->Length, s2->Length); - p1 = s1->Buffer; - p2 = s2->Buffer; - - if (CaseInsensitive) - { - while (!ret && len--) ret = RtlUpperChar(*p1++) - RtlUpperChar(*p2++); - } - else - { - while (!ret && len--) ret = *p1++ - *p2++; - } - if (!ret) ret = s1->Length - s2->Length; - return ret; + IN PSTRING s1, + IN PSTRING s2, + IN BOOLEAN CaseInsensitive) +{ + unsigned int len; + LONG ret = 0; + LPCSTR p1, p2; + + len = min(s1->Length, s2->Length); + p1 = s1->Buffer; + p2 = s2->Buffer; + + if (CaseInsensitive) + { + while (!ret && len--) + ret = RtlUpperChar(*p1++) - RtlUpperChar(*p2++); + } + else + { + while (!ret && len--) ret = *p1++ - *p2++; + } + + if (!ret) ret = s1->Length - s2->Length; + + return ret; } /* @@ -351,9 +376,9 @@ BOOLEAN NTAPI RtlEqualString( - IN PSTRING s1, - IN PSTRING s2, - IN BOOLEAN CaseInsensitive) + IN PSTRING s1, + IN PSTRING s2, + IN BOOLEAN CaseInsensitive) { if (s1->Length != s2->Length) return FALSE; return !RtlCompareString(s1, s2, CaseInsensitive); @@ -368,9 +393,9 @@ BOOLEAN NTAPI RtlEqualUnicodeString( - IN CONST UNICODE_STRING *s1, - IN CONST UNICODE_STRING *s2, - IN BOOLEAN CaseInsensitive) + IN CONST UNICODE_STRING *s1, + IN CONST UNICODE_STRING *s2, + IN BOOLEAN CaseInsensitive) { if (s1->Length != s2->Length) return FALSE; return !RtlCompareUnicodeString(s1, s2, CaseInsensitive ); @@ -399,9 +424,9 @@ NTAPI RtlFreeOemString(IN POEM_STRING OemString) { - PAGED_CODE_RTL(); - - if (OemString->Buffer) RtlpFreeStringMemory(OemString->Buffer, TAG_OSTR); + PAGED_CODE_RTL(); + + if (OemString->Buffer) RtlpFreeStringMemory(OemString->Buffer, TAG_OSTR); } /* @@ -543,8 +568,8 @@ VOID NTAPI RtlInitString( - IN OUT PSTRING DestinationString, - IN PCSZ SourceString) + IN OUT PSTRING DestinationString, + IN PCSZ SourceString) { RtlInitAnsiString(DestinationString, SourceString); } @@ -623,36 +648,54 @@ CHAR digit; ULONG len; - if (base == 0) { - base = 10; - } else if (base != 2 && base != 8 && base != 10 && base != 16) { - return STATUS_INVALID_PARAMETER; - } /* if */ + if (base == 0) + { + base = 10; + } + else if (base != 2 && base != 8 && base != 10 && base != 16) + { + return STATUS_INVALID_PARAMETER; + } pos = &buffer[32]; *pos = '\0'; - do { - pos--; - digit = value % base; - value = value / base; - if (digit < 10) { - *pos = '0' + digit; - } else { - *pos = 'A' + digit - 10; - } /* if */ - } while (value != 0L); + do + { + pos--; + digit = value % base; + value = value / base; + + if (digit < 10) + { + *pos = '0' + digit; + } + else + { + *pos = 'A' + digit - 10; + } + } + while (value != 0L); len = &buffer[32] - pos; - if (len > length) { - return STATUS_BUFFER_OVERFLOW; - } else if (str == NULL) { - return STATUS_ACCESS_VIOLATION; - } else if (len == length) { - memcpy(str, pos, len); - } else { - memcpy(str, pos, len + 1); - } /* if */ + + if (len > length) + { + return STATUS_BUFFER_OVERFLOW; + } + else if (str == NULL) + { + return STATUS_ACCESS_VIOLATION; + } + else if (len == length) + { + memcpy(str, pos, len); + } + else + { + memcpy(str, pos, len + 1); + } + return STATUS_SUCCESS; } @@ -665,49 +708,50 @@ IN ULONG Value, IN ULONG Base OPTIONAL, IN ULONG Length OPTIONAL, - IN OUT LPWSTR String - ) -{ - ULONG Radix; - WCHAR temp[33]; - ULONG v = Value; - ULONG i; - PWCHAR tp; - PWCHAR sp; - - Radix = Base; - if (Radix == 0) - Radix = 10; - - if ((Radix != 2) && (Radix != 8) && - (Radix != 10) && (Radix != 16)) - { - return STATUS_INVALID_PARAMETER; - } - - tp = temp; - while (v || tp == temp) - { - i = v % Radix; - v = v / Radix; - if (i < 10) - *tp = i + L'0'; - else - *tp = i + L'a' - 10; - tp++; - } - - if ((ULONG)((ULONG_PTR)tp - (ULONG_PTR)temp) >= Length) - { - return STATUS_BUFFER_TOO_SMALL; - } - - sp = String; - while (tp > temp) - *sp++ = *--tp; - *sp = 0; - - return STATUS_SUCCESS; + IN OUT LPWSTR String) +{ + ULONG Radix; + WCHAR temp[33]; + ULONG v = Value; + ULONG i; + PWCHAR tp; + PWCHAR sp; + + Radix = Base; + + if (Radix == 0) Radix = 10; + + if ((Radix != 2) && (Radix != 8) && + (Radix != 10) && (Radix != 16)) + { + return STATUS_INVALID_PARAMETER; + } + + tp = temp; + + while (v || tp == temp) + { + i = v % Radix; + v = v / Radix; + + if (i < 10) *tp = i + L'0'; + else *tp = i + L'a' - 10; + + tp++; + } + + if ((ULONG)((ULONG_PTR)tp - (ULONG_PTR)temp) >= Length) + { + return STATUS_BUFFER_TOO_SMALL; + } + + sp = String; + + while (tp > temp) *sp++ = *--tp; + + *sp = 0; + + return STATUS_SUCCESS; } /* @@ -716,9 +760,9 @@ NTSTATUS NTAPI RtlIntegerToUnicodeString( - IN ULONG Value, - IN ULONG Base OPTIONAL, - IN OUT PUNICODE_STRING String) + IN ULONG Value, + IN ULONG Base OPTIONAL, + IN OUT PUNICODE_STRING String) { ANSI_STRING AnsiString; CHAR Buffer[33]; @@ -776,42 +820,43 @@ BOOLEAN NTAPI RtlPrefixString( - PANSI_STRING String1, - PANSI_STRING String2, - BOOLEAN CaseInsensitive) -{ - PCHAR pc1; - PCHAR pc2; - ULONG Length; - - if (String2->Length < String1->Length) - return FALSE; - - Length = String1->Length; - pc1 = String1->Buffer; - pc2 = String2->Buffer; - - if (pc1 && pc2) - { - if (CaseInsensitive) - { - while (Length--) - { - if (RtlUpperChar (*pc1++) != RtlUpperChar (*pc2++)) - return FALSE; - } - } - else - { - while (Length--) - { - if (*pc1++ != *pc2++) - return FALSE; - } - } - return TRUE; - } - return FALSE; + PANSI_STRING String1, + PANSI_STRING String2, + BOOLEAN CaseInsensitive) +{ + PCHAR pc1; + PCHAR pc2; + ULONG Length; + + if (String2->Length < String1->Length) return FALSE; + + Length = String1->Length; + pc1 = String1->Buffer; + pc2 = String2->Buffer; + + if (pc1 && pc2) + { + if (CaseInsensitive) + { + while (Length--) + { + if (RtlUpperChar (*pc1++) != RtlUpperChar (*pc2++)) + return FALSE; + } + } + else + { + while (Length--) + { + if (*pc1++ != *pc2++) + return FALSE; + } + } + + return TRUE; + } + + return FALSE; } /* @@ -823,50 +868,53 @@ BOOLEAN NTAPI RtlPrefixUnicodeString( - PCUNICODE_STRING String1, - PCUNICODE_STRING String2, - BOOLEAN CaseInsensitive) -{ - PWCHAR pc1; - PWCHAR pc2; - ULONG Length; - - if (String2->Length < String1->Length) - return FALSE; - - Length = String1->Length / 2; - pc1 = String1->Buffer; - pc2 = String2->Buffer; - - if (pc1 && pc2) - { - if (CaseInsensitive) - { - while (Length--) - { - if (RtlUpcaseUnicodeChar (*pc1++) - != RtlUpcaseUnicodeChar (*pc2++)) - return FALSE; - } - } - else - { - while (Length--) - { - if( *pc1++ != *pc2++ ) - return FALSE; - } - } - return TRUE; - } - return FALSE; -} -/* - * @implemented - */ -NTSTATUS -NTAPI -RtlUnicodeStringToInteger(const UNICODE_STRING *str, /* [I] Unicode string to be converted */ + PCUNICODE_STRING String1, + PCUNICODE_STRING String2, + BOOLEAN CaseInsensitive) +{ + PWCHAR pc1; + PWCHAR pc2; + ULONG Length; + + if (String2->Length < String1->Length) + return FALSE; + + Length = String1->Length / 2; + pc1 = String1->Buffer; + pc2 = String2->Buffer; + + if (pc1 && pc2) + { + if (CaseInsensitive) + { + while (Length--) + { + if (RtlUpcaseUnicodeChar(*pc1++) != + RtlUpcaseUnicodeChar(*pc2++)) + return FALSE; + } + } + else + { + while (Length--) + { + if( *pc1++ != *pc2++ ) + return FALSE; + } + } + + return TRUE; + } + + return FALSE; +} +/* + * @implemented + */ +NTSTATUS +NTAPI +RtlUnicodeStringToInteger( + const UNICODE_STRING *str, /* [I] Unicode string to be converted */ ULONG base, /* [I] Number base for conversion (allowed 0, 2, 8, 10 or 16) */ ULONG *value) /* [O] Destination for the converted value */ { @@ -877,67 +925,94 @@ ULONG RunningTotal = 0; char bMinus = 0; - while (CharsRemaining >= 1 && *lpwstr <= ' ') { - lpwstr++; - CharsRemaining--; - } /* while */ - - if (CharsRemaining >= 1) { - if (*lpwstr == '+') { + while (CharsRemaining >= 1 && *lpwstr <= ' ') + { lpwstr++; CharsRemaining--; - } else if (*lpwstr == '-') { - bMinus = 1; + } + + if (CharsRemaining >= 1) + { + if (*lpwstr == '+') + { + lpwstr++; + CharsRemaining--; + } + else if (*lpwstr == '-') + { + bMinus = 1; + lpwstr++; + CharsRemaining--; + } + } + + if (base == 0) + { + base = 10; + + if (CharsRemaining >= 2 && lpwstr[0] == '0') + { + if (lpwstr[1] == 'b') + { + lpwstr += 2; + CharsRemaining -= 2; + base = 2; + } + else if (lpwstr[1] == 'o') + { + lpwstr += 2; + CharsRemaining -= 2; + base = 8; + } + else if (lpwstr[1] == 'x') + { + lpwstr += 2; + CharsRemaining -= 2; + base = 16; + } + } + } + else if (base != 2 && base != 8 && base != 10 && base != 16) + { + return STATUS_INVALID_PARAMETER; + } + + if (value == NULL) + { + return STATUS_ACCESS_VIOLATION; + } + + while (CharsRemaining >= 1) + { + wchCurrent = *lpwstr; + + if (wchCurrent >= '0' && wchCurrent <= '9') + { + digit = wchCurrent - '0'; + } + else if (wchCurrent >= 'A' && wchCurrent <= 'Z') + { + digit = wchCurrent - 'A' + 10; + } + else if (wchCurrent >= 'a' && wchCurrent <= 'z') + { + digit = wchCurrent - 'a' + 10; + } + else + { + digit = -1; + } + + if (digit < 0 || digit >= base) + { + *value = bMinus ? -RunningTotal : RunningTotal; + return STATUS_SUCCESS; + } + + RunningTotal = RunningTotal * base + digit; lpwstr++; CharsRemaining--; - } /* if */ - } /* if */ - - if (base == 0) { - base = 10; - if (CharsRemaining >= 2 && lpwstr[0] == '0') { - if (lpwstr[1] == 'b') { - lpwstr += 2; - CharsRemaining -= 2; - base = 2; - } else if (lpwstr[1] == 'o') { - lpwstr += 2; - CharsRemaining -= 2; - base = 8; - } else if (lpwstr[1] == 'x') { - lpwstr += 2; - CharsRemaining -= 2; - base = 16; - } /* if */ - } /* if */ - } else if (base != 2 && base != 8 && base != 10 && base != 16) { - return STATUS_INVALID_PARAMETER; - } /* if */ - - if (value == NULL) { - return STATUS_ACCESS_VIOLATION; - } /* if */ - - while (CharsRemaining >= 1) { - wchCurrent = *lpwstr; - if (wchCurrent >= '0' && wchCurrent <= '9') { - digit = wchCurrent - '0'; - } else if (wchCurrent >= 'A' && wchCurrent <= 'Z') { - digit = wchCurrent - 'A' + 10; - } else if (wchCurrent >= 'a' && wchCurrent <= 'z') { - digit = wchCurrent - 'a' + 10; - } else { - digit = -1; - } /* if */ - if (digit < 0 || digit >= base) { - *value = bMinus ? -RunningTotal : RunningTotal; - return STATUS_SUCCESS; - } /* if */ - - RunningTotal = RunningTotal * base + digit; - lpwstr++; - CharsRemaining--; - } /* while */ + } *value = bMinus ? -RunningTotal : RunningTotal; return STATUS_SUCCESS; @@ -974,9 +1049,9 @@ NTSTATUS NTAPI RtlUnicodeStringToAnsiString( - IN OUT PANSI_STRING AnsiDest, - IN PCUNICODE_STRING UniSource, - IN BOOLEAN AllocateDestinationString) + IN OUT PANSI_STRING AnsiDest, + IN PCUNICODE_STRING UniSource, + IN BOOLEAN AllocateDestinationString) { NTSTATUS Status = STATUS_SUCCESS; NTSTATUS RealStatus; @@ -995,6 +1070,7 @@ { Length = RtlxUnicodeStringToAnsiSize(UniSource); } + if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2; AnsiDest->Length = (USHORT)Length - sizeof(CHAR); @@ -1003,6 +1079,7 @@ { AnsiDest->Buffer = RtlpAllocateStringMemory(Length, TAG_ASTR); AnsiDest->MaximumLength = Length; + if (!AnsiDest->Buffer) return STATUS_NO_MEMORY; } else if (AnsiDest->Length >= AnsiDest->MaximumLength) @@ -1039,9 +1116,9 @@ NTSTATUS NTAPI RtlOemStringToUnicodeString( - IN OUT PUNICODE_STRING UniDest, - IN PCOEM_STRING OemSource, - IN BOOLEAN AllocateDestinationString) + IN OUT PUNICODE_STRING UniDest, + IN PCOEM_STRING OemSource, + IN BOOLEAN AllocateDestinationString) { NTSTATUS Status; ULONG Length; @@ -1050,6 +1127,7 @@ PAGED_CODE_RTL(); Length = RtlOemStringToUnicodeSize(OemSource); + if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2; UniDest->Length = (USHORT)Length - sizeof(WCHAR); @@ -1058,6 +1136,7 @@ { UniDest->Buffer = RtlpAllocateStringMemory(Length, TAG_USTR); UniDest->MaximumLength = Length; + if (!UniDest->Buffer) return STATUS_NO_MEMORY; } else if (UniDest->Length >= UniDest->MaximumLength) @@ -1091,9 +1170,9 @@ NTSTATUS NTAPI RtlUnicodeStringToOemString( - IN OUT POEM_STRING OemDest, - IN PCUNICODE_STRING UniSource, - IN BOOLEAN AllocateDestinationString) + IN OUT POEM_STRING OemDest, + IN PCUNICODE_STRING UniSource, + IN BOOLEAN AllocateDestinationString) { NTSTATUS Status; ULONG Length; @@ -1102,6 +1181,7 @@ PAGED_CODE_RTL(); Length = RtlUnicodeStringToOemSize(UniSource); + if (Length > MAXUSHORT) return STATUS_INVALID_PARAMETER_2; OemDest->Length = (USHORT)Length - sizeof(CHAR); @@ -1110,6 +1190,7 @@ { OemDest->Buffer = RtlpAllocateStringMemory(Length, TAG_OSTR); OemDest->MaximumLength = Length; + if (!OemDest->Buffer) return STATUS_NO_MEMORY; } else if (OemDest->Length >= OemDest->MaximumLength) @@ -1146,8 +1227,8 @@ NTAPI RtlIsTextUnicode( PVOID buf, INT len, INT *pf ) { - static const WCHAR std_control_chars[] = {'\r','\n','\t',' ',0x3000,0}; - static const WCHAR byterev_control_chars[] = {0x0d00,0x0a00,0x0900,0x2000,0}; + static const WCHAR std_control_chars[] = {'\r', '\n', '\t', ' ', 0x3000, 0}; + static const WCHAR byterev_control_chars[] = {0x0d00, 0x0a00, 0x0900, 0x2000, 0}; const WCHAR *s = buf; int i; unsigned int flags = MAXULONG, out_flags = 0; @@ -1156,10 +1237,13 @@ { /* FIXME: MSDN documents IS_TEXT_UNICODE_BUFFER_TOO_SMALL but there is no such thing... */ if (pf) *pf = 0; + return FALSE; } + if (pf) flags = *pf; + /* * Apply various tests to the text string. According to the * docs, each test "passed" sets the corresponding flag in @@ -1174,6 +1258,7 @@ len--; /* Windows seems to do something like that to avoid e.g. false IS_TEXT_UNICODE_NULL_BYTES */ len /= sizeof(WCHAR); + /* Windows only checks the first 256 characters */ if (len > 256) len = 256; @@ -1185,11 +1270,13 @@ if (flags & IS_TEXT_UNICODE_STATISTICS) { int stats = 0; + /* FIXME: checks only for ASCII characters in the unicode stream */ for (i = 0; i < len; i++) { if (s[i] <= 255) stats++; } + if (stats > len / 2) out_flags |= IS_TEXT_UNICODE_STATISTICS; } @@ -1236,12 +1323,16 @@ out_flags &= *pf; *pf = out_flags; } + /* check for flags that indicate it's definitely not valid Unicode */ if (out_flags & (IS_TEXT_UNICODE_REVERSE_MASK | IS_TEXT_UNICODE_NOT_UNICODE_MASK)) return FALSE; + /* now check for invalid ASCII, and assume Unicode if so */ if (out_flags & IS_TEXT_UNICODE_NOT_ASCII_MASK) return TRUE; + /* now check for Unicode flags */ if (out_flags & IS_TEXT_UNICODE_UNICODE_MASK) return TRUE; + /* no flags set */ return FALSE; } @@ -1257,9 +1348,9 @@ NTSTATUS NTAPI RtlOemStringToCountedUnicodeString( - IN OUT PUNICODE_STRING UniDest, - IN PCOEM_STRING OemSource, - IN BOOLEAN AllocateDestinationString) + IN OUT PUNICODE_STRING UniDest, + IN PCOEM_STRING OemSource, + IN BOOLEAN AllocateDestinationString) { NTSTATUS Status; ULONG Length; @@ -1288,6 +1379,7 @@ { UniDest->Buffer = RtlpAllocateStringMemory(Length, TAG_USTR); UniDest->MaximumLength = Length; + if (!UniDest->Buffer) return STATUS_NO_MEMORY; } else if (UniDest->Length > UniDest->MaximumLength) @@ -1325,8 +1417,8 @@ BOOLEAN NTAPI RtlEqualComputerName( - IN PUNICODE_STRING ComputerName1, - IN PUNICODE_STRING ComputerName2) + IN PUNICODE_STRING ComputerName1, + IN PUNICODE_STRING ComputerName2) { OEM_STRING OemString1; OEM_STRING OemString2; @@ -1343,6 +1435,7 @@ Result = RtlEqualString(&OemString1, &OemString2, FALSE); RtlFreeOemString(&OemString2); } + RtlFreeOemString(&OemString1); } @@ -1361,8 +1454,8 @@ BOOLEAN NTAPI RtlEqualDomainName ( - IN PUNICODE_STRING DomainName1, - IN PUNICODE_STRING DomainName2 + IN PUNICODE_STRING DomainName1, + IN PUNICODE_STRING DomainName2 ) { return RtlEqualComputerName(DomainName1, DomainName2); @@ -1389,112 +1482,115 @@ NTSTATUS NTAPI RtlGUIDFromString( - IN UNICODE_STRING *str, - OUT GUID* guid + IN UNICODE_STRING *str, + OUT GUID* guid ) { - int i = 0; - const WCHAR *lpszCLSID = str->Buffer; - BYTE* lpOut = (BYTE*)guid; - - //TRACE("(%s,%p)\n", debugstr_us(str), guid); - - /* Convert string: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} - * to memory: DWORD... WORD WORD BYTES............ - */ - while (i <= 37) - { - switch (i) - { - case 0: - if (*lpszCLSID != '{') - return STATUS_INVALID_PARAMETER; - break; - - case 9: - case 14: - case 19: - case 24: - if (*lpszCLSID != '-') - return STATUS_INVALID_PARAMETER; - break; - - case 37: - if (*lpszCLSID != '}') - return STATUS_INVALID_PARAMETER; - break; - - default: + int i = 0; + const WCHAR *lpszCLSID = str->Buffer; + BYTE* lpOut = (BYTE*)guid; + + //TRACE("(%s,%p)\n", debugstr_us(str), guid); + + /* Convert string: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX} + * to memory: DWORD... WORD WORD BYTES............ + */ + while (i <= 37) + { + switch (i) + { + case 0: + if (*lpszCLSID != '{') + return STATUS_INVALID_PARAMETER; + break; + + case 9: + case 14: + case 19: + case 24: + if (*lpszCLSID != '-') + return STATUS_INVALID_PARAMETER; + break; + + case 37: + if (*lpszCLSID != '}') + return STATUS_INVALID_PARAMETER; + + break; + + default: { - WCHAR ch = *lpszCLSID, ch2 = lpszCLSID[1]; - unsigned char byte; - - /* Read two hex digits as a byte value */ - if (ch >= '0' && ch <= '9') - ch = ch - '0'; - else if (ch >= 'a' && ch <= 'f') - ch = ch - 'a' + 10; - else if (ch >= 'A' && ch <= 'F') - ch = ch - 'A' + 10; - else - return STATUS_INVALID_PARAMETER; - - if (ch2 >= '0' && ch2 <= '9') - ch2 = ch2 - '0'; - else if (ch2 >= 'a' && ch2 <= 'f') - ch2 = ch2 - 'a' + 10; - else if (ch2 >= 'A' && ch2 <= 'F') - ch2 = ch2 - 'A' + 10; - else - return STATUS_INVALID_PARAMETER; - - byte = ch << 4 | ch2; - - switch (i) - { + WCHAR ch = *lpszCLSID, ch2 = lpszCLSID[1]; + unsigned char byte; + + /* Read two hex digits as a byte value */ + if (ch >= '0' && ch <= '9') + ch = ch - '0'; + else if (ch >= 'a' && ch <= 'f') + ch = ch - 'a' + 10; + else if (ch >= 'A' && ch <= 'F') + ch = ch - 'A' + 10; + else + return STATUS_INVALID_PARAMETER; + + if (ch2 >= '0' && ch2 <= '9') + ch2 = ch2 - '0'; + else if (ch2 >= 'a' && ch2 <= 'f') + ch2 = ch2 - 'a' + 10; + else if (ch2 >= 'A' && ch2 <= 'F') + ch2 = ch2 - 'A' + 10; + else + return STATUS_INVALID_PARAMETER; + + byte = ch << 4 | ch2; + + switch (i) + { #ifndef WORDS_BIGENDIAN - /* For Big Endian machines, we store the data such that the - * dword/word members can be read as DWORDS and WORDS correctly. */ - /* Dword */ - case 1: - lpOut[3] = byte; - break; - case 3: - lpOut[2] = byte; - break; - case 5: - lpOut[1] = byte; - break; - case 7: - lpOut[0] = byte; - lpOut += 4; - break; - /* Word */ - case 10: - case 15: - lpOut[1] = byte; - break; - case 12: - case 17: - lpOut[0] = byte; - lpOut += 2; - break; + /* For Big Endian machines, we store the data such that the + * dword/word members can be read as DWORDS and WORDS correctly. */ + /* Dword */ + case 1: + lpOut[3] = byte; + break; + case 3: + lpOut[2] = byte; + break; + case 5: + lpOut[1] = byte; + break; + case 7: + lpOut[0] = byte; + lpOut += 4; + break; + /* Word */ + case 10: + case 15: + lpOut[1] = byte; + break; + case 12: + case 17: + lpOut[0] = byte; + lpOut += 2; + break; #endif - /* Byte */ - default: - lpOut[0] = byte; - lpOut++; - break; - } - lpszCLSID++; /* Skip 2nd character of byte */ - i++; + /* Byte */ + default: + lpOut[0] = byte; + lpOut++; + break; + } + + lpszCLSID++; /* Skip 2nd character of byte */ + i++; } - } - lpszCLSID++; - i++; - } - - return STATUS_SUCCESS; + } + + lpszCLSID++; + i++; + } + + return STATUS_SUCCESS; } /* @@ -1503,7 +1599,7 @@ VOID NTAPI RtlEraseUnicodeString( - IN PUNICODE_STRING String) + IN PUNICODE_STRING String) { if (String->Buffer && String->MaximumLength) { @@ -1518,10 +1614,10 @@ NTSTATUS NTAPI RtlHashUnicodeString( - IN CONST UNICODE_STRING *String, - IN BOOLEAN CaseInSensitive, - IN ULONG HashAlgorithm, - OUT PULONG HashValue) + IN CONST UNICODE_STRING *String, + IN BOOLEAN CaseInSensitive, + IN ULONG HashAlgorithm, + OUT PULONG HashValue) { if (String != NULL && HashValue != NULL) { @@ -1537,9 +1633,7 @@ if (CaseInSensitive) { - for (c = String->Buffer; - c != end; - c++) + for (c = String->Buffer; c != end; c++) { /* only uppercase characters if they are 'a' ... 'z'! */ *HashValue = ((65599 * (*HashValue)) + @@ -1549,13 +1643,12 @@ } else { - for (c = String->Buffer; - c != end; - c++) + for (c = String->Buffer; c != end; c++) { *HashValue = ((65599 * (*HashValue)) + (ULONG)(*c)); } } + return STATUS_SUCCESS; } } @@ -1574,9 +1667,9 @@ NTSTATUS NTAPI RtlUnicodeStringToCountedOemString( - IN OUT POEM_STRING OemDest, - IN PUNICODE_STRING UniSource, - IN BOOLEAN AllocateDestinationString) + IN OUT POEM_STRING OemDest, + IN PUNICODE_STRING UniSource, + IN BOOLEAN AllocateDestinationString) { NTSTATUS Status; ULONG Length; @@ -1640,10 +1733,10 @@ NTSTATUS NTAPI RtlLargeIntegerToChar( - IN PLARGE_INTEGER Value, - IN ULONG Base, - IN ULONG Length, - IN OUT PCHAR String) + IN PLARGE_INTEGER Value, + IN ULONG Base, + IN ULONG Length, + IN OUT PCHAR String) { ULONGLONG Val = Value->QuadPart; NTSTATUS Status = STATUS_SUCCESS; @@ -1668,6 +1761,7 @@ Pos--; Digit = Val % Base; Val = Val / Base; + if (Digit < 10) *Pos = '0' + Digit; else @@ -1681,20 +1775,24 @@ return STATUS_BUFFER_OVERFLOW; #if 1 /* It needs to be removed, when will probably use SEH in rtl */ + if (String == NULL) { return STATUS_ACCESS_VIOLATION; } + #endif #if 0 _SEH2_TRY { #endif + if (Len == Length) RtlCopyMemory(String, Pos, Len); else RtlCopyMemory(String, Pos, Len + 1); + #if 0 } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) @@ -1718,9 +1816,9 @@ NTSTATUS NTAPI RtlUpcaseUnicodeString( - IN OUT PUNICODE_STRING UniDest, - IN PCUNICODE_STRING UniSource, - IN BOOLEAN AllocateDestinationString) + IN OUT PUNICODE_STRING UniDest, + IN PCUNICODE_STRING UniSource, + IN BOOLEAN AllocateDestinationString) { ULONG i, j; @@ -1758,14 +1856,13 @@ NTSTATUS NTAPI RtlUpcaseUnicodeStringToAnsiString( - IN OUT PANSI_STRING AnsiDest, - IN PUNICODE_STRING UniSource, - IN BOOLEAN AllocateDestinationString) + IN OUT PANSI_STRING AnsiDest, + IN PUNICODE_STRING UniSource, + IN BOOLEAN AllocateDestinationString) { NTSTATUS Status; ULONG Length; ULONG Index; - PAGED_CODE_RTL(); Length = RtlUnicodeStringToAnsiSize(UniSource); @@ -1811,14 +1908,13 @@ NTSTATUS NTAPI RtlUpcaseUnicodeStringToCountedOemString( - IN OUT POEM_STRING OemDest, - IN PCUNICODE_STRING UniSource, - IN BOOLEAN AllocateDestinationString) + IN OUT POEM_STRING OemDest, + IN PCUNICODE_STRING UniSource, + IN BOOLEAN AllocateDestinationString) { NTSTATUS Status; ULONG Length; ULONG Index; - PAGED_CODE_RTL(); Length = RtlUnicodeStringToCountedOemSize(UniSource); @@ -1872,14 +1968,13 @@ NTSTATUS NTAPI RtlUpcaseUnicodeStringToOemString ( - IN OUT POEM_STRING OemDest, - IN PCUNICODE_STRING UniSource, - IN BOOLEAN AllocateDestinationString) + IN OUT POEM_STRING OemDest, + IN PCUNICODE_STRING UniSource, + IN BOOLEAN AllocateDestinationString) { NTSTATUS Status; ULONG Length; ULONG Index; - PAGED_CODE_RTL(); Length = RtlUnicodeStringToOemSize(UniSource); @@ -1983,7 +2078,6 @@ RtlxUnicodeStringToAnsiSize(IN PCUNICODE_STRING UnicodeString) { ULONG Size; - PAGED_CODE_RTL(); ASSERT(!(UnicodeString->Length & 1)); @@ -2003,28 +2097,30 @@ LONG NTAPI RtlCompareUnicodeString( - IN PCUNICODE_STRING s1, - IN PCUNICODE_STRING s2, - IN BOOLEAN CaseInsensitive) -{ - unsigned int len; - LONG ret = 0; - LPCWSTR p1, p2; - - len = min(s1->Length, s2->Length) / sizeof(WCHAR); - p1 = s1->Buffer; - p2 = s2->Buffer; - - if (CaseInsensitive) - { - while (!ret && len--) ret = RtlUpcaseUnicodeChar(*p1++) - RtlUpcaseUnicodeChar(*p2++); - } - else - { - while (!ret && len--) ret = *p1++ - *p2++; - } - if (!ret) ret = s1->Length - s2->Length; - return ret; + IN PCUNICODE_STRING s1, + IN PCUNICODE_STRING s2, + IN BOOLEAN CaseInsensitive) +{ + unsigned int len; + LONG ret = 0; + LPCWSTR p1, p2; + + len = min(s1->Length, s2->Length) / sizeof(WCHAR); + p1 = s1->Buffer; + p2 = s2->Buffer; + + if (CaseInsensitive) + { + while (!ret && len--) ret = RtlUpcaseUnicodeChar(*p1++) - RtlUpcaseUnicodeChar(*p2++); + } + else + { + while (!ret && len--) ret = *p1++ - *p2++; + } + + if (!ret) ret = s1->Length - s2->Length; + + return ret; } /* @@ -2033,8 +2129,8 @@ VOID NTAPI RtlCopyString( - IN OUT PSTRING DestinationString, - IN PSTRING SourceString OPTIONAL) + IN OUT PSTRING DestinationString, + IN PSTRING SourceString OPTIONAL) { ULONG SourceLength; PCHAR p1, p2; @@ -2074,8 +2170,8 @@ VOID NTAPI RtlCopyUnicodeString( - IN OUT PUNICODE_STRING DestinationString, - IN PCUNICODE_STRING SourceString) + IN OUT PUNICODE_STRING DestinationString, + IN PCUNICODE_STRING SourceString) { ULONG SourceLength; @@ -2109,11 +2205,10 @@ BOOLEAN NTAPI RtlCreateUnicodeString( - IN OUT PUNICODE_STRING UniDest, - IN PCWSTR Source) + IN OUT PUNICODE_STRING UniDest, + IN PCWSTR Source) { ULONG Length; - PAGED_CODE_RTL(); Length = (wcslen(Source) + 1) * sizeof(WCHAR); @@ -2136,8 +2231,8 @@ BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz( - OUT PUNICODE_STRING Destination, - IN PCSZ Source) + OUT PUNICODE_STRING Destination, + IN PCSZ Source) { ANSI_STRING AnsiString; NTSTATUS Status; @@ -2162,13 +2257,12 @@ NTSTATUS NTAPI RtlDowncaseUnicodeString( - IN OUT PUNICODE_STRING UniDest, - IN PCUNICODE_STRING UniSource, - IN BOOLEAN AllocateDestinationString) + IN OUT PUNICODE_STRING UniDest, + IN PCUNICODE_STRING UniSource, + IN BOOLEAN AllocateDestinationString) { ULONG i; ULONG StopGap; - PAGED_CODE_RTL(); if (AllocateDestinationString) @@ -2185,7 +2279,7 @@ UniDest->Length = UniSource->Length; StopGap = UniSource->Length / sizeof(WCHAR); - for (i= 0 ; i < StopGap; i++) + for (i = 0 ; i < StopGap; i++) { if (UniSource->Buffer[i] < L'A') { @@ -2256,8 +2350,8 @@ NTSTATUS NTAPI RtlAppendAsciizToString( - IN OUT PSTRING Destination, - IN PCSZ Source) + IN OUT PSTRING Destination, + IN PCSZ Source) { ULONG Length; @@ -2294,6 +2388,7 @@ Src = SourceString->Buffer; Dest = DestinationString->Buffer; DestinationString->Length = Length; + while (Length) { *Dest++ = RtlUpperChar(*Src++); @@ -2310,82 +2405,86 @@ NTSTATUS NTAPI RtlDuplicateUnicodeString( - IN ULONG Flags, - IN PCUNICODE_STRING SourceString, - OUT PUNICODE_STRING DestinationString) -{ - PAGED_CODE_RTL(); + IN ULONG Flags, + IN PCUNICODE_STRING SourceString, + OUT PUNICODE_STRING DestinationString) +{ + PAGED_CODE_RTL(); if (SourceString == NULL || DestinationString == NULL || SourceString->Length > SourceString->MaximumLength || (SourceString->Length == 0 && SourceString->MaximumLength > 0 && SourceString->Buffer == NULL) || - Flags == RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING || Flags >= 4) { + Flags == RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING || Flags >= 4) + { return STATUS_INVALID_PARAMETER; } - if ((SourceString->Length == 0) && - (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | - RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING))) - { - DestinationString->Length = 0; - DestinationString->MaximumLength = 0; - DestinationString->Buffer = NULL; - } - else - { - UINT DestMaxLength = SourceString->Length; - - if (Flags & RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE) - DestMaxLength += sizeof(UNICODE_NULL); - - DestinationString->Buffer = RtlpAllocateStringMemory(DestMaxLength, TAG_USTR); - if (DestinationString->Buffer == NULL) - return STATUS_NO_MEMORY; - - RtlCopyMemory(DestinationString->Buffer, SourceString->Buffer, SourceString->Length); - DestinationString->Length = SourceString->Length; - DestinationString->MaximumLength = DestMaxLength; - - if (Flags & RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE) - DestinationString->Buffer[DestinationString->Length / sizeof(WCHAR)] = 0; - } - - return STATUS_SUCCESS; -} - -/* - * @implemented - */ -NTSTATUS NTAPI + if ((SourceString->Length == 0) && + (Flags != (RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE | + RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING))) + { + DestinationString->Length = 0; + DestinationString->MaximumLength = 0; + DestinationString->Buffer = NULL; + } + else + { + UINT DestMaxLength = SourceString->Length; + + if (Flags & RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE) + DestMaxLength += sizeof(UNICODE_NULL); + + DestinationString->Buffer = RtlpAllocateStringMemory(DestMaxLength, TAG_USTR); + + if (DestinationString->Buffer == NULL) + return STATUS_NO_MEMORY; + + RtlCopyMemory(DestinationString->Buffer, SourceString->Buffer, SourceString->Length); + DestinationString->Length = SourceString->Length; + DestinationString->MaximumLength = DestMaxLength; + + if (Flags & RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE) + DestinationString->Buffer[DestinationString->Length / sizeof(WCHAR)] = 0; + } + + return STATUS_SUCCESS; +} + +/* + * @implemented + */ +NTSTATUS +NTAPI RtlValidateUnicodeString(IN ULONG Flags, IN PCUNICODE_STRING UnicodeString) { - /* currently no flags are supported! */ - ASSERT(Flags == 0); - - if ((Flags == 0) && - ((UnicodeString == NULL) || - ((UnicodeString->Length != 0) && - (UnicodeString->Buffer != NULL) && - ((UnicodeString->Length % sizeof(WCHAR)) == 0) && - ((UnicodeString->MaximumLength % sizeof(WCHAR)) == 0) && - (UnicodeString->MaximumLength >= UnicodeString->Length)))) - { - /* a NULL pointer as a unicode string is considered to be a valid unicode - string! */ - return STATUS_SUCCESS; - } - else - { - return STATUS_INVALID_PARAMETER; - } + /* currently no flags are supported! */ + ASSERT(Flags == 0); + + if ((Flags == 0) && + ((UnicodeString == NULL) || + ((UnicodeString->Length != 0) && + (UnicodeString->Buffer != NULL) && + ((UnicodeString->Length % sizeof(WCHAR)) == 0) && + ((UnicodeString->MaximumLength % sizeof(WCHAR)) == 0) && + (UnicodeString->MaximumLength >= UnicodeString->Length)))) + { + /* a NULL pointer as a unicode string is considered to be a valid unicode + string! */ + return STATUS_SUCCESS; + } + else + { + return STATUS_INVALID_PARAMETER; + } } /* * @unimplemented */ -NTSTATUS NTAPI +NTSTATUS +NTAPI RtlpEnsureBufferSize(ULONG Unknown1, ULONG Unknown2, ULONG Unknown3) { DPRINT1("RtlpEnsureBufferSize: stub\n"); @@ -2397,10 +2496,11 @@ */ NTSTATUS NTAPI -RtlFindCharInUnicodeString(IN ULONG Flags, - IN PUNICODE_STRING SearchString, - IN PCUNICODE_STRING MatchString, - OUT PUSHORT Position) +RtlFindCharInUnicodeString( + IN ULONG Flags, + IN PUNICODE_STRING SearchString, + IN PCUNICODE_STRING MatchString, + OUT PUSHORT Position) { int main_idx; unsigned int search_idx; @@ -2420,6 +2520,7 @@ } } } + *Position = 0; return STATUS_NOT_FOUND; } @@ -2437,6 +2538,7 @@ } } } + *Position = 0; return STATUS_NOT_FOUND; } @@ -2446,17 +2548,20 @@ for (main_idx = 0; main_idx < SearchString->Length / sizeof(WCHAR); main_idx++) { search_idx = 0; + while (search_idx < MatchString->Length / sizeof(WCHAR) && SearchString->Buffer[main_idx] != MatchString->Buffer[search_idx]) { search_idx++; } + if (search_idx >= MatchString->Length / sizeof(WCHAR)) { *Position = (main_idx + 1) * sizeof(WCHAR); return STATUS_SUCCESS; } } + *Position = 0; return STATUS_NOT_FOUND; } @@ -2466,21 +2571,24 @@ for (main_idx = SearchString->Length / sizeof(WCHAR) - 1; main_idx >= 0; main_idx--) { search_idx = 0; + while (search_idx < MatchString->Length / sizeof(WCHAR) && SearchString->Buffer[main_idx] != MatchString->Buffer[search_idx]) { search_idx++; } + if (search_idx >= MatchString->Length / sizeof(WCHAR)) { *Position = main_idx * sizeof(WCHAR); return STATUS_SUCCESS; } } + *Position = 0; return STATUS_NOT_FOUND; } - } /* switch */ + } return STATUS_NOT_FOUND; } @@ -2495,63 +2603,65 @@ */ NTSTATUS NTAPI -RtlDnsHostNameToComputerName(PUNICODE_STRING ComputerName,PUNICODE_STRING DnsHostName,BOOLEAN AllocateComputerNameString) -{ - NTSTATUS Status; - ULONG Length; - ULONG ComputerNameLength; - ULONG ComputerNameOemNLength; - OEM_STRING ComputerNameOem; - CHAR ComputerNameOemN[MAX_COMPUTERNAME_LENGTH + 1]; - - Status = STATUS_INVALID_COMPUTER_NAME; - ComputerNameLength = DnsHostName->Length; - - /* find the first dot in the dns host name */ - for (Length = 0;Length < DnsHostName->Length/sizeof(WCHAR);Length++) - { - if (DnsHostName->Buffer[Length] == L'.') - { - /* dot found, so set the length for the oem translation */ - ComputerNameLength = Length*sizeof(WCHAR); - break; - } - } - - /* the computername must have one character */ - if (ComputerNameLength > 0) - { - ComputerNameOemNLength = 0; - /* convert to oem string and use uppercase letters */ - Status = RtlUpcaseUnicodeToOemN(ComputerNameOemN, - MAX_COMPUTERNAME_LENGTH, - &ComputerNameOemNLength, - DnsHostName->Buffer, - ComputerNameLength); - /* status STATUS_BUFFER_OVERFLOW is not a problem since the computername shoud only - have MAX_COMPUTERNAME_LENGTH characters */ - if ((Status == STATUS_SUCCESS) || - (Status == STATUS_BUFFER_OVERFLOW)) - { - /* set the termination for the oem string */ - ComputerNameOemN[MAX_COMPUTERNAME_LENGTH] = 0; - /* set status for the case the next function failed */ - Status = STATUS_INVALID_COMPUTER_NAME; - /* fillup the oem string structure with the converted computername - and check it for unmapped characters */ - ComputerNameOem.Buffer = ComputerNameOemN; - ComputerNameOem.Length = (USHORT)ComputerNameOemNLength; - ComputerNameOem.MaximumLength = (USHORT)(MAX_COMPUTERNAME_LENGTH + 1); - if (RtlpDidUnicodeToOemWork(DnsHostName, &ComputerNameOem) == TRUE) - { - /* no unmapped character so convert it back to an unicode string */ - Status = RtlOemStringToUnicodeString(ComputerName, - &ComputerNameOem, - AllocateComputerNameString); - } - } - } - - return Status; -} - +RtlDnsHostNameToComputerName(PUNICODE_STRING ComputerName, PUNICODE_STRING DnsHostName, BOOLEAN AllocateComputerNameString) +{ + NTSTATUS Status; + ULONG Length; + ULONG ComputerNameLength; + ULONG ComputerNameOemNLength; + OEM_STRING ComputerNameOem; + CHAR ComputerNameOemN[MAX_COMPUTERNAME_LENGTH + 1]; + + Status = STATUS_INVALID_COMPUTER_NAME; + ComputerNameLength = DnsHostName->Length; + + /* find the first dot in the dns host name */ + for (Length = 0; Length < DnsHostName->Length / sizeof(WCHAR); Length++) + { + if (DnsHostName->Buffer[Length] == L'.') + { + /* dot found, so set the length for the oem translation */ + ComputerNameLength = Length * sizeof(WCHAR); + break; + } + } + + /* the computername must have one character */ + if (ComputerNameLength > 0) + { + ComputerNameOemNLength = 0; + /* convert to oem string and use uppercase letters */ + Status = RtlUpcaseUnicodeToOemN(ComputerNameOemN, + MAX_COMPUTERNAME_LENGTH, + &ComputerNameOemNLength, + DnsHostName->Buffer, + ComputerNameLength); + + /* status STATUS_BUFFER_OVERFLOW is not a problem since the computername shoud only + have MAX_COMPUTERNAME_LENGTH characters */ + if ((Status == STATUS_SUCCESS) || + (Status == STATUS_BUFFER_OVERFLOW)) + { + /* set the termination for the oem string */ + ComputerNameOemN[MAX_COMPUTERNAME_LENGTH] = 0; + /* set status for the case the next function failed */ + Status = STATUS_INVALID_COMPUTER_NAME; + /* fillup the oem string structure with the converted computername + and check it for unmapped characters */ + ComputerNameOem.Buffer = ComputerNameOemN; + ComputerNameOem.Length = (USHORT)ComputerNameOemNLength; + ComputerNameOem.MaximumLength = (USHORT)(MAX_COMPUTERNAME_LENGTH + 1); + + if (RtlpDidUnicodeToOemWork(DnsHostName, &ComputerNameOem) == TRUE) + { + /* no unmapped character so convert it back to an unicode string */ + Status = RtlOemStringToUnicodeString(ComputerName, + &ComputerNameOem, + AllocateComputerNameString); + } + } + } + + return Status; +} +
13 years, 3 months
1
0
0
0
[tkreuzer] 53738: [NTOSKRNL] Fix an accidental change. Fixes boot.
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Sep 18 20:56:44 2011 New Revision: 53738 URL:
http://svn.reactos.org/svn/reactos?rev=53738&view=rev
Log: [NTOSKRNL] Fix an accidental change. Fixes boot. Modified: trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c Modified: trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c?…
============================================================================== --- trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c [iso-8859-1] Sun Sep 18 20:56:44 2011 @@ -799,7 +799,7 @@ DllName.Buffer = (PCHAR)Address->u1.Function; DllName.Length = (USHORT)(strchr(DllName.Buffer, '.') - DllName.Buffer) + - sizeof(WCHAR); + sizeof(ANSI_NULL); DllName.MaximumLength = DllName.Length; /* Convert it */
13 years, 3 months
1
0
0
0
[gadamopoulos] 53737: [wingdi.h] - merge one last header change from the themes branch
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Sun Sep 18 16:51:28 2011 New Revision: 53737 URL:
http://svn.reactos.org/svn/reactos?rev=53737&view=rev
Log: [wingdi.h] - merge one last header change from the themes branch Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c trunk/reactos/include/psdk/wingdi.h Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] Sun Sep 18 16:51:28 2011 @@ -1622,11 +1622,11 @@ IN INT ySrc, IN INT cxSrc, IN INT cySrc, - IN COLORREF TransColor + IN UINT TransColor ) { /* FIXME some part need be done in user mode */ - return NtGdiTransparentBlt(hdcDst, xDst, yDst, cxDst, cyDst, hdcSrc, xSrc, ySrc, cxSrc, cySrc, TransColor); + return NtGdiTransparentBlt(hdcDst, xDst, yDst, cxDst, cyDst, hdcSrc, xSrc, ySrc, cxSrc, cySrc, (COLORREF)TransColor); } /* Modified: trunk/reactos/include/psdk/wingdi.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/wingdi.h?rev=…
============================================================================== --- trunk/reactos/include/psdk/wingdi.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/wingdi.h [iso-8859-1] Sun Sep 18 16:51:28 2011 @@ -2995,6 +2995,7 @@ DWORD WINAPI GdiGetBatchLimit(void); DWORD WINAPI GdiSetBatchLimit(DWORD); BOOL WINAPI GdiGradientFill(HDC,PTRIVERTEX,ULONG,PVOID,ULONG,ULONG); +BOOL WINAPI GdiTransparentBlt(HDC,int,int,int,int,HDC,int,int,int,int,UINT); BOOL WINAPI GdiIsMetaFileDC(HDC); #define GetCValue(cmyk) ((BYTE)(cmyk)) #define GetMValue(cmyk) ((BYTE)((cmyk)>> 8))
13 years, 3 months
1
0
0
0
[tkreuzer] 53736: [RTL] Improve formatting, no code change
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Sep 18 15:10:05 2011 New Revision: 53736 URL:
http://svn.reactos.org/svn/reactos?rev=53736&view=rev
Log: [RTL] Improve formatting, no code change Modified: trunk/reactos/lib/rtl/acl.c Modified: trunk/reactos/lib/rtl/acl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/acl.c?rev=53736&r1…
============================================================================== --- trunk/reactos/lib/rtl/acl.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/acl.c [iso-8859-1] Sun Sep 18 15:10:05 2011 @@ -14,264 +14,265 @@ /* FUNCTIONS ***************************************************************/ -BOOLEAN NTAPI -RtlFirstFreeAce(PACL Acl, - PACE* Ace) -{ - PACE Current; - ULONG_PTR AclEnd; - ULONG i; - - PAGED_CODE_RTL(); - - Current = (PACE)(Acl + 1); - *Ace = NULL; - - if (Acl->AceCount == 0) - { - *Ace = Current; - return(TRUE); - } - - i = 0; - AclEnd = (ULONG_PTR)Acl + Acl->AclSize; - do - { - if ((ULONG_PTR)Current >= AclEnd) - { - return(FALSE); - } - if (Current->Header.AceType == ACCESS_ALLOWED_COMPOUND_ACE_TYPE && - Acl->AclRevision < ACL_REVISION3) - { - return(FALSE); - } - Current = (PACE)((ULONG_PTR)Current + Current->Header.AceSize); - } - while (++i < Acl->AceCount); - - if ((ULONG_PTR)Current < AclEnd) - { - *Ace = Current; - } - - return(TRUE); -} - - -/* - * @implemented - */ -NTSTATUS NTAPI -RtlGetAce(PACL Acl, - ULONG AceIndex, - PVOID *Ace) -{ - ULONG i; - - PAGED_CODE_RTL(); - - if (Acl->AclRevision < MIN_ACL_REVISION || - Acl->AclRevision > MAX_ACL_REVISION || - AceIndex >= Acl->AceCount) - { - return(STATUS_INVALID_PARAMETER); - } - - *Ace = (PVOID)((PACE)(Acl + 1)); - - for (i = 0; i < AceIndex; i++) - { - if ((ULONG_PTR)*Ace >= (ULONG_PTR)Acl + Acl->AclSize) - { - return(STATUS_INVALID_PARAMETER); - } - *Ace = (PVOID)((PACE)((ULONG_PTR)(*Ace) + ((PACE)(*Ace))->Header.AceSize)); - } - - if ((ULONG_PTR)*Ace >= (ULONG_PTR)Acl + Acl->AclSize) - { - return(STATUS_INVALID_PARAMETER); - } - - return(STATUS_SUCCESS); -} - - -static NTSTATUS -RtlpAddKnownAce (PACL Acl, - ULONG Revision, - ULONG Flags, - ACCESS_MASK AccessMask, - GUID *ObjectTypeGuid OPTIONAL, - GUID *InheritedObjectTypeGuid OPTIONAL, - PSID Sid, - ULONG Type) -{ - PACE Ace; - PSID SidStart; - ULONG AceSize, InvalidFlags; - ULONG AceObjectFlags = 0; - - PAGED_CODE_RTL(); +BOOLEAN +NTAPI +RtlFirstFreeAce( + PACL Acl, + PACE* Ace) +{ + PACE Current; + ULONG_PTR AclEnd; + ULONG i; + PAGED_CODE_RTL(); + + Current = (PACE)(Acl + 1); + *Ace = NULL; + + if (Acl->AceCount == 0) + { + *Ace = Current; + return TRUE; + } + + i = 0; + AclEnd = (ULONG_PTR)Acl + Acl->AclSize; + do + { + if ((ULONG_PTR)Current >= AclEnd) + { + return FALSE; + } + if (Current->Header.AceType == ACCESS_ALLOWED_COMPOUND_ACE_TYPE && + Acl->AclRevision < ACL_REVISION3) + { + return FALSE; + } + Current = (PACE)((ULONG_PTR)Current + Current->Header.AceSize); + } + while (++i < Acl->AceCount); + + if ((ULONG_PTR)Current < AclEnd) + { + *Ace = Current; + } + + return TRUE; +} + + +/* + * @implemented + */ +NTSTATUS +NTAPI +RtlGetAce( + PACL Acl, + ULONG AceIndex, + PVOID *Ace) +{ + ULONG i; + PAGED_CODE_RTL(); + + if (Acl->AclRevision < MIN_ACL_REVISION || + Acl->AclRevision > MAX_ACL_REVISION || + AceIndex >= Acl->AceCount) + { + return STATUS_INVALID_PARAMETER; + } + + *Ace = (PVOID)((PACE)(Acl + 1)); + + for (i = 0; i < AceIndex; i++) + { + if ((ULONG_PTR)*Ace >= (ULONG_PTR)Acl + Acl->AclSize) + { + return STATUS_INVALID_PARAMETER; + } + *Ace = (PVOID)((PACE)((ULONG_PTR)(*Ace) + ((PACE)(*Ace))->Header.AceSize)); + } + + if ((ULONG_PTR)*Ace >= (ULONG_PTR)Acl + Acl->AclSize) + { + return STATUS_INVALID_PARAMETER; + } + + return STATUS_SUCCESS; +} + + +static +NTSTATUS +RtlpAddKnownAce( + PACL Acl, + ULONG Revision, + ULONG Flags, + ACCESS_MASK AccessMask, + GUID *ObjectTypeGuid OPTIONAL, + GUID *InheritedObjectTypeGuid OPTIONAL, + PSID Sid, + ULONG Type) +{ + PACE Ace; + PSID SidStart; + ULONG AceSize, InvalidFlags; + ULONG AceObjectFlags = 0; + PAGED_CODE_RTL(); #if DBG - /* check if RtlpAddKnownAce was called incorrectly */ - if (ObjectTypeGuid != NULL || InheritedObjectTypeGuid != NULL) - { - ASSERT(Type == ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE || - Type == ACCESS_ALLOWED_OBJECT_ACE_TYPE || - Type == ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE || - Type == ACCESS_DENIED_OBJECT_ACE_TYPE || - Type == SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE || - Type == SYSTEM_AUDIT_OBJECT_ACE_TYPE); - } - else - { - ASSERT(Type != ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE && - Type != ACCESS_ALLOWED_OBJECT_ACE_TYPE && - Type != ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE && - Type != ACCESS_DENIED_OBJECT_ACE_TYPE && - Type != SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE && - Type != SYSTEM_AUDIT_OBJECT_ACE_TYPE); - } + /* check if RtlpAddKnownAce was called incorrectly */ + if (ObjectTypeGuid != NULL || InheritedObjectTypeGuid != NULL) + { + ASSERT(Type == ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE || + Type == ACCESS_ALLOWED_OBJECT_ACE_TYPE || + Type == ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE || + Type == ACCESS_DENIED_OBJECT_ACE_TYPE || + Type == SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE || + Type == SYSTEM_AUDIT_OBJECT_ACE_TYPE); + } + else + { + ASSERT(Type != ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE && + Type != ACCESS_ALLOWED_OBJECT_ACE_TYPE && + Type != ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE && + Type != ACCESS_DENIED_OBJECT_ACE_TYPE && + Type != SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE && + Type != SYSTEM_AUDIT_OBJECT_ACE_TYPE); + } #endif - if (!RtlValidSid(Sid)) - { - return(STATUS_INVALID_SID); - } - - if (Type == SYSTEM_MANDATORY_LABEL_ACE_TYPE) - { - static const SID_IDENTIFIER_AUTHORITY MandatoryLabelAuthority = {SECURITY_MANDATORY_LABEL_AUTHORITY}; - - /* The SID's identifier authority must be SECURITY_MANDATORY_LABEL_AUTHORITY! */ - if (RtlCompareMemory(&((PISID)Sid)->IdentifierAuthority, - &MandatoryLabelAuthority, - sizeof(MandatoryLabelAuthority)) != sizeof(MandatoryLabelAuthority)) - { - return STATUS_INVALID_PARAMETER; - } - } - - if (Acl->AclRevision > MAX_ACL_REVISION || - Revision > MAX_ACL_REVISION) - { - return(STATUS_UNKNOWN_REVISION); - } - if (Revision < Acl->AclRevision) - { - Revision = Acl->AclRevision; - } - - /* Validate the flags */ - if (Type == SYSTEM_AUDIT_ACE_TYPE || - Type == SYSTEM_AUDIT_OBJECT_ACE_TYPE || - Type == SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE) - { - InvalidFlags = Flags & ~(VALID_INHERIT_FLAGS | + if (!RtlValidSid(Sid)) + { + return STATUS_INVALID_SID; + } + + if (Type == SYSTEM_MANDATORY_LABEL_ACE_TYPE) + { + static const SID_IDENTIFIER_AUTHORITY MandatoryLabelAuthority = {SECURITY_MANDATORY_LABEL_AUTHORITY}; + + /* The SID's identifier authority must be SECURITY_MANDATORY_LABEL_AUTHORITY! */ + if (RtlCompareMemory(&((PISID)Sid)->IdentifierAuthority, + &MandatoryLabelAuthority, + sizeof(MandatoryLabelAuthority)) != sizeof(MandatoryLabelAuthority)) + { + return STATUS_INVALID_PARAMETER; + } + } + + if (Acl->AclRevision > MAX_ACL_REVISION || + Revision > MAX_ACL_REVISION) + { + return STATUS_UNKNOWN_REVISION; + } + + if (Revision < Acl->AclRevision) + { + Revision = Acl->AclRevision; + } + + /* Validate the flags */ + if (Type == SYSTEM_AUDIT_ACE_TYPE || + Type == SYSTEM_AUDIT_OBJECT_ACE_TYPE || + Type == SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE) + { + InvalidFlags = Flags & ~(VALID_INHERIT_FLAGS | SUCCESSFUL_ACCESS_ACE_FLAG | FAILED_ACCESS_ACE_FLAG); - } - else - { - InvalidFlags = Flags & ~VALID_INHERIT_FLAGS; - } - - if (InvalidFlags != 0) - { - return(STATUS_INVALID_PARAMETER); - } - - if (!RtlFirstFreeAce(Acl, &Ace)) - { - return(STATUS_INVALID_ACL); - } - if (Ace == NULL) - { - return(STATUS_ALLOTTED_SPACE_EXCEEDED); - } - - /* Calculate the size of the ACE */ - AceSize = RtlLengthSid(Sid) + sizeof(ACE); - if (ObjectTypeGuid != NULL) - { - AceObjectFlags |= ACE_OBJECT_TYPE_PRESENT; - AceSize += sizeof(GUID); - } - if (InheritedObjectTypeGuid != NULL) - { - AceObjectFlags |= ACE_INHERITED_OBJECT_TYPE_PRESENT; - AceSize += sizeof(GUID); - } - - if (AceObjectFlags != 0) - { - /* Don't forget the ACE object flags - (corresponds to the Flags field in the *_OBJECT_ACE structures) */ - AceSize += sizeof(ULONG); - } - - if ((ULONG_PTR)Ace + AceSize > - (ULONG_PTR)Acl + Acl->AclSize) - { - return(STATUS_ALLOTTED_SPACE_EXCEEDED); - } - - /* initialize the header and common fields */ - Ace->Header.AceFlags = Flags; - Ace->Header.AceType = Type; - Ace->Header.AceSize = (WORD)AceSize; - Ace->AccessMask = AccessMask; - - if (AceObjectFlags != 0) - { - /* Write the ACE flags to the ACE - (corresponds to the Flags field in the *_OBJECT_ACE structures) */ - *(PULONG)(Ace + 1) = AceObjectFlags; - SidStart = (PSID)((ULONG_PTR)(Ace + 1) + sizeof(ULONG)); - } - else - SidStart = (PSID)(Ace + 1); - - /* copy the GUIDs */ - if (ObjectTypeGuid != NULL) - { - RtlCopyMemory(SidStart, - ObjectTypeGuid, - sizeof(GUID)); - SidStart = (PSID)((ULONG_PTR)SidStart + sizeof(GUID)); - } - if (InheritedObjectTypeGuid != NULL) - { - RtlCopyMemory(SidStart, - InheritedObjectTypeGuid, - sizeof(GUID)); - SidStart = (PSID)((ULONG_PTR)SidStart + sizeof(GUID)); - } - - /* copy the SID */ - RtlCopySid(RtlLengthSid(Sid), - SidStart, - Sid); - Acl->AceCount++; - Acl->AclRevision = Revision; - return(STATUS_SUCCESS); -} - - -/* - * @implemented - */ -NTSTATUS NTAPI -RtlAddAccessAllowedAce (IN OUT PACL Acl, - IN ULONG Revision, - IN ACCESS_MASK AccessMask, - IN PSID Sid) -{ - PAGED_CODE_RTL(); - - return RtlpAddKnownAce (Acl, + } + else + { + InvalidFlags = Flags & ~VALID_INHERIT_FLAGS; + } + + if (InvalidFlags != 0) + { + return STATUS_INVALID_PARAMETER; + } + + if (!RtlFirstFreeAce(Acl, &Ace)) + { + return STATUS_INVALID_ACL; + } + if (Ace == NULL) + { + return STATUS_ALLOTTED_SPACE_EXCEEDED; + } + + /* Calculate the size of the ACE */ + AceSize = RtlLengthSid(Sid) + sizeof(ACE); + if (ObjectTypeGuid != NULL) + { + AceObjectFlags |= ACE_OBJECT_TYPE_PRESENT; + AceSize += sizeof(GUID); + } + if (InheritedObjectTypeGuid != NULL) + { + AceObjectFlags |= ACE_INHERITED_OBJECT_TYPE_PRESENT; + AceSize += sizeof(GUID); + } + + if (AceObjectFlags != 0) + { + /* Don't forget the ACE object flags + (corresponds to the Flags field in the *_OBJECT_ACE structures) */ + AceSize += sizeof(ULONG); + } + + if ((ULONG_PTR)Ace + AceSize > + (ULONG_PTR)Acl + Acl->AclSize) + { + return STATUS_ALLOTTED_SPACE_EXCEEDED; + } + + /* initialize the header and common fields */ + Ace->Header.AceFlags = Flags; + Ace->Header.AceType = Type; + Ace->Header.AceSize = (WORD)AceSize; + Ace->AccessMask = AccessMask; + + if (AceObjectFlags != 0) + { + /* Write the ACE flags to the ACE + (corresponds to the Flags field in the *_OBJECT_ACE structures) */ + *(PULONG)(Ace + 1) = AceObjectFlags; + SidStart = (PSID)((ULONG_PTR)(Ace + 1) + sizeof(ULONG)); + } + else + SidStart = (PSID)(Ace + 1); + + /* copy the GUIDs */ + if (ObjectTypeGuid != NULL) + { + RtlCopyMemory(SidStart, ObjectTypeGuid, sizeof(GUID)); + SidStart = (PSID)((ULONG_PTR)SidStart + sizeof(GUID)); + } + if (InheritedObjectTypeGuid != NULL) + { + RtlCopyMemory(SidStart, InheritedObjectTypeGuid, sizeof(GUID)); + SidStart = (PSID)((ULONG_PTR)SidStart + sizeof(GUID)); + } + + /* copy the SID */ + RtlCopySid(RtlLengthSid(Sid), SidStart, Sid); + Acl->AceCount++; + Acl->AclRevision = Revision; + + return STATUS_SUCCESS; +} + + +/* + * @implemented + */ +NTSTATUS +NTAPI +RtlAddAccessAllowedAce( + IN OUT PACL Acl, + IN ULONG Revision, + IN ACCESS_MASK AccessMask, + IN PSID Sid) +{ + PAGED_CODE_RTL(); + + return RtlpAddKnownAce(Acl, Revision, 0, AccessMask, @@ -285,16 +286,18 @@ /* * @implemented */ -NTSTATUS NTAPI -RtlAddAccessAllowedAceEx (IN OUT PACL Acl, - IN ULONG Revision, - IN ULONG Flags, - IN ACCESS_MASK AccessMask, - IN PSID Sid) -{ - PAGED_CODE_RTL(); - - return RtlpAddKnownAce (Acl, +NTSTATUS +NTAPI +RtlAddAccessAllowedAceEx( + IN OUT PACL Acl, + IN ULONG Revision, + IN ULONG Flags, + IN ACCESS_MASK AccessMask, + IN PSID Sid) +{ + PAGED_CODE_RTL(); + + return RtlpAddKnownAce(Acl, Revision, Flags, AccessMask, @@ -308,26 +311,27 @@ /* * @implemented */ -NTSTATUS NTAPI -RtlAddAccessAllowedObjectAce (IN OUT PACL Acl, - IN ULONG Revision, - IN ULONG Flags, - IN ACCESS_MASK AccessMask, - IN GUID *ObjectTypeGuid OPTIONAL, - IN GUID *InheritedObjectTypeGuid OPTIONAL, - IN PSID Sid) -{ - ULONG Type; - - PAGED_CODE_RTL(); - - /* make sure we call RtlpAddKnownAce correctly */ - if (ObjectTypeGuid != NULL || InheritedObjectTypeGuid != NULL) - Type = ACCESS_ALLOWED_OBJECT_ACE_TYPE; - else - Type = ACCESS_ALLOWED_ACE_TYPE; - - return RtlpAddKnownAce (Acl, +NTSTATUS +NTAPI +RtlAddAccessAllowedObjectAce( + IN OUT PACL Acl, + IN ULONG Revision, + IN ULONG Flags, + IN ACCESS_MASK AccessMask, + IN GUID *ObjectTypeGuid OPTIONAL, + IN GUID *InheritedObjectTypeGuid OPTIONAL, + IN PSID Sid) +{ + ULONG Type; + PAGED_CODE_RTL(); + + /* make sure we call RtlpAddKnownAce correctly */ + if (ObjectTypeGuid != NULL || InheritedObjectTypeGuid != NULL) + Type = ACCESS_ALLOWED_OBJECT_ACE_TYPE; + else + Type = ACCESS_ALLOWED_ACE_TYPE; + + return RtlpAddKnownAce(Acl, Revision, Flags, AccessMask, @@ -341,15 +345,17 @@ /* * @implemented */ -NTSTATUS NTAPI -RtlAddAccessDeniedAce (PACL Acl, - ULONG Revision, - ACCESS_MASK AccessMask, - PSID Sid) -{ - PAGED_CODE_RTL(); - - return RtlpAddKnownAce (Acl, +NTSTATUS +NTAPI +RtlAddAccessDeniedAce( + PACL Acl, + ULONG Revision, + ACCESS_MASK AccessMask, + PSID Sid) +{ + PAGED_CODE_RTL(); + + return RtlpAddKnownAce(Acl, Revision, 0, AccessMask, @@ -363,16 +369,18 @@ /* * @implemented */ -NTSTATUS NTAPI -RtlAddAccessDeniedAceEx (IN OUT PACL Acl, - IN ULONG Revision, - IN ULONG Flags, - IN ACCESS_MASK AccessMask, - IN PSID Sid) -{ - PAGED_CODE_RTL(); - - return RtlpAddKnownAce (Acl, +NTSTATUS +NTAPI +RtlAddAccessDeniedAceEx( + IN OUT PACL Acl, + IN ULONG Revision, + IN ULONG Flags, + IN ACCESS_MASK AccessMask, + IN PSID Sid) +{ + PAGED_CODE_RTL(); + + return RtlpAddKnownAce(Acl, Revision, Flags, AccessMask, @@ -386,26 +394,27 @@ /* * @implemented */ -NTSTATUS NTAPI -RtlAddAccessDeniedObjectAce (IN OUT PACL Acl, - IN ULONG Revision, - IN ULONG Flags, - IN ACCESS_MASK AccessMask, - IN GUID *ObjectTypeGuid OPTIONAL, - IN GUID *InheritedObjectTypeGuid OPTIONAL, - IN PSID Sid) -{ - ULONG Type; - - PAGED_CODE_RTL(); - - /* make sure we call RtlpAddKnownAce correctly */ - if (ObjectTypeGuid != NULL || InheritedObjectTypeGuid != NULL) - Type = ACCESS_DENIED_OBJECT_ACE_TYPE; - else - Type = ACCESS_DENIED_ACE_TYPE; - - return RtlpAddKnownAce (Acl, +NTSTATUS +NTAPI +RtlAddAccessDeniedObjectAce( + IN OUT PACL Acl, + IN ULONG Revision, + IN ULONG Flags, + IN ACCESS_MASK AccessMask, + IN GUID *ObjectTypeGuid OPTIONAL, + IN GUID *InheritedObjectTypeGuid OPTIONAL, + IN PSID Sid) +{ + ULONG Type; + PAGED_CODE_RTL(); + + /* make sure we call RtlpAddKnownAce correctly */ + if (ObjectTypeGuid != NULL || InheritedObjectTypeGuid != NULL) + Type = ACCESS_DENIED_OBJECT_ACE_TYPE; + else + Type = ACCESS_DENIED_ACE_TYPE; + + return RtlpAddKnownAce(Acl, Revision, Flags, AccessMask, @@ -416,123 +425,118 @@ } -static VOID -RtlpAddData(PVOID AceList, - ULONG AceListLength, - PVOID Ace, - ULONG Offset) -{ - if (Offset > 0) - { - RtlCopyMemory((PVOID)((ULONG_PTR)Ace + AceListLength), - Ace, - Offset); - } - - if (AceListLength != 0) - { - RtlCopyMemory(Ace, - AceList, - AceListLength); - } -} - - -/* - * @implemented - */ -NTSTATUS NTAPI -RtlAddAce(PACL Acl, - ULONG AclRevision, - ULONG StartingIndex, - PVOID AceList, - ULONG AceListLength) -{ - PACE Ace; - PACE Current; - ULONG NewAceCount; - ULONG Index; - - PAGED_CODE_RTL(); - - if (Acl->AclRevision < MIN_ACL_REVISION || - Acl->AclRevision > MAX_ACL_REVISION || - !RtlFirstFreeAce(Acl, &Ace)) - { - return(STATUS_INVALID_PARAMETER); - } - - if (Acl->AclRevision <= AclRevision) - { - AclRevision = Acl->AclRevision; - } - - if (((ULONG_PTR)AceList + AceListLength) <= (ULONG_PTR)AceList) - { - return(STATUS_INVALID_PARAMETER); - } - - for (Current = AceList, NewAceCount = 0; - (ULONG_PTR)Current < ((ULONG_PTR)AceList + AceListLength); - Current = (PACE)((ULONG_PTR)Current + Current->Header.AceSize), - ++NewAceCount) - { - if (((PACE)AceList)->Header.AceType == ACCESS_ALLOWED_COMPOUND_ACE_TYPE && - AclRevision < ACL_REVISION3) - { - return(STATUS_INVALID_PARAMETER); - } - } - - if (Ace == NULL || - ((ULONG_PTR)Ace + AceListLength) > ((ULONG_PTR)Acl + Acl->AclSize)) - { - return(STATUS_BUFFER_TOO_SMALL); - } - - Current = (PACE)(Acl + 1); - for (Index = 0; Index < StartingIndex && Index < Acl->AceCount; Index++) - { - Current = (PACE)((ULONG_PTR)Current + Current->Header.AceSize); - } - - RtlpAddData(AceList, - AceListLength, - Current, - (ULONG)((ULONG_PTR)Ace - (ULONG_PTR)Current)); - Acl->AceCount = Acl->AceCount + NewAceCount; - Acl->AclRevision = AclRevision; - - return(STATUS_SUCCESS); -} - - -/* - * @implemented - */ -NTSTATUS NTAPI -RtlAddAuditAccessAce(PACL Acl, - ULONG Revision, - ACCESS_MASK AccessMask, - PSID Sid, - BOOLEAN Success, - BOOLEAN Failure) -{ - ULONG Flags = 0; - - PAGED_CODE_RTL(); - - if (Success) - { - Flags |= SUCCESSFUL_ACCESS_ACE_FLAG; - } - - if (Failure) - { - Flags |= FAILED_ACCESS_ACE_FLAG; - } - - return RtlpAddKnownAce (Acl, +static +VOID +RtlpAddData( + PVOID AceList, + ULONG AceListLength, + PVOID Ace, + ULONG Offset) +{ + if (Offset > 0) + { + RtlCopyMemory((PVOID)((ULONG_PTR)Ace + AceListLength), + Ace, + Offset); + } + + if (AceListLength != 0) + { + RtlCopyMemory(Ace, AceList, AceListLength); + } +} + + +/* + * @implemented + */ +NTSTATUS +NTAPI +RtlAddAce( + PACL Acl, + ULONG AclRevision, + ULONG StartingIndex, + PVOID AceList, + ULONG AceListLength) +{ + PACE Ace; + PACE Current; + ULONG NewAceCount; + ULONG Index; + PAGED_CODE_RTL(); + + if (Acl->AclRevision < MIN_ACL_REVISION || + Acl->AclRevision > MAX_ACL_REVISION || + !RtlFirstFreeAce(Acl, &Ace)) + { + return STATUS_INVALID_PARAMETER; + } + + if (Acl->AclRevision <= AclRevision) + { + AclRevision = Acl->AclRevision; + } + + if (((ULONG_PTR)AceList + AceListLength) <= (ULONG_PTR)AceList) + { + return STATUS_INVALID_PARAMETER; + } + + for (Current = AceList, NewAceCount = 0; + (ULONG_PTR)Current < ((ULONG_PTR)AceList + AceListLength); + Current = (PACE)((ULONG_PTR)Current + Current->Header.AceSize), + ++NewAceCount) + { + if (((PACE)AceList)->Header.AceType == ACCESS_ALLOWED_COMPOUND_ACE_TYPE && + AclRevision < ACL_REVISION3) + { + return STATUS_INVALID_PARAMETER; + } + } + + if (Ace == NULL || + ((ULONG_PTR)Ace + AceListLength) > ((ULONG_PTR)Acl + Acl->AclSize)) + { + return STATUS_BUFFER_TOO_SMALL; + } + + Current = (PACE)(Acl + 1); + for (Index = 0; Index < StartingIndex && Index < Acl->AceCount; Index++) + { + Current = (PACE)((ULONG_PTR)Current + Current->Header.AceSize); + } + + RtlpAddData(AceList, + AceListLength, + Current, + (ULONG)((ULONG_PTR)Ace - (ULONG_PTR)Current)); + Acl->AceCount = Acl->AceCount + NewAceCount; + Acl->AclRevision = AclRevision; + + return STATUS_SUCCESS; +} + + +/* + * @implemented + */ +NTSTATUS +NTAPI +RtlAddAuditAccessAce( + PACL Acl, + ULONG Revision, + ACCESS_MASK AccessMask, + PSID Sid, + BOOLEAN Success, + BOOLEAN Failure) +{ + ULONG Flags = 0; + PAGED_CODE_RTL(); + + if (Success) Flags |= SUCCESSFUL_ACCESS_ACE_FLAG; + if (Failure) Flags |= FAILED_ACCESS_ACE_FLAG; + + return RtlpAddKnownAce(Acl, Revision, Flags, AccessMask, @@ -546,26 +550,21 @@ /* * @implemented */ -NTSTATUS NTAPI -RtlAddAuditAccessAceEx(PACL Acl, - ULONG Revision, - ULONG Flags, - ACCESS_MASK AccessMask, - PSID Sid, - BOOLEAN Success, - BOOLEAN Failure) -{ - if (Success) - { - Flags |= SUCCESSFUL_ACCESS_ACE_FLAG; - } - - if (Failure) - { - Flags |= FAILED_ACCESS_ACE_FLAG; - } - - return RtlpAddKnownAce (Acl, +NTSTATUS +NTAPI +RtlAddAuditAccessAceEx( + PACL Acl, + ULONG Revision, + ULONG Flags, + ACCESS_MASK AccessMask, + PSID Sid, + BOOLEAN Success, + BOOLEAN Failure) +{ + if (Success) Flags |= SUCCESSFUL_ACCESS_ACE_FLAG; + if (Failure) Flags |= FAILED_ACCESS_ACE_FLAG; + + return RtlpAddKnownAce(Acl, Revision, Flags, AccessMask, @@ -579,36 +578,38 @@ /* * @implemented */ -NTSTATUS NTAPI -RtlAddAuditAccessObjectAce(PACL Acl, - ULONG Revision, - ULONG Flags, - ACCESS_MASK AccessMask, - IN GUID *ObjectTypeGuid OPTIONAL, - IN GUID *InheritedObjectTypeGuid OPTIONAL, - PSID Sid, - BOOLEAN Success, - BOOLEAN Failure) -{ - ULONG Type; - - if (Success) - { - Flags |= SUCCESSFUL_ACCESS_ACE_FLAG; - } - - if (Failure) - { - Flags |= FAILED_ACCESS_ACE_FLAG; - } - - /* make sure we call RtlpAddKnownAce correctly */ - if (ObjectTypeGuid != NULL || InheritedObjectTypeGuid != NULL) - Type = SYSTEM_AUDIT_OBJECT_ACE_TYPE; - else - Type = SYSTEM_AUDIT_ACE_TYPE; - - return RtlpAddKnownAce (Acl, +NTSTATUS +NTAPI +RtlAddAuditAccessObjectAce( + PACL Acl, + ULONG Revision, + ULONG Flags, + ACCESS_MASK AccessMask, + IN GUID *ObjectTypeGuid OPTIONAL, + IN GUID *InheritedObjectTypeGuid OPTIONAL, + PSID Sid, + BOOLEAN Success, + BOOLEAN Failure) +{ + ULONG Type; + + if (Success) + { + Flags |= SUCCESSFUL_ACCESS_ACE_FLAG; + } + + if (Failure) + { + Flags |= FAILED_ACCESS_ACE_FLAG; + } + + /* make sure we call RtlpAddKnownAce correctly */ + if (ObjectTypeGuid != NULL || InheritedObjectTypeGuid != NULL) + Type = SYSTEM_AUDIT_OBJECT_ACE_TYPE; + else + Type = SYSTEM_AUDIT_ACE_TYPE; + + return RtlpAddKnownAce(Acl, Revision, Flags, AccessMask, @@ -622,13 +623,15 @@ /* * @implemented */ -NTSTATUS NTAPI -RtlAddMandatoryAce(IN OUT PACL Acl, - IN ULONG Revision, - IN ULONG Flags, - IN ULONG MandatoryFlags, - IN ULONG AceType, - IN PSID LabelSid) +NTSTATUS +NTAPI +RtlAddMandatoryAce( + IN OUT PACL Acl, + IN ULONG Revision, + IN ULONG Flags, + IN ULONG MandatoryFlags, + IN ULONG AceType, + IN PSID LabelSid) { if (MandatoryFlags & ~SYSTEM_MANDATORY_LABEL_VALID_MASK) return STATUS_INVALID_PARAMETER; @@ -636,151 +639,156 @@ if (AceType != SYSTEM_MANDATORY_LABEL_ACE_TYPE) return STATUS_INVALID_PARAMETER; - return RtlpAddKnownAce (Acl, - Revision, - Flags, - (ACCESS_MASK)MandatoryFlags, - NULL, - NULL, - LabelSid, - AceType); -} - - -static VOID -RtlpDeleteData(PVOID Ace, - ULONG AceSize, - ULONG Offset) -{ - if (AceSize < Offset) - { - RtlMoveMemory(Ace, - (PVOID)((ULONG_PTR)Ace + AceSize), - Offset - AceSize); - } - - if (Offset - AceSize < Offset) - { - RtlZeroMemory((PVOID)((ULONG_PTR)Ace + Offset - AceSize), - AceSize); - } -} - - -/* - * @implemented - */ -NTSTATUS NTAPI -RtlDeleteAce(PACL Acl, - ULONG AceIndex) -{ - PACE Ace; - PACE Current; - - PAGED_CODE_RTL(); - - if (Acl->AclRevision < MIN_ACL_REVISION || - Acl->AclRevision > MAX_ACL_REVISION || - Acl->AceCount <= AceIndex || - !RtlFirstFreeAce(Acl, &Ace)) - { - return(STATUS_INVALID_PARAMETER); - } - - Current = (PACE)(Acl + 1); - - while(AceIndex--) - { - Current = (PACE)((ULONG_PTR)Current + Current->Header.AceSize); - } - - RtlpDeleteData(Current, - Current->Header.AceSize, - (ULONG)((ULONG_PTR)Ace - (ULONG_PTR)Current)); - Acl->AceCount--; - - return(STATUS_SUCCESS); -} - - -/* - * @implemented - */ -NTSTATUS NTAPI -RtlCreateAcl(PACL Acl, - ULONG AclSize, - ULONG AclRevision) -{ - PAGED_CODE_RTL(); - - if (AclSize < sizeof(ACL)) - { - return(STATUS_BUFFER_TOO_SMALL); - } - - if (AclRevision < MIN_ACL_REVISION || - AclRevision > MAX_ACL_REVISION || - AclSize > 0xffff) - { - return(STATUS_INVALID_PARAMETER); - } - - AclSize = ROUND_UP(AclSize, 4); - Acl->AclSize = AclSize; - Acl->AclRevision = AclRevision; - Acl->AceCount = 0; - Acl->Sbz1 = 0; - Acl->Sbz2 = 0; - - return(STATUS_SUCCESS); -} - - -/* - * @implemented - */ -NTSTATUS NTAPI -RtlQueryInformationAcl(PACL Acl, - PVOID Information, - ULONG InformationLength, - ACL_INFORMATION_CLASS InformationClass) -{ - PACE Ace; - - PAGED_CODE_RTL(); - - if (Acl->AclRevision < MIN_ACL_REVISION || + return RtlpAddKnownAce(Acl, + Revision, + Flags, + (ACCESS_MASK)MandatoryFlags, + NULL, + NULL, + LabelSid, + AceType); +} + + +static +VOID +RtlpDeleteData( + PVOID Ace, + ULONG AceSize, + ULONG Offset) +{ + if (AceSize < Offset) + { + RtlMoveMemory(Ace, + (PVOID)((ULONG_PTR)Ace + AceSize), + Offset - AceSize); + } + + if (Offset - AceSize < Offset) + { + RtlZeroMemory((PVOID)((ULONG_PTR)Ace + Offset - AceSize), AceSize); + } +} + + +/* + * @implemented + */ +NTSTATUS +NTAPI +RtlDeleteAce( + PACL Acl, + ULONG AceIndex) +{ + PACE Ace; + PACE Current; + PAGED_CODE_RTL(); + + if (Acl->AclRevision < MIN_ACL_REVISION || + Acl->AclRevision > MAX_ACL_REVISION || + Acl->AceCount <= AceIndex || + !RtlFirstFreeAce(Acl, &Ace)) + { + return STATUS_INVALID_PARAMETER; + } + + Current = (PACE)(Acl + 1); + + while(AceIndex--) + { + Current = (PACE)((ULONG_PTR)Current + Current->Header.AceSize); + } + + RtlpDeleteData(Current, + Current->Header.AceSize, + (ULONG)((ULONG_PTR)Ace - (ULONG_PTR)Current)); + Acl->AceCount--; + + return STATUS_SUCCESS; +} + + +/* + * @implemented + */ +NTSTATUS +NTAPI +RtlCreateAcl( + PACL Acl, + ULONG AclSize, + ULONG AclRevision) +{ + PAGED_CODE_RTL(); + + if (AclSize < sizeof(ACL)) + { + return STATUS_BUFFER_TOO_SMALL; + } + + if (AclRevision < MIN_ACL_REVISION || + AclRevision > MAX_ACL_REVISION || + AclSize > 0xffff) + { + return STATUS_INVALID_PARAMETER; + } + + AclSize = ROUND_UP(AclSize, 4); + Acl->AclSize = AclSize; + Acl->AclRevision = AclRevision; + Acl->AceCount = 0; + Acl->Sbz1 = 0; + Acl->Sbz2 = 0; + + return STATUS_SUCCESS; +} + + +/* + * @implemented + */ +NTSTATUS +NTAPI +RtlQueryInformationAcl( + PACL Acl, + PVOID Information, + ULONG InformationLength, + ACL_INFORMATION_CLASS InformationClass) +{ + PACE Ace; + PAGED_CODE_RTL(); + + if (Acl->AclRevision < MIN_ACL_REVISION || Acl->AclRevision > MAX_ACL_REVISION) - { - return(STATUS_INVALID_PARAMETER); - } - - switch (InformationClass) - { - case AclRevisionInformation: - { + { + return STATUS_INVALID_PARAMETER; + } + + switch (InformationClass) + { + case AclRevisionInformation: + { PACL_REVISION_INFORMATION Info = (PACL_REVISION_INFORMATION)Information; if (InformationLength < sizeof(ACL_REVISION_INFORMATION)) { - return(STATUS_BUFFER_TOO_SMALL); + return STATUS_BUFFER_TOO_SMALL; } Info->AclRevision = Acl->AclRevision; - } - break; - - case AclSizeInformation: - { + } + break; + + case AclSizeInformation: + { PACL_SIZE_INFORMATION Info = (PACL_SIZE_INFORMATION)Information; if (InformationLength < sizeof(ACL_SIZE_INFORMATION)) { - return(STATUS_BUFFER_TOO_SMALL); + return STATUS_BUFFER_TOO_SMALL; } if (!RtlFirstFreeAce(Acl, &Ace)) { - return(STATUS_INVALID_PARAMETER); + return STATUS_INVALID_PARAMETER; } Info->AceCount = Acl->AceCount; @@ -794,14 +802,14 @@ Info->AclBytesInUse = Acl->AclSize; Info->AclBytesFree = 0; } - } - break; - - default: - return(STATUS_INVALID_INFO_CLASS); - } - - return(STATUS_SUCCESS); + } + break; + + default: + return STATUS_INVALID_INFO_CLASS; + } + + return STATUS_SUCCESS; } @@ -814,67 +822,67 @@ ULONG InformationLength, ACL_INFORMATION_CLASS InformationClass) { - PAGED_CODE_RTL(); - - if (Acl->AclRevision < MIN_ACL_REVISION || + PAGED_CODE_RTL(); + + if (Acl->AclRevision < MIN_ACL_REVISION || Acl->AclRevision > MAX_ACL_REVISION) - { - return(STATUS_INVALID_PARAMETER); - } - - switch (InformationClass) - { - case AclRevisionInformation: - { + { + return STATUS_INVALID_PARAMETER; + } + + switch (InformationClass) + { + case AclRevisionInformation: + { PACL_REVISION_INFORMATION Info = (PACL_REVISION_INFORMATION)Information; if (InformationLength < sizeof(ACL_REVISION_INFORMATION)) { - return(STATUS_BUFFER_TOO_SMALL); + return STATUS_BUFFER_TOO_SMALL; } if (Acl->AclRevision >= Info->AclRevision) { - return(STATUS_INVALID_PARAMETER); + return STATUS_INVALID_PARAMETER; } Acl->AclRevision = Info->AclRevision; - } - break; - - default: - return(STATUS_INVALID_INFO_CLASS); + } + break; + + default: + return STATUS_INVALID_INFO_CLASS; } - return(STATUS_SUCCESS); -} - - -/* - * @implemented - */ -BOOLEAN NTAPI -RtlValidAcl (PACL Acl) -{ - PACE Ace; - USHORT Size; - - PAGED_CODE_RTL(); - - Size = ROUND_UP(Acl->AclSize, 4); - - if (Acl->AclRevision < MIN_ACL_REVISION || - Acl->AclRevision > MAX_ACL_REVISION) - { - return(FALSE); - } - - if (Size != Acl->AclSize) - { - return(FALSE); - } - - return(RtlFirstFreeAce(Acl, &Ace)); + return STATUS_SUCCESS; +} + + +/* + * @implemented + */ +BOOLEAN +NTAPI +RtlValidAcl(PACL Acl) +{ + PACE Ace; + USHORT Size; + PAGED_CODE_RTL(); + + Size = ROUND_UP(Acl->AclSize, 4); + + if (Acl->AclRevision < MIN_ACL_REVISION || + Acl->AclRevision > MAX_ACL_REVISION) + { + return FALSE; + } + + if (Size != Acl->AclSize) + { + return FALSE; + } + + return RtlFirstFreeAce(Acl, &Ace); } /* EOF */
13 years, 3 months
1
0
0
0
[gadamopoulos] 53735: [headers] - Begin merging from themes branch
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Sun Sep 18 13:12:44 2011 New Revision: 53735 URL:
http://svn.reactos.org/svn/reactos?rev=53735&view=rev
Log: [headers] - Begin merging from themes branch Added: trunk/reactos/include/reactos/uxundoc.h (with props) Modified: trunk/reactos/dll/win32/user32/misc/usrapihk.c trunk/reactos/include/reactos/undocuser.h trunk/reactos/include/reactos/win32k/callback.h Modified: trunk/reactos/dll/win32/user32/misc/usrapihk.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/usra…
============================================================================== --- trunk/reactos/dll/win32/user32/misc/usrapihk.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/misc/usrapihk.c [iso-8859-1] Sun Sep 18 13:12:44 2011 @@ -260,7 +260,7 @@ RtlEnterCriticalSection(&gcsUserApiHook); - if (!pfn(uahLoadInit,(ULONG_PTR)&uah) || // Swap data, User32 to and Uxtheme from! + if (!pfn(uahLoadInit,&uah) || // Swap data, User32 to and Uxtheme from! uah.ForceResetUserApiHook != (FARPROC)ForceResetUserApiHook || uah.size <= 0 ) { Modified: trunk/reactos/include/reactos/undocuser.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/undocuser.…
============================================================================== --- trunk/reactos/include/reactos/undocuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/undocuser.h [iso-8859-1] Sun Sep 18 13:12:44 2011 @@ -24,27 +24,30 @@ #define WS_EX_SETANSICREATOR 0x80000000 // For WNDS_ANSICREATOR /* Non SDK Window Message types. */ -#define WM_SETVISIBLE 0x00000009 -#define WM_ALTTABACTIVE 0x00000029 -#define WM_ISACTIVEICON 0x00000035 -#define WM_QUERYPARKICON 0x00000036 -#define WM_CLIENTSHUTDOWN 0x0000003B -#define WM_COPYGLOBALDATA 0x00000049 -#define WM_LOGONNOTIFY 0x0000004c -#define WM_KEYF1 0x0000004d -#define WM_SYSTIMER 0x00000118 -#define WM_LBTRACKPOINT 0x00000131 -#define LB_CARETON 0x000001a3 -#define LB_CARETOFF 0x000001a4 -#define WM_DROPOBJECT 0x0000022A -#define WM_QUERYDROPOBJECT 0x0000022B -#define WM_BEGINDRAG 0x0000022C -#define WM_DRAGLOOP 0x0000022D -#define WM_DRAGSELECT 0x0000022E -#define WM_DRAGMOVE 0x0000022F -#define WM_POPUPSYSTEMMENU 0x00000313 -#define WM_CBT 0x000003FF // ReactOS only. -#define WM_MAXIMUM 0x0001FFFF +#define WM_SETVISIBLE 0x00000009 +#define WM_ALTTABACTIVE 0x00000029 +#define WM_ISACTIVEICON 0x00000035 +#define WM_QUERYPARKICON 0x00000036 +#define WM_CLIENTSHUTDOWN 0x0000003B +#define WM_COPYGLOBALDATA 0x00000049 +#define WM_LOGONNOTIFY 0x0000004C +#define WM_KEYF1 0x0000004D +#define WM_NCUAHDRAWCAPTION 0x000000AE +#define WM_NCUAHDRAWFRAME 0x000000AF +#define WM_SYSTIMER 0x00000118 +#define WM_LBTRACKPOINT 0x00000131 +#define LB_CARETON 0x000001a3 +#define LB_CARETOFF 0x000001a4 +#define WM_DROPOBJECT 0x0000022A +#define WM_QUERYDROPOBJECT 0x0000022B +#define WM_BEGINDRAG 0x0000022C +#define WM_DRAGLOOP 0x0000022D +#define WM_DRAGSELECT 0x0000022E +#define WM_DRAGMOVE 0x0000022F +#define WM_POPUPSYSTEMMENU 0x00000313 +#define WM_UAHINIT 0x0000031b +#define WM_CBT 0x000003FF // ReactOS only. +#define WM_MAXIMUM 0x0001FFFF /* Non SDK DCE types.*/ #define DCX_USESTYLE 0x00010000 @@ -120,6 +123,55 @@ // User api hook // +typedef LRESULT(CALLBACK *WNDPROC_OWP)(HWND,UINT,WPARAM,LPARAM,ULONG_PTR,PDWORD); +typedef int (WINAPI *SETWINDOWRGN)(HWND hWnd, HRGN hRgn, BOOL bRedraw); + +typedef struct _UAHOWP +{ + BYTE* MsgBitArray; + DWORD Size; +} UAHOWP, *PUAHOWP; + +#define UAH_HOOK_MESSAGE(uahowp, msg) uahowp.MsgBitArray[msg/8] |= (1 << (msg % 8)); +#define UAH_IS_MESSAGE_HOOKED(uahowp, msg) (uahowp.MsgBitArray[msg/8] & (1 << (msg % 8))) +#define UAHOWP_MAX_SIZE WM_USER/8 + +typedef struct tagUSERAPIHOOK +{ + DWORD size; + WNDPROC DefWindowProcA; + WNDPROC DefWindowProcW; + UAHOWP DefWndProcArray; + FARPROC GetScrollInfo; + FARPROC SetScrollInfo; + FARPROC EnableScrollBar; + FARPROC AdjustWindowRectEx; + SETWINDOWRGN SetWindowRgn; + WNDPROC_OWP PreWndProc; + WNDPROC_OWP PostWndProc; + UAHOWP WndProcArray; + WNDPROC_OWP PreDefDlgProc; + WNDPROC_OWP PostDefDlgProc; + UAHOWP DlgProcArray; + FARPROC GetSystemMetrics; + FARPROC SystemParametersInfoA; + FARPROC SystemParametersInfoW; + FARPROC ForceResetUserApiHook; + FARPROC DrawFrameControl; + FARPROC DrawCaption; + FARPROC MDIRedrawFrame; + FARPROC GetRealWindowOwner; +} USERAPIHOOK, *PUSERAPIHOOK; + +typedef enum _UAPIHK +{ + uahLoadInit, + uahStop, + uahShutdown +} UAPIHK, *PUAPIHK; + +typedef BOOL(CALLBACK *USERAPIHOOKPROC)(UAPIHK State, PUSERAPIHOOK puah); + typedef struct _USERAPIHOOKINFO { DWORD m_size; @@ -129,51 +181,12 @@ LPCWSTR m_funname2; } USERAPIHOOKINFO,*PUSERAPIHOOKINFO; -typedef enum _UAPIHK -{ - uahLoadInit, - uahStop, - uahShutdown -} UAPIHK, *PUAPIHK; +#if (WINVER == _WIN32_WINNT_WINXP) +BOOL WINAPI RegisterUserApiHook(HINSTANCE hInstance, USERAPIHOOKPROC CallbackFunc); +#elif (WINVER == _WIN32_WINNT_WS03) +BOOL WINAPI RegisterUserApiHook(PUSERAPIHOOKINFO puah); +#endif -typedef DWORD (CALLBACK * USERAPIHOOKPROC)(UAPIHK State, ULONG_PTR Info); - -typedef LRESULT(CALLBACK *WNDPROC_OWP)(HWND,UINT,WPARAM,LPARAM,ULONG_PTR,PDWORD); - -typedef struct _UAHOWP -{ - BYTE* MsgBitArray; - DWORD Size; -} UAHOWP, *PUAHOWP; - -typedef struct tagUSERAPIHOOK -{ - DWORD size; - WNDPROC DefWindowProcA; - WNDPROC DefWindowProcW; - UAHOWP DefWndProcArray; - FARPROC GetScrollInfo; - FARPROC SetScrollInfo; - FARPROC EnableScrollBar; - FARPROC AdjustWindowRectEx; - FARPROC SetWindowRgn; - WNDPROC_OWP PreWndProc; - WNDPROC_OWP PostWndProc; - UAHOWP WndProcArray; - WNDPROC_OWP PreDefDlgProc; - WNDPROC_OWP PostDefDlgProc; - UAHOWP DlgProcArray; - FARPROC GetSystemMetrics; - FARPROC SystemParametersInfoA; - FARPROC SystemParametersInfoW; - FARPROC ForceResetUserApiHook; - FARPROC DrawFrameControl; - FARPROC DrawCaption; - FARPROC MDIRedrawFrame; - FARPROC GetRealWindowOwner; -} USERAPIHOOK, *PUSERAPIHOOK; - -BOOL WINAPI RegisterUserApiHook(PUSERAPIHOOKINFO puah); BOOL WINAPI UnregisterUserApiHook(VOID); #endif Added: trunk/reactos/include/reactos/uxundoc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/uxundoc.h?…
============================================================================== --- trunk/reactos/include/reactos/uxundoc.h (added) +++ trunk/reactos/include/reactos/uxundoc.h [iso-8859-1] Sun Sep 18 13:12:44 2011 @@ -1,0 +1,74 @@ +#pragma once + +typedef HANDLE HTHEMEFILE; + +/********************************************************************** + * ENUMTHEMEPROC + * + * Callback function for EnumThemes. + * + * RETURNS + * TRUE to continue enumeration, FALSE to stop + * + * PARAMS + * lpReserved Always 0 + * pszThemeFileName Full path to theme msstyles file + * pszThemeName Display name for theme + * pszToolTip Tooltip name for theme + * lpReserved2 Always 0 + * lpData Value passed through lpData from EnumThemes + */ +typedef BOOL (CALLBACK *ENUMTHEMEPROC)(LPVOID lpReserved, LPCWSTR pszThemeFileName, + LPCWSTR pszThemeName, LPCWSTR pszToolTip, LPVOID lpReserved2, + LPVOID lpData); + +/********************************************************************** + * PARSETHEMEINIFILEPROC + * + * Callback function for ParseThemeIniFile. + * + * RETURNS + * TRUE to continue enumeration, FALSE to stop + * + * PARAMS + * dwType Entry type + * pszParam1 Use defined by entry type + * pszParam2 Use defined by entry type + * pszParam3 Use defined by entry type + * dwParam Use defined by entry type + * lpData Value passed through lpData from ParseThemeIniFile + * + * NOTES + * I don't know what the valid entry types are + */ +typedef BOOL (CALLBACK* PARSETHEMEINIFILEPROC)(DWORD dwType, LPWSTR pszParam1, + LPWSTR pszParam2, LPWSTR pszParam3, + DWORD dwParam, LPVOID lpData); + +/* Structure filled in by EnumThemeColors() and EnumeThemeSizes() with the + * various strings for a theme color or size. */ +typedef struct tagTHEMENAMES +{ + WCHAR szName[MAX_PATH+1]; + WCHAR szDisplayName[MAX_PATH+1]; + WCHAR szTooltip[MAX_PATH+1]; +} THEMENAMES, *PTHEMENAMES; + +/* Declarations for undocumented functions for use internally */ +DWORD WINAPI QueryThemeServices(void); +HRESULT WINAPI OpenThemeFile(LPCWSTR pszThemeFileName, LPCWSTR pszColorName, + LPCWSTR pszSizeName, HTHEMEFILE *hThemeFile, + DWORD unknown); +HRESULT WINAPI CloseThemeFile(HTHEMEFILE hThemeFile); +HRESULT WINAPI ApplyTheme(HTHEMEFILE hThemeFile, char *unknown, HWND hWnd); +HRESULT WINAPI GetThemeDefaults(LPCWSTR pszThemeFileName, LPWSTR pszColorName, + DWORD dwColorNameLen, LPWSTR pszSizeName, + DWORD dwSizeNameLen); +HRESULT WINAPI EnumThemes(LPCWSTR pszThemePath, ENUMTHEMEPROC callback, + LPVOID lpData); +HRESULT WINAPI EnumThemeColors(LPWSTR pszThemeFileName, LPWSTR pszSizeName, + DWORD dwColorNum, PTHEMENAMES pszColorNames); +HRESULT WINAPI EnumThemeSizes(LPWSTR pszThemeFileName, LPWSTR pszColorName, + DWORD dwSizeNum, PTHEMENAMES pszColorNames); +HRESULT WINAPI ParseThemeIniFile(LPCWSTR pszIniFileName, LPWSTR pszUnknown, + PARSETHEMEINIFILEPROC callback, LPVOID lpData); Propchange: trunk/reactos/include/reactos/uxundoc.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/include/reactos/win32k/callback.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/cal…
============================================================================== --- trunk/reactos/include/reactos/win32k/callback.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/callback.h [iso-8859-1] Sun Sep 18 13:12:44 2011 @@ -9,7 +9,8 @@ #define USER32_CALLBACK_EVENTPROC (5) #define USER32_CALLBACK_LOADMENU (6) #define USER32_CALLBACK_CLIENTTHREADSTARTUP (7) -#define USER32_CALLBACK_MAXIMUM (7) +#define USER32_CALLBACK_CLIENTLOADLIBRARY (8) +#define USER32_CALLBACK_MAXIMUM (8) typedef struct _WINDOWPROC_CALLBACK_ARGUMENTS { @@ -76,6 +77,14 @@ WCHAR MenuName[1]; } LOADMENU_CALLBACK_ARGUMENTS, *PLOADMENU_CALLBACK_ARGUMENTS; +typedef struct _CLIENT_LOAD_LIBRARY_ARGUMENTS +{ + UNICODE_STRING strLibraryName; + UNICODE_STRING strInitFuncName; + BOOL Unload; + BOOL ApiHook; +} CLIENT_LOAD_LIBRARY_ARGUMENTS, *PCLIENT_LOAD_LIBRARY_ARGUMENTS; + NTSTATUS WINAPI User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength); NTSTATUS WINAPI @@ -92,5 +101,6 @@ User32CallLoadMenuFromKernel(PVOID Arguments, ULONG ArgumentLength); NTSTATUS WINAPI User32CallClientThreadSetupFromKernel(PVOID Arguments, ULONG ArgumentLength); - +NTSTATUS WINAPI +User32CallClientLoadLibraryFromKernel(PVOID Arguments, ULONG ArgumentLength); #endif /* __INCLUDE_USER32_CALLBACK_H */
13 years, 3 months
1
0
0
0
[tkreuzer] 53734: [HAL/NDK] - Make Vector parameter in HalEnableSystemInterrupt, HalDisableSystemInterrupt and HalBeginSystemInterrupt an ULONG, not an UCHAR [NDK] - 64bit fixes for HANDLE_TABLE, K...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Sep 18 13:11:45 2011 New Revision: 53734 URL:
http://svn.reactos.org/svn/reactos?rev=53734&view=rev
Log: [HAL/NDK] - Make Vector parameter in HalEnableSystemInterrupt, HalDisableSystemInterrupt and HalBeginSystemInterrupt an ULONG, not an UCHAR [NDK] - 64bit fixes for HANDLE_TABLE, KPROCESS, SECTION_IMAGE_INFORMATION, MMADDRESS_LIST, MMVAD_FLAGS, MMVAD, MMVAD_LONG, MMVAD_SHORT, MEMORY_DESCRIPTOR, MEMORY_ALLOCATION_DESCRIPTOR, LdrVerifyMappedImageMatchesChecksum - KDPC_DATA::DpcQueueDepth is signed on amd64, unsigned on x86 [NTOSKRNL] - Fix hundreds of MSVC and amd64 warnings - add a pragma message to FstubFixupEfiPartition, since it looks broken - Move portable Ke constants from <arch>/cpu.c to krnlinit.c - Fixed a bug in amd64 KiGeneralProtectionFaultHandler Modified: trunk/reactos/drivers/video/videoprt/interrupt.c trunk/reactos/hal/halarm/generic/pic.c trunk/reactos/hal/halx86/apic/apic.c trunk/reactos/hal/halx86/mp/mpsirql.c trunk/reactos/hal/halx86/up/pic.c trunk/reactos/include/asm/trapamd64.inc trunk/reactos/include/ndk/extypes.h trunk/reactos/include/ndk/halfuncs.h trunk/reactos/include/ndk/ketypes.h trunk/reactos/include/ndk/ldrfuncs.h trunk/reactos/include/ndk/mmtypes.h trunk/reactos/include/reactos/arc/arc.h trunk/reactos/include/reactos/drivers/ntddrdsk.h trunk/reactos/ntoskrnl/config/cmapi.c trunk/reactos/ntoskrnl/config/cmboot.c trunk/reactos/ntoskrnl/config/cminit.c trunk/reactos/ntoskrnl/config/cmkcbncb.c trunk/reactos/ntoskrnl/config/cmvalche.c trunk/reactos/ntoskrnl/config/cmwraprs.c trunk/reactos/ntoskrnl/config/i386/cmhardwr.c trunk/reactos/ntoskrnl/ex/callback.c trunk/reactos/ntoskrnl/ex/handle.c trunk/reactos/ntoskrnl/ex/init.c trunk/reactos/ntoskrnl/ex/lookas.c trunk/reactos/ntoskrnl/ex/profile.c trunk/reactos/ntoskrnl/ex/pushlock.c trunk/reactos/ntoskrnl/ex/sysinfo.c trunk/reactos/ntoskrnl/fsrtl/fastio.c trunk/reactos/ntoskrnl/fstub/disksup.c trunk/reactos/ntoskrnl/fstub/halstub.c trunk/reactos/ntoskrnl/include/internal/amd64/ke.h trunk/reactos/ntoskrnl/include/internal/amd64/mm.h trunk/reactos/ntoskrnl/include/internal/io.h trunk/reactos/ntoskrnl/include/internal/kd64.h trunk/reactos/ntoskrnl/include/internal/ke.h trunk/reactos/ntoskrnl/include/internal/mm.h trunk/reactos/ntoskrnl/include/internal/ob.h trunk/reactos/ntoskrnl/include/internal/rtl.h trunk/reactos/ntoskrnl/io/iomgr/arcname.c trunk/reactos/ntoskrnl/io/iomgr/bootlog.c trunk/reactos/ntoskrnl/io/iomgr/deviface.c trunk/reactos/ntoskrnl/io/iomgr/driver.c trunk/reactos/ntoskrnl/io/iomgr/error.c trunk/reactos/ntoskrnl/io/iomgr/file.c trunk/reactos/ntoskrnl/io/iomgr/iofunc.c trunk/reactos/ntoskrnl/io/iomgr/iomdl.c trunk/reactos/ntoskrnl/io/iomgr/irp.c trunk/reactos/ntoskrnl/io/iomgr/util.c trunk/reactos/ntoskrnl/io/pnpmgr/pnpinit.c trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c trunk/reactos/ntoskrnl/io/pnpmgr/pnputil.c trunk/reactos/ntoskrnl/kd64/kdapi.c trunk/reactos/ntoskrnl/kd64/kddata.c trunk/reactos/ntoskrnl/kd64/kdinit.c trunk/reactos/ntoskrnl/kd64/kdtrap.c trunk/reactos/ntoskrnl/ke/amd64/cpu.c trunk/reactos/ntoskrnl/ke/amd64/except.c trunk/reactos/ntoskrnl/ke/amd64/krnlinit.c trunk/reactos/ntoskrnl/ke/arm/cpu.c trunk/reactos/ntoskrnl/ke/bug.c trunk/reactos/ntoskrnl/ke/gate.c trunk/reactos/ntoskrnl/ke/i386/cpu.c trunk/reactos/ntoskrnl/ke/krnlinit.c trunk/reactos/ntoskrnl/ke/powerpc/cpu.c trunk/reactos/ntoskrnl/ke/procobj.c trunk/reactos/ntoskrnl/ke/profobj.c trunk/reactos/ntoskrnl/ke/thrdschd.c trunk/reactos/ntoskrnl/ke/wait.c trunk/reactos/ntoskrnl/lpc/send.c trunk/reactos/ntoskrnl/mm/ARM3/iosup.c trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c trunk/reactos/ntoskrnl/mm/ARM3/miarm.h trunk/reactos/ntoskrnl/mm/ARM3/mminit.c trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c trunk/reactos/ntoskrnl/mm/ARM3/ncache.c trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c trunk/reactos/ntoskrnl/mm/ARM3/pool.c trunk/reactos/ntoskrnl/mm/ARM3/procsup.c trunk/reactos/ntoskrnl/mm/ARM3/section.c trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c trunk/reactos/ntoskrnl/mm/ARM3/syspte.c trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c trunk/reactos/ntoskrnl/mm/ARM3/virtual.c trunk/reactos/ntoskrnl/mm/amd64/init.c trunk/reactos/ntoskrnl/mm/anonmem.c trunk/reactos/ntoskrnl/mm/balance.c trunk/reactos/ntoskrnl/mm/freelist.c trunk/reactos/ntoskrnl/mm/marea.c trunk/reactos/ntoskrnl/mm/pagefile.c trunk/reactos/ntoskrnl/mm/pageop.c trunk/reactos/ntoskrnl/mm/region.c trunk/reactos/ntoskrnl/mm/rmap.c trunk/reactos/ntoskrnl/ob/obref.c trunk/reactos/ntoskrnl/ob/obsecure.c trunk/reactos/ntoskrnl/po/power.c trunk/reactos/ntoskrnl/ps/kill.c trunk/reactos/ntoskrnl/ps/process.c trunk/reactos/ntoskrnl/ps/query.c trunk/reactos/ntoskrnl/ps/thread.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/drivers/video/videoprt/interrupt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/videoprt/int…
Modified: trunk/reactos/hal/halarm/generic/pic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halarm/generic/pic.c?r…
Modified: trunk/reactos/hal/halx86/apic/apic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/apic/apic.c?rev…
Modified: trunk/reactos/hal/halx86/mp/mpsirql.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/mp/mpsirql.c?re…
Modified: trunk/reactos/hal/halx86/up/pic.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/hal/halx86/up/pic.c?rev=53…
Modified: trunk/reactos/include/asm/trapamd64.inc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/asm/trapamd64.inc?…
Modified: trunk/reactos/include/ndk/extypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/extypes.h?rev=…
Modified: trunk/reactos/include/ndk/halfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/halfuncs.h?rev…
Modified: trunk/reactos/include/ndk/ketypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=…
Modified: trunk/reactos/include/ndk/ldrfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ldrfuncs.h?rev…
Modified: trunk/reactos/include/ndk/mmtypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/mmtypes.h?rev=…
Modified: trunk/reactos/include/reactos/arc/arc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/arc/arc.h?…
Modified: trunk/reactos/include/reactos/drivers/ntddrdsk.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/nt…
Modified: trunk/reactos/ntoskrnl/config/cmapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmapi.c?re…
Modified: trunk/reactos/ntoskrnl/config/cmboot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmboot.c?r…
Modified: trunk/reactos/ntoskrnl/config/cminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cminit.c?r…
Modified: trunk/reactos/ntoskrnl/config/cmkcbncb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmkcbncb.c…
Modified: trunk/reactos/ntoskrnl/config/cmvalche.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmvalche.c…
Modified: trunk/reactos/ntoskrnl/config/cmwraprs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmwraprs.c…
Modified: trunk/reactos/ntoskrnl/config/i386/cmhardwr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/i386/cmhar…
Modified: trunk/reactos/ntoskrnl/ex/callback.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/callback.c?rev…
Modified: trunk/reactos/ntoskrnl/ex/handle.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/handle.c?rev=5…
Modified: trunk/reactos/ntoskrnl/ex/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=537…
Modified: trunk/reactos/ntoskrnl/ex/lookas.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/lookas.c?rev=5…
Modified: trunk/reactos/ntoskrnl/ex/profile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/profile.c?rev=…
Modified: trunk/reactos/ntoskrnl/ex/pushlock.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/pushlock.c?rev…
Modified: trunk/reactos/ntoskrnl/ex/sysinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/sysinfo.c?rev=…
Modified: trunk/reactos/ntoskrnl/fsrtl/fastio.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fsrtl/fastio.c?re…
Modified: trunk/reactos/ntoskrnl/fstub/disksup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fstub/disksup.c?r…
Modified: trunk/reactos/ntoskrnl/fstub/halstub.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fstub/halstub.c?r…
Modified: trunk/reactos/ntoskrnl/include/internal/amd64/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
Modified: trunk/reactos/ntoskrnl/include/internal/amd64/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
Modified: trunk/reactos/ntoskrnl/include/internal/io.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
Modified: trunk/reactos/ntoskrnl/include/internal/kd64.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
Modified: trunk/reactos/ntoskrnl/include/internal/ke.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
Modified: trunk/reactos/ntoskrnl/include/internal/ob.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
Modified: trunk/reactos/ntoskrnl/include/internal/rtl.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
Modified: trunk/reactos/ntoskrnl/io/iomgr/arcname.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/arcname.…
Modified: trunk/reactos/ntoskrnl/io/iomgr/bootlog.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/bootlog.…
Modified: trunk/reactos/ntoskrnl/io/iomgr/deviface.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/deviface…
Modified: trunk/reactos/ntoskrnl/io/iomgr/driver.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/driver.c…
Modified: trunk/reactos/ntoskrnl/io/iomgr/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/error.c?…
Modified: trunk/reactos/ntoskrnl/io/iomgr/file.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/file.c?r…
Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iofunc.c…
Modified: trunk/reactos/ntoskrnl/io/iomgr/iomdl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iomdl.c?…
Modified: trunk/reactos/ntoskrnl/io/iomgr/irp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/irp.c?re…
Modified: trunk/reactos/ntoskrnl/io/iomgr/util.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/util.c?r…
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpinit…
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpres.…
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnproot…
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnputil.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnputil…
Modified: trunk/reactos/ntoskrnl/kd64/kdapi.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/kdapi.c?rev=…
Modified: trunk/reactos/ntoskrnl/kd64/kddata.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/kddata.c?rev…
Modified: trunk/reactos/ntoskrnl/kd64/kdinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/kdinit.c?rev…
Modified: trunk/reactos/ntoskrnl/kd64/kdtrap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/kdtrap.c?rev…
Modified: trunk/reactos/ntoskrnl/ke/amd64/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/amd64/cpu.c?re…
Modified: trunk/reactos/ntoskrnl/ke/amd64/except.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/amd64/except.c…
Modified: trunk/reactos/ntoskrnl/ke/amd64/krnlinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/amd64/krnlinit…
Modified: trunk/reactos/ntoskrnl/ke/arm/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/arm/cpu.c?rev=…
Modified: trunk/reactos/ntoskrnl/ke/bug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/bug.c?rev=5373…
Modified: trunk/reactos/ntoskrnl/ke/gate.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/gate.c?rev=537…
Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
Modified: trunk/reactos/ntoskrnl/ke/krnlinit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/krnlinit.c?rev…
Modified: trunk/reactos/ntoskrnl/ke/powerpc/cpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/powerpc/cpu.c?…
Modified: trunk/reactos/ntoskrnl/ke/procobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/procobj.c?rev=…
Modified: trunk/reactos/ntoskrnl/ke/profobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/profobj.c?rev=…
Modified: trunk/reactos/ntoskrnl/ke/thrdschd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/thrdschd.c?rev…
Modified: trunk/reactos/ntoskrnl/ke/wait.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/wait.c?rev=537…
Modified: trunk/reactos/ntoskrnl/lpc/send.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/lpc/send.c?rev=53…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/iosup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/iosup.c?r…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mdlsup.c?…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/miarm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/miarm.h?r…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mminit.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mminit.c?…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/mmsup.c?r…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/ncache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/ncache.c?…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pagfault.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pagfault.…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pfnlist.c…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/pool.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/pool.c?re…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/procsup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/procsup.c…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/section.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/section.c…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/sysldr.c?…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/syspte.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/syspte.c?…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/vadnode.c…
Modified: trunk/reactos/ntoskrnl/mm/ARM3/virtual.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/virtual.c…
Modified: trunk/reactos/ntoskrnl/mm/amd64/init.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/amd64/init.c?r…
Modified: trunk/reactos/ntoskrnl/mm/anonmem.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/anonmem.c?rev=…
Modified: trunk/reactos/ntoskrnl/mm/balance.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/balance.c?rev=…
Modified: trunk/reactos/ntoskrnl/mm/freelist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/freelist.c?rev…
Modified: trunk/reactos/ntoskrnl/mm/marea.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/marea.c?rev=53…
Modified: trunk/reactos/ntoskrnl/mm/pagefile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/pagefile.c?rev…
Modified: trunk/reactos/ntoskrnl/mm/pageop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/pageop.c?rev=5…
Modified: trunk/reactos/ntoskrnl/mm/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/region.c?rev=5…
Modified: trunk/reactos/ntoskrnl/mm/rmap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/rmap.c?rev=537…
Modified: trunk/reactos/ntoskrnl/ob/obref.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obref.c?rev=53…
Modified: trunk/reactos/ntoskrnl/ob/obsecure.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obsecure.c?rev…
Modified: trunk/reactos/ntoskrnl/po/power.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/power.c?rev=53…
Modified: trunk/reactos/ntoskrnl/ps/kill.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/kill.c?rev=537…
Modified: trunk/reactos/ntoskrnl/ps/process.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/process.c?rev=…
Modified: trunk/reactos/ntoskrnl/ps/query.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/query.c?rev=53…
Modified: trunk/reactos/ntoskrnl/ps/thread.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ps/thread.c?rev=5…
13 years, 3 months
1
0
0
0
[tkreuzer] 53733: [NTOSKRNL] - replace some AlignUp with ALIGN_UP_BY - Fix several MSVC / amd64 warnings
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Sep 18 12:51:40 2011 New Revision: 53733 URL:
http://svn.reactos.org/svn/reactos?rev=53733&view=rev
Log: [NTOSKRNL] - replace some AlignUp with ALIGN_UP_BY - Fix several MSVC / amd64 warnings Modified: trunk/reactos/ntoskrnl/mm/section.c Modified: trunk/reactos/ntoskrnl/mm/section.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/section.c?rev=…
============================================================================== --- trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/mm/section.c [iso-8859-1] Sun Sep 18 12:51:40 2011 @@ -161,9 +161,9 @@ #define SHARE_COUNT_FROM_SSE(E) (((E) & 0x00000FFE) >> 1) #define IS_SWAP_FROM_SSE(E) ((E) & 0x00000001) #define MAX_SHARE_COUNT 0x7FF -#define MAKE_SSE(P, C) ((P) | ((C) << 1)) +#define MAKE_SSE(P, C) ((ULONG)(P) | ((C) << 1)) #define SWAPENTRY_FROM_SSE(E) ((E) >> 1) -#define MAKE_SWAP_SSE(S) (((S) << 1) | 0x1) +#define MAKE_SWAP_SSE(S) (((ULONG)(S) << 1) | 0x1) static const INFORMATION_CLASS_INFO ExSectionInfoClass[] = { @@ -203,7 +203,7 @@ PMM_SECTION_SEGMENT pssSegments; LARGE_INTEGER lnOffset; PVOID pBuffer; - ULONG nPrevVirtualEndOfSegment = 0; + SIZE_T nPrevVirtualEndOfSegment = 0; ULONG nFileSizeOfHeaders = 0; ULONG i; @@ -429,7 +429,7 @@ if(pioh64OptHeader->SizeOfStackReserve > MAXULONG_PTR) DIE(("SizeOfStackReserve exceeds the address space\n")); - ImageSectionObject->StackReserve = pioh64OptHeader->SizeOfStackReserve; + ImageSectionObject->StackReserve = (ULONG_PTR)pioh64OptHeader->SizeOfStackReserve; } if(RTL_CONTAINS_FIELD(pioh64OptHeader, cbOptHeaderSize, SizeOfStackCommit)) @@ -437,7 +437,7 @@ if(pioh64OptHeader->SizeOfStackCommit > MAXULONG_PTR) DIE(("SizeOfStackCommit exceeds the address space\n")); - ImageSectionObject->StackCommit = pioh64OptHeader->SizeOfStackCommit; + ImageSectionObject->StackCommit = (ULONG_PTR)pioh64OptHeader->SizeOfStackCommit; } break; @@ -582,7 +582,7 @@ ImageSectionObject->Segments = AllocateSegmentsCb(ImageSectionObject->NrSegments); if(ImageSectionObject->Segments == NULL) - DIE(("AllocateSegments failed\n")); + DIE(("AllocateSegments failed\n")); /* initialize the headers segment */ pssSegments = ImageSectionObject->Segments; @@ -590,10 +590,11 @@ // ASSERT(IsAligned(cbHeadersSize, nFileAlignment)); if(!AlignUp(&nFileSizeOfHeaders, cbHeadersSize, nFileAlignment)) - DIE(("Cannot align the size of the section headers\n")); - - if(!AlignUp(&nPrevVirtualEndOfSegment, cbHeadersSize, nSectionAlignment)) - DIE(("Cannot align the size of the section headers\n")); + DIE(("Cannot align the size of the section headers\n")); + + nPrevVirtualEndOfSegment = ALIGN_UP_BY(cbHeadersSize, nSectionAlignment); + if (nPrevVirtualEndOfSegment < cbHeadersSize) + DIE(("Cannot align the size of the section headers\n")); pssSegments[0].FileOffset = 0; pssSegments[0].Protection = PAGE_READONLY; @@ -672,10 +673,9 @@ else pssSegments[i].Length = pishSectionHeaders[i].Misc.VirtualSize; - if(!AlignUp(&pssSegments[i].Length, pssSegments[i].Length, nSectionAlignment)) + pssSegments[i].Length = ALIGN_UP_BY(pssSegments[i].Length, nSectionAlignment); + if (pssSegments[i].Length < pssSegments[i].Length) DIE(("Cannot align the virtual size of section %u\n", i)); - - ASSERT(IsAligned(pssSegments[i].Length, nSectionAlignment)); if(pssSegments[i].Length == 0) DIE(("Virtual size of section %u is null\n", i)); @@ -684,8 +684,9 @@ pssSegments[i].Characteristics = pishSectionHeaders[i].Characteristics; /* ensure the memory image is no larger than 4GB */ - if(!Intsafe_AddULong32(&nPrevVirtualEndOfSegment, pssSegments[i].VirtualAddress, pssSegments[i].Length)) - DIE(("The image is larger than 4GB\n")); + nPrevVirtualEndOfSegment = pssSegments[i].VirtualAddress + pssSegments[i].Length; + if (nPrevVirtualEndOfSegment < pssSegments[i].VirtualAddress) + DIE(("The image is too large\n")); } if(nSectionAlignment >= PAGE_SIZE) @@ -830,12 +831,12 @@ VOID NTAPI MmSetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, - ULONG Offset, - ULONG Entry) + ULONG_PTR Offset, + ULONG_PTR Entry) { PSECTION_PAGE_TABLE Table; - ULONG DirectoryOffset; - ULONG TableOffset; + ULONG_PTR DirectoryOffset; + ULONG_PTR TableOffset; if (Segment->Length <= NR_SECTION_PAGE_TABLES * PAGE_SIZE) { @@ -860,19 +861,19 @@ } } TableOffset = PAGE_TO_SECTION_PAGE_TABLE_OFFSET(Offset); - Table->Entry[TableOffset] = Entry; + Table->Entry[TableOffset] = (ULONG)Entry; } ULONG NTAPI MmGetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, - ULONG Offset) + ULONG_PTR Offset) { PSECTION_PAGE_TABLE Table; ULONG Entry; - ULONG DirectoryOffset; - ULONG TableOffset; + ULONG_PTR DirectoryOffset; + ULONG_PTR TableOffset; DPRINT("MmGetPageEntrySection(Segment %x, Offset %x)\n", Segment, Offset); @@ -898,7 +899,7 @@ VOID NTAPI MmSharePageEntrySectionSegment(PMM_SECTION_SEGMENT Segment, - ULONG Offset) + ULONG_PTR Offset) { ULONG Entry; @@ -1083,7 +1084,7 @@ PEPROCESS Process; KIRQL Irql; PVOID TempAddress; - + Process = PsGetCurrentProcess(); TempAddress = MiMapPageInHyperSpace(Process, DestPage, &Irql); if (TempAddress == NULL) @@ -1099,7 +1100,7 @@ NTSTATUS NTAPI MiReadPage(PMEMORY_AREA MemoryArea, - ULONG SegOffset, + ULONG_PTR SegOffset, PPFN_NUMBER Page) /* * FUNCTION: Read a page for a section backed memory area. @@ -1110,16 +1111,16 @@ */ { ULONG BaseOffset; - ULONG FileOffset; + ULONG_PTR FileOffset; PVOID BaseAddress; BOOLEAN UptoDate; PCACHE_SEGMENT CacheSeg; PFILE_OBJECT FileObject; NTSTATUS Status; - ULONG RawLength; + ULONG_PTR RawLength; PBCB Bcb; BOOLEAN IsImageSection; - ULONG Length; + ULONG_PTR Length; FileObject = MemoryArea->Data.SectionData.Section->FileObject; Bcb = FileObject->SectionObjectPointer->SharedCacheMap; @@ -1147,7 +1148,7 @@ * alignment less than the file system block size. */ Status = CcRosGetCacheSegment(Bcb, - FileOffset, + (ULONG)FileOffset, &BaseOffset, &BaseAddress, &UptoDate, @@ -1182,7 +1183,7 @@ PEPROCESS Process; KIRQL Irql; PVOID PageAddr; - ULONG CacheSegOffset; + ULONG_PTR CacheSegOffset; /* * Allocate a page, this is rather complicated by the possibility @@ -1196,7 +1197,7 @@ return(Status); } Status = CcRosGetCacheSegment(Bcb, - FileOffset, + (ULONG)FileOffset, &BaseOffset, &BaseAddress, &UptoDate, @@ -1237,7 +1238,7 @@ MiUnmapPageInHyperSpace(Process, PageAddr, Irql); CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, FALSE, FALSE); Status = CcRosGetCacheSegment(Bcb, - FileOffset + CacheSegOffset, + (ULONG)(FileOffset + CacheSegOffset), &BaseOffset, &BaseAddress, &UptoDate, @@ -1289,9 +1290,9 @@ */ { MM_REQUIRED_RESOURCES Resources = { }; - + Resources.Context = MemoryArea->Data.SectionData.Section->FileObject; - Resources.FileOffset.QuadPart = SegOffset + + Resources.FileOffset.QuadPart = SegOffset + MemoryArea->Data.SectionData.Segment->FileOffset; Resources.Consumer = MC_USER; Resources.Amount = PAGE_SIZE; @@ -1317,14 +1318,14 @@ PVOID PAddress; PROS_SECTION_OBJECT Section; PMM_SECTION_SEGMENT Segment; - ULONG Entry; - ULONG Entry1; + ULONG_PTR Entry; + ULONG_PTR Entry1; ULONG Attributes; PMM_PAGEOP PageOp; PMM_REGION Region; BOOLEAN HasSwapEntry; PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace); - + /* * There is a window between taking the page fault and locking the * address space when another thread could load the page so we check @@ -1336,8 +1337,8 @@ } PAddress = MM_ROUND_DOWN(Address, PAGE_SIZE); - Offset = (ULONG_PTR)PAddress - (ULONG_PTR)MemoryArea->StartingAddress - + MemoryArea->Data.SectionData.ViewOffset; + Offset = (ULONG)((ULONG_PTR)PAddress - (ULONG_PTR)MemoryArea->StartingAddress + + MemoryArea->Data.SectionData.ViewOffset); Segment = MemoryArea->Data.SectionData.Segment; Section = MemoryArea->Data.SectionData.Section; @@ -1835,8 +1836,8 @@ * Find the offset of the page */ PAddress = MM_ROUND_DOWN(Address, PAGE_SIZE); - Offset = (ULONG_PTR)PAddress - (ULONG_PTR)MemoryArea->StartingAddress - + MemoryArea->Data.SectionData.ViewOffset; + Offset = (ULONG)((ULONG_PTR)PAddress - (ULONG_PTR)MemoryArea->StartingAddress + + MemoryArea->Data.SectionData.ViewOffset); Segment = MemoryArea->Data.SectionData.Segment; Section = MemoryArea->Data.SectionData.Section; @@ -2041,7 +2042,7 @@ BOOLEAN IsImageSection; PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace); KIRQL OldIrql; - + Address = (PVOID)PAGE_ROUND_DOWN(Address); /* @@ -2050,8 +2051,8 @@ Context.Segment = MemoryArea->Data.SectionData.Segment; Context.Section = MemoryArea->Data.SectionData.Section; - Context.Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress - + MemoryArea->Data.SectionData.ViewOffset; + Context.Offset = (ULONG)((ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress + + MemoryArea->Data.SectionData.ViewOffset); FileOffset = Context.Offset + Context.Segment->FileOffset; IsImageSection = Context.Section->AllocationAttributes & SEC_IMAGE ? TRUE : FALSE; @@ -2392,7 +2393,7 @@ PVOID Address, PMM_PAGEOP PageOp) { - ULONG Offset; + ULONG_PTR Offset; PROS_SECTION_OBJECT Section; PMM_SECTION_SEGMENT Segment; PFN_NUMBER Page; @@ -2489,7 +2490,7 @@ { ASSERT(SwapEntry == 0); #ifndef NEWCC - CcRosMarkDirtyCacheSegment(Bcb, Offset + Segment->FileOffset); + CcRosMarkDirtyCacheSegment(Bcb, (ULONG)Offset + Segment->FileOffset); #endif PageOp->Status = STATUS_SUCCESS; MmspCompleteAndReleasePageOp(PageOp); @@ -2538,7 +2539,7 @@ static VOID MmAlterViewAttributes(PMMSUPPORT AddressSpace, PVOID BaseAddress, - ULONG RegionSize, + SIZE_T RegionSize, ULONG OldType, ULONG OldProtect, ULONG NewType, @@ -2572,7 +2573,7 @@ */ if (DoCOW && MmIsPagePresent(Process, Address)) { - ULONG Offset; + ULONG_PTR Offset; ULONG Entry; PFN_NUMBER Page; @@ -2604,7 +2605,7 @@ MmProtectSectionView(PMMSUPPORT AddressSpace, PMEMORY_AREA MemoryArea, PVOID BaseAddress, - ULONG Length, + SIZE_T Length, ULONG Protect, PULONG OldProtect) { @@ -2614,7 +2615,7 @@ MaxLength = (ULONG_PTR)MemoryArea->EndingAddress - (ULONG_PTR)BaseAddress; if (Length > MaxLength) - Length = MaxLength; + Length = (ULONG)MaxLength; Region = MmFindRegion(MemoryArea->StartingAddress, &MemoryArea->Data.SectionData.RegionListHead, @@ -2682,7 +2683,7 @@ ULONG Length; ULONG Offset; ULONG Entry; - ULONG SavedSwapEntry; + SWAPENTRY SavedSwapEntry; PFN_NUMBER Page; Page = 0; @@ -2870,7 +2871,7 @@ ObjectTypeInitializer.CloseProcedure = MmpCloseSection; ObjectTypeInitializer.ValidAccessMask = SECTION_ALL_ACCESS; ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &MmSectionObjectType); - + MmCreatePhysicalMemorySection(); return(STATUS_SUCCESS); @@ -3337,7 +3338,7 @@ if(NT_SUCCESS(Status)) { - UsedSize = Iosb.Information; + UsedSize = (ULONG)Iosb.Information; } } #endif @@ -3549,13 +3550,13 @@ EffectiveSegment->VirtualAddress = PAGE_ROUND_DOWN(VirtualAddress); /* Round up the virtual size to the nearest page */ - EffectiveSegment->Length = PAGE_ROUND_UP(VirtualAddress + EffectiveSegment->Length) - - EffectiveSegment->VirtualAddress; + EffectiveSegment->Length = (ULONG)(PAGE_ROUND_UP(VirtualAddress + EffectiveSegment->Length) - + EffectiveSegment->VirtualAddress); /* Adjust the raw address and size */ VirtualOffset = VirtualAddress - EffectiveSegment->VirtualAddress; - if (EffectiveSegment->FileOffset < VirtualOffset) + if (EffectiveSegment->FileOffset < (LONG_PTR)VirtualOffset) { return FALSE; } @@ -3565,8 +3566,8 @@ * offset point in curious and odd places, but that's what we were * asked for */ - EffectiveSegment->FileOffset -= VirtualOffset; - EffectiveSegment->RawLength += VirtualOffset; + EffectiveSegment->FileOffset -= (ULONG)VirtualOffset; + EffectiveSegment->RawLength += (ULONG)VirtualOffset; } else { @@ -3650,8 +3651,8 @@ */ ASSERT(PAGE_ROUND_UP(Segment->VirtualAddress + Segment->Length) >= EndOfEffectiveSegment); - EffectiveSegment->Length = PAGE_ROUND_UP(Segment->VirtualAddress + Segment->Length) - - EffectiveSegment->VirtualAddress; + EffectiveSegment->Length = (ULONG)(PAGE_ROUND_UP(Segment->VirtualAddress + Segment->Length) - + EffectiveSegment->VirtualAddress); /* * Merge the protection @@ -4095,8 +4096,8 @@ Address = (PVOID)PAGE_ROUND_DOWN(Address); - Offset = ((ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress) + - MemoryArea->Data.SectionData.ViewOffset; + Offset = (ULONG)(((ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress) + + MemoryArea->Data.SectionData.ViewOffset); Section = MemoryArea->Data.SectionData.Section; Segment = MemoryArea->Data.SectionData.Segment; @@ -4281,7 +4282,7 @@ Offset -= PAGE_SIZE; PageOp = MmCheckForPageOp(MemoryArea, NULL, NULL, MemoryArea->Data.SectionData.Segment, - Offset + MemoryArea->Data.SectionData.ViewOffset); + (ULONG)Offset + MemoryArea->Data.SectionData.ViewOffset); if (PageOp) { MmUnlockAddressSpace(AddressSpace); @@ -4399,7 +4400,7 @@ ExSectionInfoClass, sizeof(ExSectionInfoClass) / sizeof(ExSectionInfoClass[0]), SectionInformation, - SectionInformationLength, + (ULONG)SectionInformationLength, NULL, ResultLength, PreviousMode); @@ -4497,7 +4498,7 @@ return(Status); } - + /********************************************************************** * NAME EXPORTED * MmMapViewOfSection @@ -4578,7 +4579,7 @@ AllocationType, Protect); } - + ASSERT(Process); if (!Protect || Protect & ~PAGE_FLAGS_VALID_FOR_SECTION) @@ -4599,7 +4600,7 @@ ULONG i; ULONG NrSegments; ULONG_PTR ImageBase; - ULONG ImageSize; + SIZE_T ImageSize; PMM_IMAGE_SECTION_OBJECT ImageSectionObject; PMM_SECTION_SEGMENT SectionSegments; @@ -4623,7 +4624,7 @@ ImageSize = max(ImageSize, MaxExtent); } - ImageSectionObject->ImageSize = ImageSize; + ImageSectionObject->ImageSize = (ULONG)ImageSize; /* Check there is enough space to map the section at that point. */ if (MmLocateMemoryAreaByRegion(AddressSpace, (PVOID)ImageBase, @@ -4790,7 +4791,7 @@ else { /* Something must gone wrong - * how can we have a Section but no + * how can we have a Section but no * reference? */ DPRINT("ERROR: DataSectionObject without reference!\n"); } @@ -4841,7 +4842,7 @@ PMMSUPPORT AddressSpace; NTSTATUS Status; PAGED_CODE(); - + if ((ULONG_PTR)SectionObject & 1) { extern PVOID MmSession; @@ -4972,7 +4973,7 @@ { ULONG Protection; PROS_SECTION_OBJECT *SectionObject = (PROS_SECTION_OBJECT *)Section; - + /* Check if an ARM3 section is being created instead */ if (AllocationAttributes & 1) {
13 years, 3 months
1
0
0
0
[gadamopoulos] 53732: [win32k] - Fix several issues detected by static code analysis
by gadamopoulos@svn.reactos.org
Author: gadamopoulos Date: Sun Sep 18 12:33:38 2011 New Revision: 53732 URL:
http://svn.reactos.org/svn/reactos?rev=53732&view=rev
Log: [win32k] - Fix several issues detected by static code analysis Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c trunk/reactos/subsystems/win32/win32k/ntuser/window.c trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Sun Sep 18 12:33:38 2011 @@ -334,6 +334,11 @@ return STATUS_SUCCESS; } PackedData = ExAllocatePoolWithTag(NonPagedPool, size, TAG_MSG); + if (PackedData == NULL) + { + ERR("Not enough memory to pack lParam\n"); + return STATUS_NO_MEMORY; + } RtlCopyMemory(PackedData, (PVOID)lParam, MsgMemorySize(MsgMemoryEntry, wParam, lParam)); *lParamPacked = (LPARAM)PackedData; } @@ -375,6 +380,7 @@ { PMSGMEMORY MsgMemoryEntry; MsgMemoryEntry = FindMsgMemory(Msg); + ASSERT(MsgMemoryEntry); if (MsgMemoryEntry->Size < 0) { /* Keep previous behavior */ @@ -587,7 +593,7 @@ CWPR.message = Msg; CWPR.wParam = wParam; CWPR.lParam = lParam; - CWPR.lResult = *uResult; + CWPR.lResult = uResult ? (*uResult) : 0; co_HOOK_CallHooks( WH_CALLWNDPROCRET, HC_ACTION, SameThread, (LPARAM)&CWPR ); } @@ -608,7 +614,7 @@ pti = PsGetCurrentThreadWin32Thread(); - if ( Window->head.pti != pti) + if ( Window && Window->head.pti != pti) { EngSetLastError( ERROR_MESSAGE_SYNC_ONLY ); return 0; @@ -2050,7 +2056,7 @@ { case FNID_DEFWINDOWPROC: /* Validate input */ - if (hWnd && (hWnd != INVALID_HANDLE_VALUE)) + if (hWnd) { Window = UserGetWindowObject(hWnd); if (!Window) @@ -2058,11 +2064,12 @@ UserLeave(); return FALSE; } - } - UserRefObjectCo(Window, &Ref); + UserRefObjectCo(Window, &Ref); + } lResult = IntDefWindowProc(Window, Msg, wParam, lParam, Ansi); Ret = TRUE; - UserDerefObjectCo(Window); + if (hWnd) + UserDerefObjectCo(Window); break; case FNID_SENDNOTIFYMESSAGE: Ret = UserSendNotifyMessage(hWnd, Msg, wParam, lParam); Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Sun Sep 18 12:33:38 2011 @@ -1591,7 +1591,7 @@ Dialog boxes and message boxes do not inherit layout, so you must set the layout explicitly. */ - if ( Class && Class->fnid != FNID_DIALOG) + if ( Class->fnid != FNID_DIALOG) { PPROCESSINFO ppi = PsGetCurrentProcessWin32Process(); if (ppi->dwLayout & LAYOUT_RTL) @@ -2170,6 +2170,9 @@ if (Window->ExStyle & WS_EX_MDICHILD) { + ASSERT(ParentWindow); + if(!ParentWindow) + goto cleanup; co_IntSendMessage(UserHMGetHandle(ParentWindow), WM_MDIREFRESHMENU, 0, 0); /* ShowWindow won't activate child windows */ co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE); @@ -2291,19 +2294,18 @@ lstrWindowName.Buffer = NULL; lstrClassName.Buffer = NULL; - /* Check if we got a Window name */ - if (plstrWindowName) + ASSERT(plstrWindowName); + + /* Copy the window name to kernel mode */ + Status = ProbeAndCaptureLargeString(&lstrWindowName, plstrWindowName); + if (!NT_SUCCESS(Status)) { - /* Copy the string to kernel mode */ - Status = ProbeAndCaptureLargeString(&lstrWindowName, plstrWindowName); - if (!NT_SUCCESS(Status)) - { - ERR("NtUserCreateWindowEx: failed to capture plstrWindowName\n"); - SetLastNtError(Status); - return NULL; - } - plstrWindowName = &lstrWindowName; + ERR("NtUserCreateWindowEx: failed to capture plstrWindowName\n"); + SetLastNtError(Status); + return NULL; } + + plstrWindowName = &lstrWindowName; /* Check if the class is an atom */ if (IS_ATOM(plstrClassName)) Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/winpos.c [iso-8859-1] Sun Sep 18 12:33:38 2011 @@ -161,6 +161,12 @@ HWND *List = IntWinListChildren(parent); ASSERT_REFS_CO(parent); + + /* Check if we found any children */ + if(List == NULL) + { + return 0; + } IntGetClientRect( parent, &rectParent ); x = rectParent.left; @@ -693,15 +699,14 @@ */ static HWND FASTCALL -WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter) +WinPosDoOwnedPopups(PWND Window, HWND hWndInsertAfter) { HWND *List = NULL; HWND Owner; LONG Style; - PWND Window ,DesktopWindow, ChildObject; + PWND DesktopWindow, ChildObject; int i; - Window = UserGetWindowObject(hWnd); Owner = Window->spwndOwner ? Window->spwndOwner->head.h : NULL; Style = Window->style; @@ -732,7 +737,7 @@ } } } - if (List[i] != hWnd) + if (List[i] != Window->head.h) hWndLocalPrev = List[i]; if (hWndLocalPrev == hWndInsertAfter) break; @@ -757,7 +762,7 @@ { PWND Wnd; - if (List[i] == hWnd) + if (List[i] == Window->head.h) break; if (!(Wnd = UserGetWindowObject(List[i]))) @@ -896,11 +901,15 @@ && HWND_NOTOPMOST != WinPos->hwndInsertAfter && HWND_BOTTOM != WinPos->hwndInsertAfter) { - PWND InsAfterWnd, Parent = Wnd->spwndParent; + PWND InsAfterWnd; InsAfterWnd = UserGetWindowObject(WinPos->hwndInsertAfter); - - if (InsAfterWnd && UserGetAncestor(InsAfterWnd, GA_PARENT) != Parent) + if(!InsAfterWnd) + { + return TRUE; + } + + if (InsAfterWnd->spwndParent != Wnd->spwndParent) { return FALSE; } @@ -995,7 +1004,7 @@ SWP_NOZORDER && Ancestor && Ancestor->head.h == IntGetDesktopWindow() ) { - WinPos.hwndInsertAfter = WinPosDoOwnedPopups(WinPos.hwnd, WinPos.hwndInsertAfter); + WinPos.hwndInsertAfter = WinPosDoOwnedPopups(Window, WinPos.hwndInsertAfter); } if (!(WinPos.flags & SWP_NOREDRAW)) @@ -1604,9 +1613,8 @@ return pwndChild; } } + ExFreePool(List); } - - ExFreePool(List); } *HitTest = co_IntSendMessage(ScopeWin->head.h, WM_NCHITTEST, 0, @@ -1756,17 +1764,28 @@ for (i = 0, winpos = pDWP->acvr; res && i < pDWP->ccvr; i++, winpos++) { + PWND pwnd; + USER_REFERENCE_ENTRY Ref; + TRACE("hwnd %p, after %p, %d,%d (%dx%d), flags %08x\n", winpos->pos.hwnd, winpos->pos.hwndInsertAfter, winpos->pos.x, winpos->pos.y, winpos->pos.cx, winpos->pos.cy, winpos->pos.flags); - - res = co_WinPosSetWindowPos( UserGetWindowObject(winpos->pos.hwnd), + + pwnd = UserGetWindowObject(winpos->pos.hwnd); + if(!pwnd) + continue; + + UserRefObjectCo(pwnd, &Ref); + + res = co_WinPosSetWindowPos( pwnd, winpos->pos.hwndInsertAfter, winpos->pos.x, winpos->pos.y, winpos->pos.cx, winpos->pos.cy, winpos->pos.flags); + + UserDerefObjectCo(pwnd); } ExFreePoolWithTag(pDWP->acvr, USERTAG_SWP); UserDereferenceObject(pDWP);
13 years, 3 months
1
0
0
0
[pschweitzer] 53731: [CABMAN] Leak less resources
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Sun Sep 18 11:00:12 2011 New Revision: 53731 URL:
http://svn.reactos.org/svn/reactos?rev=53731&view=rev
Log: [CABMAN] Leak less resources Modified: trunk/reactos/tools/cabman/cabinet.cxx Modified: trunk/reactos/tools/cabman/cabinet.cxx URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/cabman/cabinet.cxx?r…
============================================================================== --- trunk/reactos/tools/cabman/cabinet.cxx [iso-8859-1] (original) +++ trunk/reactos/tools/cabman/cabinet.cxx [iso-8859-1] Sun Sep 18 11:00:12 2011 @@ -1155,12 +1155,14 @@ if (Offset == INVALID_SET_FILE_POINTER) { DPRINT(MIN_TRACE, ("SetFilePointer() failed, error code is %u.\n", (UINT)GetLastError())); + CloseFile(DestFile); return CAB_STATUS_INVALID_CAB; } #else if (fseek(FileHandle, (off_t)File->DataBlock->AbsoluteOffset, SEEK_SET) != 0) { DPRINT(MIN_TRACE, ("fseek() failed.\n")); + CloseFile(DestFile); return CAB_STATUS_FAILURE; } Offset = ftell(FileHandle); @@ -2039,6 +2041,7 @@ { DPRINT(MIN_TRACE, ("Insufficient memory.\n")); FreeMemory(NewFileName); + CloseFile(SrcFile); return CAB_STATUS_NOMEMORY; } @@ -2051,6 +2054,7 @@ { DPRINT(MIN_TRACE, ("Cannot read from file.\n")); FreeMemory(NewFileName); + CloseFile(SrcFile); return CAB_STATUS_CANNOT_READ; } @@ -2058,6 +2062,7 @@ { DPRINT(MIN_TRACE, ("Cannot read file times.\n")); FreeMemory(NewFileName); + CloseFile(SrcFile); return CAB_STATUS_CANNOT_READ; } @@ -2065,6 +2070,7 @@ { DPRINT(MIN_TRACE, ("Cannot read file attributes.\n")); FreeMemory(NewFileName); + CloseFile(SrcFile); return CAB_STATUS_CANNOT_READ; }
13 years, 3 months
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
40
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Results per page:
10
25
50
100
200