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
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
August 2014
----- 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
16 participants
226 discussions
Start a n
N
ew thread
[hbelusca] 64017: [BOOTVID] - Synchronize correctly arm/bootdata.c with i386, as it was done previously. - Code formatting: whitespace fixes, add braces/brackets and spaces where needed; comments s...
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Aug 31 23:00:29 2014 New Revision: 64017 URL:
http://svn.reactos.org/svn/reactos?rev=64017&view=rev
Log: [BOOTVID] - Synchronize correctly arm/bootdata.c with i386, as it was done previously. - Code formatting: whitespace fixes, add braces/brackets and spaces where needed; comments styling. - Correctly put braces for casts and around macro parameters. - Add some IN/OUT. - Fix parameter names of a function. [INBV] - Fix parameter names of two functions. Modified: trunk/reactos/drivers/base/bootvid/arm/bootdata.c trunk/reactos/drivers/base/bootvid/arm/bootvid.c trunk/reactos/drivers/base/bootvid/i386/bootvid.c trunk/reactos/drivers/base/bootvid/i386/vga.c trunk/reactos/drivers/base/bootvid/precomp.h trunk/reactos/include/ndk/inbvfuncs.h trunk/reactos/include/reactos/drivers/bootvid/bootvid.h trunk/reactos/ntoskrnl/inbv/inbv.c Modified: trunk/reactos/drivers/base/bootvid/arm/bootdata.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/bootvid/arm/b…
============================================================================== --- trunk/reactos/drivers/base/bootvid/arm/bootdata.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/bootvid/arm/bootdata.c [iso-8859-1] Sun Aug 31 23:00:29 2014 @@ -48,7 +48,10 @@ 0x0 // End of command stream }; -UCHAR FontData[256 * 13] = +// +// The character generator is in natural order, top of char is first element. +// +UCHAR FontData[256 * BOOTCHAR_HEIGHT] = { 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 0 0x00, 0x00, 0x3C, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x3C, 0x00, 0x00, 0x00, // 13 Modified: trunk/reactos/drivers/base/bootvid/arm/bootvid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/bootvid/arm/b…
============================================================================== --- trunk/reactos/drivers/base/bootvid/arm/bootvid.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/bootvid/arm/bootvid.c [iso-8859-1] Sun Aug 31 23:00:29 2014 @@ -3,19 +3,19 @@ #define NDEBUG #include <debug.h> -#define LCDTIMING0_PPL(x) ((((x) / 16 - 1) & 0x3f) << 2) -#define LCDTIMING1_LPP(x) (((x) & 0x3ff) - 1) -#define LCDCONTROL_LCDPWR (1 << 11) -#define LCDCONTROL_LCDEN (1) -#define LCDCONTROL_LCDBPP(x) (((x) & 7) << 1) -#define LCDCONTROL_LCDTFT (1 << 5) - -#define PL110_LCDTIMING0 (PVOID)0xE0020000 -#define PL110_LCDTIMING1 (PVOID)0xE0020004 -#define PL110_LCDTIMING2 (PVOID)0xE0020008 -#define PL110_LCDUPBASE (PVOID)0xE0020010 -#define PL110_LCDLPBASE (PVOID)0xE0020014 -#define PL110_LCDCONTROL (PVOID)0xE0020018 +#define LCDTIMING0_PPL(x) ((((x) / 16 - 1) & 0x3f) << 2) +#define LCDTIMING1_LPP(x) (((x) & 0x3ff) - 1) +#define LCDCONTROL_LCDPWR (1 << 11) +#define LCDCONTROL_LCDEN (1) +#define LCDCONTROL_LCDBPP(x) (((x) & 7) << 1) +#define LCDCONTROL_LCDTFT (1 << 5) + +#define PL110_LCDTIMING0 (PVOID)0xE0020000 +#define PL110_LCDTIMING1 (PVOID)0xE0020004 +#define PL110_LCDTIMING2 (PVOID)0xE0020008 +#define PL110_LCDUPBASE (PVOID)0xE0020010 +#define PL110_LCDLPBASE (PVOID)0xE0020014 +#define PL110_LCDCONTROL (PVOID)0xE0020018 #define READ_REGISTER_ULONG(r) (*(volatile ULONG * const)(r)) #define WRITE_REGISTER_ULONG(r, v) (*(volatile ULONG *)(r) = (v)) @@ -71,14 +71,14 @@ VidpBuildColor(IN UCHAR Color) { UCHAR Red, Green, Blue; - + // // Extract color components // Red = VidpVga8To16BitTransform[Color].Red; Green = VidpVga8To16BitTransform[Color].Green; Blue = VidpVga8To16BitTransform[Color].Blue; - + // // Build the 16-bit color mask // @@ -93,7 +93,7 @@ IN UCHAR Color) { PUSHORT PixelPosition; - + // // Calculate the pixel position // @@ -107,18 +107,18 @@ VOID NTAPI -DisplayCharacter(CHAR Character, - ULONG Left, - ULONG Top, - ULONG TextColor, - ULONG BackTextColor) +DisplayCharacter(IN CHAR Character, + IN ULONG Left, + IN ULONG Top, + IN ULONG TextColor, + IN ULONG BackTextColor) { PUCHAR FontChar; ULONG i, j, XOffset; - + /* Get the font line for this character */ FontChar = &FontData[Character * 13 - Top]; - + /* Loop each pixel height */ i = 13; do @@ -140,11 +140,11 @@ /* transparent. */ VidpSetPixel(XOffset, Top, (UCHAR)BackTextColor); } - + /* Increase X Offset */ XOffset++; } while (j >>= 1); - + /* Move to the next Y ordinate */ Top++; } while (--i); @@ -152,56 +152,56 @@ VOID NTAPI -VgaScroll(ULONG Scroll) +VgaScroll(IN ULONG Scroll) { ULONG Top, Offset; PUSHORT SourceOffset, DestOffset; PUSHORT i, j; - + /* Set memory positions of the scroll */ SourceOffset = &VgaArmBase[(VidpScrollRegion[1] * 80) + (VidpScrollRegion[0] >> 3)]; DestOffset = &SourceOffset[Scroll * 80]; - + /* Save top and check if it's above the bottom */ Top = VidpScrollRegion[1]; if (Top > VidpScrollRegion[3]) return; - + /* Start loop */ do { /* Set number of bytes to loop and start offset */ Offset = VidpScrollRegion[0] >> 3; j = SourceOffset; - + /* Check if this is part of the scroll region */ if (Offset <= (VidpScrollRegion[2] >> 3)) { /* Update position */ i = (PUSHORT)(DestOffset - SourceOffset); - + /* Loop the X axis */ do { /* Write value in the new position so that we can do the scroll */ WRITE_REGISTER_USHORT(j, READ_REGISTER_USHORT(j + (ULONG_PTR)i)); - + /* Move to the next memory location to write to */ j++; - + /* Move to the next byte in the region */ Offset++; - + /* Make sure we don't go past the scroll region */ } while (Offset <= (VidpScrollRegion[2] >> 3)); } - + /* Move to the next line */ SourceOffset += 80; DestOffset += 80; - + /* Increase top */ Top++; - + /* Make sure we don't go past the scroll region */ } while (Top <= VidpScrollRegion[3]); } @@ -214,7 +214,7 @@ { PUSHORT Position1, Position2; ULONG Count; - + /* Check which way we're preserving */ if (Direction) { @@ -228,21 +228,17 @@ Position1 = &VgaArmBase[0x9600]; Position2 = &VgaArmBase[CurrentTop * 80]; } - - /* Set the count and make sure it's above 0 */ + + /* Set the count and loop every pixel */ Count = TopDelta * 80; - if (Count) - { - /* Loop every pixel */ - do - { - /* Write the data back on the other position */ - WRITE_REGISTER_USHORT(Position1, READ_REGISTER_USHORT(Position2)); - - /* Increase both positions */ - Position2++; - Position1++; - } while (--Count); + while (Count--) + { + /* Write the data back on the other position */ + WRITE_REGISTER_USHORT(Position1, READ_REGISTER_USHORT(Position2)); + + /* Increase both positions */ + Position1++; + Position2++; } } @@ -255,17 +251,17 @@ // WRITE_REGISTER_ULONG(PL110_LCDUPBASE, VgaPhysical.LowPart); WRITE_REGISTER_ULONG(PL110_LCDLPBASE, VgaPhysical.LowPart); - + // // Initialize timings to 640x480 // - WRITE_REGISTER_ULONG(PL110_LCDTIMING0, LCDTIMING0_PPL(640)); - WRITE_REGISTER_ULONG(PL110_LCDTIMING1, LCDTIMING1_LPP(480)); - + WRITE_REGISTER_ULONG(PL110_LCDTIMING0, LCDTIMING0_PPL(640)); + WRITE_REGISTER_ULONG(PL110_LCDTIMING1, LCDTIMING1_LPP(480)); + // // Enable the LCD Display // - WRITE_REGISTER_ULONG(PL110_LCDCONTROL, + WRITE_REGISTER_ULONG(PL110_LCDCONTROL, LCDCONTROL_LCDEN | LCDCONTROL_LCDTFT | LCDCONTROL_LCDPWR | @@ -280,9 +276,9 @@ BOOLEAN NTAPI VidInitialize(IN BOOLEAN SetMode) -{ +{ DPRINT1("bv-arm v0.1\n"); - + // // Allocate framebuffer // 600kb works out to 640x480@16bpp @@ -290,7 +286,7 @@ VgaPhysical.QuadPart = -1; VgaArmBase = MmAllocateContiguousMemory(600 * 1024, VgaPhysical); if (!VgaArmBase) return FALSE; - + // // Get physical address // @@ -321,12 +317,12 @@ // VidpCurrentX = 0; VidpCurrentY = 0; - + // // Re-initialize the VGA Display // VidpInitializeDisplay(); - + // // Re-initialize the palette and fill the screen black // @@ -339,16 +335,16 @@ */ ULONG NTAPI -VidSetTextColor(ULONG Color) +VidSetTextColor(IN ULONG Color) { UCHAR OldColor; - + // // Save the old, set the new // OldColor = VidpTextColor; VidpTextColor = Color; - + // // Return the old text color // @@ -360,10 +356,10 @@ */ VOID NTAPI -VidDisplayStringXY(PUCHAR String, - ULONG Left, - ULONG Top, - BOOLEAN Transparent) +VidDisplayStringXY(IN PUCHAR String, + IN ULONG Left, + IN ULONG Top, + IN BOOLEAN Transparent) { UNIMPLEMENTED; while (TRUE); @@ -374,24 +370,24 @@ */ VOID NTAPI -VidSetScrollRegion(ULONG x1, - ULONG y1, - ULONG x2, - ULONG y2) +VidSetScrollRegion(IN ULONG Left, + IN ULONG Top, + IN ULONG Right, + IN ULONG Bottom) { /* Assert alignment */ - ASSERT((x1 & 0x7) == 0); - ASSERT((x2 & 0x7) == 7); - + ASSERT((Left & 0x7) == 0); + ASSERT((Right & 0x7) == 7); + /* Set Scroll Region */ - VidpScrollRegion[0] = x1; - VidpScrollRegion[1] = y1; - VidpScrollRegion[2] = x2; - VidpScrollRegion[3] = y2; - + VidpScrollRegion[0] = Left; + VidpScrollRegion[1] = Top; + VidpScrollRegion[2] = Right; + VidpScrollRegion[3] = Bottom; + /* Set current X and Y */ - VidpCurrentX = x1; - VidpCurrentY = y1; + VidpCurrentX = Left; + VidpCurrentY = Top; } /* @@ -426,10 +422,10 @@ */ VOID NTAPI -VidDisplayString(PUCHAR String) +VidDisplayString(IN PUCHAR String) { ULONG TopDelta = 14; - + /* Start looping the string */ while (*String) { @@ -443,14 +439,14 @@ /* Scroll the view */ VgaScroll(TopDelta); VidpCurrentY -= TopDelta; - + /* Preserve row */ PreserveRow(VidpCurrentY, TopDelta, TRUE); } - + /* Update current X */ VidpCurrentX = VidpScrollRegion[0]; - + /* Preseve the current row */ PreserveRow(VidpCurrentY, TopDelta, FALSE); } @@ -458,7 +454,7 @@ { /* Update current X */ VidpCurrentX = VidpScrollRegion[0]; - + /* Check if we're being followed by a new line */ if (String[1] != '\n') NextLine = TRUE; } @@ -471,7 +467,7 @@ PreserveRow(VidpCurrentY, TopDelta, TRUE); NextLine = FALSE; } - + /* Display this character */ DisplayCharacter(*String, VidpCurrentX, @@ -479,7 +475,7 @@ VidpTextColor, 16); VidpCurrentX += 8; - + /* Check if we should scroll */ if (VidpCurrentX > VidpScrollRegion[2]) { @@ -490,29 +486,29 @@ /* Do the scroll */ VgaScroll(TopDelta); VidpCurrentY -= TopDelta; - + /* Save the row */ PreserveRow(VidpCurrentY, TopDelta, TRUE); } - + /* Update X */ VidpCurrentX = VidpScrollRegion[0]; } } - + /* Get the next character */ String++; - } -} - -/* - * @implemented - */ -VOID -NTAPI -VidBitBlt(PUCHAR Buffer, - ULONG Left, - ULONG Top) + } +} + +/* + * @implemented + */ +VOID +NTAPI +VidBitBlt(IN PUCHAR Buffer, + IN ULONG Left, + IN ULONG Top) { UNIMPLEMENTED; //while (TRUE); @@ -523,12 +519,12 @@ */ VOID NTAPI -VidScreenToBufferBlt(PUCHAR Buffer, - ULONG Left, - ULONG Top, - ULONG Width, - ULONG Height, - ULONG Delta) +VidScreenToBufferBlt(IN PUCHAR Buffer, + IN ULONG Left, + IN ULONG Top, + IN ULONG Width, + IN ULONG Height, + IN ULONG Delta) { UNIMPLEMENTED; while (TRUE); @@ -546,12 +542,12 @@ IN UCHAR Color) { int y, x; - + // // Loop along the Y-axis // - for (y = Top; y <= Bottom; y++) - { + for (y = Top; y <= Bottom; y++) + { // // Loop along the X-axis // @@ -562,5 +558,5 @@ // VidpSetPixel(x, y, Color); } - } -} + } +} Modified: trunk/reactos/drivers/base/bootvid/i386/bootvid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/bootvid/i386/…
============================================================================== --- trunk/reactos/drivers/base/bootvid/i386/bootvid.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/bootvid/i386/bootvid.c [iso-8859-1] Sun Aug 31 23:00:29 2014 @@ -5,7 +5,7 @@ /* PRIVATE FUNCTIONS *********************************************************/ -BOOLEAN +static BOOLEAN NTAPI VgaInterpretCmdStream(IN PUSHORT CmdStream) { @@ -139,6 +139,7 @@ switch (Minor) { case 0: + { /* The port is what is in the stream right now */ ShortPort = UlongToPtr(*CmdStream); @@ -167,7 +168,10 @@ WRITE_PORT_USHORT(ShortPort, ShortValue); } break; + } + case 1: + { /* The port is what is in the stream right now. Add the base too */ Port = *CmdStream + Base; @@ -196,7 +200,10 @@ WRITE_PORT_UCHAR(Port, Value); } break; + } + case 2: + { /* The port is what is in the stream right now. Add the base too */ Port = *CmdStream + Base; @@ -208,6 +215,8 @@ /* Write the value */ WRITE_PORT_UCHAR(Port, Value); break; + } + default: /* Unknown command, fail */ return FALSE; @@ -227,7 +236,7 @@ return TRUE; } -BOOLEAN +static BOOLEAN NTAPI VgaIsPresent(VOID) { Modified: trunk/reactos/drivers/base/bootvid/i386/vga.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/bootvid/i386/…
============================================================================== --- trunk/reactos/drivers/base/bootvid/i386/vga.c [iso-8859-1] (original) +++ trunk/reactos/drivers/base/bootvid/i386/vga.c [iso-8859-1] Sun Aug 31 23:00:29 2014 @@ -2,14 +2,14 @@ /* GLOBALS *******************************************************************/ -ULONG ScrollRegion[4] = +static ULONG ScrollRegion[4] = { 0, 0, 640 - 1, 480 - 1 }; -UCHAR lMaskTable[8] = +static UCHAR lMaskTable[8] = { (1 << 8) - (1 << 0), (1 << 7) - (1 << 0), @@ -20,7 +20,7 @@ (1 << 2) - (1 << 0), (1 << 1) - (1 << 0) }; -UCHAR rMaskTable[8] = +static UCHAR rMaskTable[8] = { (1 << 7), (1 << 7)+ (1 << 6), @@ -43,7 +43,7 @@ (1 << 1), (1 << 0), }; -ULONG lookup[16] = +static ULONG lookup[16] = { 0x0000, 0x0100, @@ -63,24 +63,24 @@ 0x1111, }; -ULONG VidTextColor = 0xF; +ULONG_PTR VgaRegisterBase = 0; +ULONG_PTR VgaBase = 0; ULONG curr_x = 0; ULONG curr_y = 0; -BOOLEAN CarriageReturn = FALSE; -ULONG_PTR VgaRegisterBase = 0; -ULONG_PTR VgaBase = 0; +static ULONG VidTextColor = 0xF; +static BOOLEAN CarriageReturn = FALSE; #define __outpb(Port, Value) \ - WRITE_PORT_UCHAR((PUCHAR)VgaRegisterBase + Port, (UCHAR)Value) + WRITE_PORT_UCHAR((PUCHAR)(VgaRegisterBase + (Port)), (UCHAR)(Value)) #define __outpw(Port, Value) \ - WRITE_PORT_USHORT((PUSHORT)(VgaRegisterBase + Port), (USHORT)Value) + WRITE_PORT_USHORT((PUSHORT)(VgaRegisterBase + (Port)), (USHORT)(Value)) /* PRIVATE FUNCTIONS *********************************************************/ -VOID -NTAPI -ReadWriteMode(UCHAR Mode) +static VOID +NTAPI +ReadWriteMode(IN UCHAR Mode) { UCHAR Value; @@ -93,7 +93,6 @@ /* Set the new mode */ __outpb(0x3CF, Mode | Value); } - FORCEINLINE VOID @@ -104,7 +103,7 @@ PUCHAR PixelPosition; /* Calculate the pixel position. */ - PixelPosition = (PUCHAR)VgaBase + (Left >> 3) + (Top * 80); + PixelPosition = (PUCHAR)(VgaBase + (Left >> 3) + (Top * 80)); /* Select the bitmask register and write the mask */ __outpw(0x3CE, (PixelMask[Left & 7] << 8) | 8); @@ -113,6 +112,14 @@ WRITE_REGISTER_UCHAR(PixelPosition, READ_REGISTER_UCHAR(PixelPosition) & Color); } + +#define SET_PIXELS(_PixelPtr, _PixelMask, _TextColor) \ +do { \ + /* Select the bitmask register and write the mask */ \ + __outpw(0x3CE, ((_PixelMask) << 8) | 8); \ + /* Set the new color */ \ + WRITE_REGISTER_UCHAR((_PixelPtr), (UCHAR)(_TextColor)); \ +} while (0); #ifdef CHAR_GEN_UPSIDE_DOWN # define GetFontPtr(_Char) &FontData[_Char * BOOTCHAR_HEIGHT] + BOOTCHAR_HEIGHT - 1; @@ -122,20 +129,13 @@ # define FONT_PTR_DELTA (1) #endif -#define SET_PIXELS(_PixelPtr, _PixelMask, _TextColor) \ - /* Select the bitmask register and write the mask */ \ - __outpw(0x3CE, (_PixelMask << 8) | 8); \ -\ - /* Set the new color */ \ - WRITE_REGISTER_UCHAR(_PixelPtr, (UCHAR)_TextColor);\ - -VOID -NTAPI -DisplayCharacter(CHAR Character, - ULONG Left, - ULONG Top, - ULONG TextColor, - ULONG BackColor) +static VOID +NTAPI +DisplayCharacter(IN CHAR Character, + IN ULONG Left, + IN ULONG Top, + IN ULONG TextColor, + IN ULONG BackColor) { PUCHAR FontChar, PixelPtr; ULONG Height; @@ -155,7 +155,7 @@ /* Get the font and pixel pointer */ FontChar = GetFontPtr(Character); - PixelPtr = (PUCHAR)VgaBase + (Left >> 3) + (Top * 80); + PixelPtr = (PUCHAR)(VgaBase + (Left >> 3) + (Top * 80)); /* Loop all pixel rows */ Height = BOOTCHAR_HEIGHT; @@ -174,7 +174,7 @@ /* Get the font and pixel pointer (2nd byte) */ FontChar = GetFontPtr(Character); - PixelPtr = (PUCHAR)VgaBase + (Left >> 3) + (Top * 80) + 1; + PixelPtr = (PUCHAR)(VgaBase + (Left >> 3) + (Top * 80) + 1); /* Loop all pixel rows */ Height = BOOTCHAR_HEIGHT; @@ -198,7 +198,7 @@ /* Get the font and pixel pointer */ FontChar = GetFontPtr(Character); - PixelPtr = (PUCHAR)VgaBase + (Left >> 3) + (Top * 80); + PixelPtr = (PUCHAR)(VgaBase + (Left >> 3) + (Top * 80)); /* Loop all pixel rows */ Height = BOOTCHAR_HEIGHT; @@ -217,7 +217,7 @@ /* Get the font and pixel pointer (2nd byte) */ FontChar = GetFontPtr(Character); - PixelPtr = (PUCHAR)VgaBase + (Left >> 3) + (Top * 80) + 1; + PixelPtr = (PUCHAR)(VgaBase + (Left >> 3) + (Top * 80) + 1); /* Loop all pixel rows */ Height = BOOTCHAR_HEIGHT; @@ -230,13 +230,13 @@ } } -VOID -NTAPI -DisplayStringXY(PUCHAR String, - ULONG Left, - ULONG Top, - ULONG TextColor, - ULONG BackColor) +static VOID +NTAPI +DisplayStringXY(IN PUCHAR String, + IN ULONG Left, + IN ULONG Top, + IN ULONG TextColor, + IN ULONG BackColor) { /* Loop every character */ while (*String) @@ -250,7 +250,7 @@ } } -VOID +static VOID NTAPI SetPaletteEntryRGB(IN ULONG Id, IN ULONG Rgb) @@ -266,7 +266,7 @@ __outpb(0x3C9, Colors[0] >> 2); } -VOID +static VOID NTAPI InitPaletteWithTable(IN PULONG Table, IN ULONG Count) @@ -282,7 +282,7 @@ } } -VOID +static VOID NTAPI SetPaletteEntry(IN ULONG Id, IN ULONG PaletteEntry) @@ -300,18 +300,18 @@ NTAPI InitializePalette(VOID) { - ULONG PaletteEntry[16] = {0, - 0x20, - 0x2000, - 0x2020, + ULONG PaletteEntry[16] = {0x000000, + 0x000020, + 0x002000, + 0x002020, 0x200000, 0x200020, 0x202000, 0x202020, 0x303030, - 0x3F, - 0x3F00, - 0x3F3F, + 0x00003F, + 0x003F00, + 0x003F3F, 0x3F0000, 0x3F003F, 0x3F3F00, @@ -322,9 +322,9 @@ for (i = 0; i < 16; i++) SetPaletteEntry(i, PaletteEntry[i]); } -VOID -NTAPI -VgaScroll(ULONG Scroll) +static VOID +NTAPI +VgaScroll(IN ULONG Scroll) { ULONG Top, RowSize; PUCHAR OldPosition, NewPosition; @@ -341,11 +341,11 @@ RowSize = (ScrollRegion[2] - ScrollRegion[0] + 1) / 8; /* Calculate the position in memory for the row */ - OldPosition = (PUCHAR)VgaBase + (ScrollRegion[1] + Scroll) * 80 + ScrollRegion[0] / 8; - NewPosition = (PUCHAR)VgaBase + ScrollRegion[1] * 80 + ScrollRegion[0] / 8; + OldPosition = (PUCHAR)(VgaBase + (ScrollRegion[1] + Scroll) * 80 + ScrollRegion[0] / 8); + NewPosition = (PUCHAR)(VgaBase + ScrollRegion[1] * 80 + ScrollRegion[0] / 8); /* Start loop */ - for(Top = ScrollRegion[1]; Top <= ScrollRegion[3]; ++Top) + for (Top = ScrollRegion[1]; Top <= ScrollRegion[3]; ++Top) { #if defined(_M_IX86) || defined(_M_AMD64) __movsb(NewPosition, OldPosition, RowSize); @@ -353,7 +353,7 @@ ULONG i; /* Scroll the row */ - for(i = 0; i < RowSize; ++i) + for (i = 0; i < RowSize; ++i) WRITE_REGISTER_UCHAR(NewPosition + i, READ_REGISTER_UCHAR(OldPosition + i)); #endif OldPosition += 80; @@ -361,7 +361,7 @@ } } -VOID +static VOID NTAPI PreserveRow(IN ULONG CurrentTop, IN ULONG TopDelta, @@ -383,36 +383,35 @@ if (Direction) { /* Calculate the position in memory for the row */ - Position1 = (PUCHAR)VgaBase + CurrentTop * 80; - Position2 = (PUCHAR)VgaBase + 0x9600; + Position1 = (PUCHAR)(VgaBase + CurrentTop * 80); + Position2 = (PUCHAR)(VgaBase + 0x9600); } else { /* Calculate the position in memory for the row */ - Position1 = (PUCHAR)VgaBase + 0x9600; - Position2 = (PUCHAR)VgaBase + CurrentTop * 80; - } - - /* Set the count and make sure it's above 0 */ + Position1 = (PUCHAR)(VgaBase + 0x9600); + Position2 = (PUCHAR)(VgaBase + CurrentTop * 80); + } + + /* Set the count and loop every pixel */ Count = TopDelta * 80; #if defined(_M_IX86) || defined(_M_AMD64) __movsb(Position1, Position2, Count); #else - /* Loop every pixel */ while (Count--) { /* Write the data back on the other position */ WRITE_REGISTER_UCHAR(Position1, READ_REGISTER_UCHAR(Position2)); /* Increase both positions */ + Position1++; Position2++; - Position1++; } #endif } -VOID +static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, @@ -479,7 +478,7 @@ } while (dy < Bottom); } -VOID +static VOID NTAPI RleBitBlt(IN ULONG Left, IN ULONG Top, @@ -577,22 +576,24 @@ { /* Case 0 */ case 0: - + { /* Set new x value, decrease distance and restart */ x = Left; YDelta--; Buffer++; continue; + } /* Case 1 */ case 1: - + { /* Done */ return; + } /* Case 2 */ case 2: - + { /* Set new x value, decrease distance and restart */ Buffer++; x += *Buffer; @@ -600,12 +601,14 @@ YDelta -= *Buffer; Buffer++; continue; + } /* Other values */ default: - + { Buffer++; break; + } } /* Check if we've gone past the edge */ @@ -684,7 +687,7 @@ */ ULONG NTAPI -VidSetTextColor(ULONG Color) +VidSetTextColor(IN ULONG Color) { ULONG OldColor; @@ -699,16 +702,18 @@ */ VOID NTAPI -VidDisplayStringXY(PUCHAR String, - ULONG Left, - ULONG Top, - BOOLEAN Transparent) +VidDisplayStringXY(IN PUCHAR String, + IN ULONG Left, + IN ULONG Top, + IN BOOLEAN Transparent) { ULONG BackColor; - /* If the caller wanted transparent, then send the special value (16), else */ - /* use our default and call the helper routine. */ - BackColor = (Transparent) ? 16 : 14; + /* + * If the caller wanted transparent, then send the special value (16), + * else use our default and call the helper routine. + */ + BackColor = Transparent ? 16 : 14; DisplayStringXY(String, Left, Top, 12, BackColor); } @@ -717,24 +722,24 @@ */ VOID NTAPI -VidSetScrollRegion(ULONG x1, - ULONG y1, - ULONG x2, - ULONG y2) +VidSetScrollRegion(IN ULONG Left, + IN ULONG Top, + IN ULONG Right, + IN ULONG Bottom) { /* Assert alignment */ - ASSERT((x1 & 0x7) == 0); - ASSERT((x2 & 0x7) == 7); + ASSERT((Left & 0x7) == 0); + ASSERT((Right & 0x7) == 7); /* Set Scroll Region */ - ScrollRegion[0] = x1; - ScrollRegion[1] = y1; - ScrollRegion[2] = x2; - ScrollRegion[3] = y2; + ScrollRegion[0] = Left; + ScrollRegion[1] = Top; + ScrollRegion[2] = Right; + ScrollRegion[3] = Bottom; /* Set current X and Y */ - curr_x = x1; - curr_y = y1; + curr_x = Left; + curr_y = Top; } /* @@ -764,7 +769,7 @@ IN ULONG Delta) { /* Make sure we have a width and height */ - if (!(Width) || !(Height)) return; + if (!Width || !Height) return; /* Call the helper function */ BitBlt(Left, Top, Width, Height, Buffer, 4, Delta); @@ -775,7 +780,7 @@ */ VOID NTAPI -VidDisplayString(PUCHAR String) +VidDisplayString(IN PUCHAR String) { ULONG TopDelta = BOOTCHAR_HEIGHT + 1; @@ -859,9 +864,9 @@ */ VOID NTAPI -VidBitBlt(PUCHAR Buffer, - ULONG Left, - ULONG Top) +VidBitBlt(IN PUCHAR Buffer, + IN ULONG Left, + IN ULONG Top) { PBITMAPINFOHEADER BitmapInfoHeader; LONG Delta; @@ -878,15 +883,17 @@ /* Make sure we can support this bitmap */ ASSERT((BitmapInfoHeader->biBitCount * BitmapInfoHeader->biPlanes) <= 4); - /* Calculate the delta and align it on 32-bytes, then calculate the actual */ - /* start of the bitmap data. */ + /* + * Calculate the delta and align it on 32-bytes, then calculate + * the actual start of the bitmap data. + */ Delta = (BitmapInfoHeader->biBitCount * BitmapInfoHeader->biWidth) + 31; Delta >>= 3; Delta &= ~3; BitmapOffset = Buffer + sizeof(BITMAPINFOHEADER) + 16 * sizeof(ULONG); /* Check the compression of the bitmap */ - if (BitmapInfoHeader->biCompression == 2) + if (BitmapInfoHeader->biCompression == BI_RLE4) { /* Make sure we have a width and a height */ if ((BitmapInfoHeader->biWidth) && (BitmapInfoHeader->biHeight)) @@ -910,7 +917,7 @@ else { /* Update buffer offset */ - BitmapOffset += ((BitmapInfoHeader->biHeight -1) * Delta); + BitmapOffset += ((BitmapInfoHeader->biHeight - 1) * Delta); Delta *= -1; } @@ -934,12 +941,12 @@ */ VOID NTAPI -VidScreenToBufferBlt(PUCHAR Buffer, - ULONG Left, - ULONG Top, - ULONG Width, - ULONG Height, - ULONG Delta) +VidScreenToBufferBlt(IN PUCHAR Buffer, + IN ULONG Left, + IN ULONG Top, + IN ULONG Width, + IN ULONG Height, + IN ULONG Delta) { ULONG Plane; ULONG XDistance; @@ -974,7 +981,7 @@ do { /* Set the current pixel position and reset buffer loop variable */ - PixelPosition = (PUCHAR)VgaBase + PixelOffset; + PixelPosition = (PUCHAR)(VgaBase + PixelOffset); i = Buffer; /* Set Mode 0 */ @@ -1073,7 +1080,7 @@ __outpw(0x3CE, 7); /* Calculate pixel position for the read */ - Offset = VgaBase + (Top * 80) + (PUCHAR)(ULONG_PTR)LeftOffset; + Offset = (PUCHAR)(VgaBase + (Top * 80) + LeftOffset); /* Select the bitmask register and write the mask */ __outpw(0x3CE, (USHORT)lMask); @@ -1097,7 +1104,7 @@ if (Distance) { /* Calculate new pixel position */ - Offset = VgaBase + (Top * 80) + (PUCHAR)(ULONG_PTR)RightOffset; + Offset = (PUCHAR)(VgaBase + (Top * 80) + RightOffset); Distance--; /* Select the bitmask register and write the mask */ @@ -1123,7 +1130,7 @@ if (Distance) { /* Calculate new pixel position */ - Offset = VgaBase + (Top * 80) + (PUCHAR)(ULONG_PTR)(LeftOffset + 1); + Offset = (PUCHAR)(VgaBase + (Top * 80) + LeftOffset + 1); /* Set the bitmask to 0xFF for all 4 planes */ __outpw(0x3CE, 0xFF08); Modified: trunk/reactos/drivers/base/bootvid/precomp.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/bootvid/preco…
============================================================================== --- trunk/reactos/drivers/base/bootvid/precomp.h [iso-8859-1] (original) +++ trunk/reactos/drivers/base/bootvid/precomp.h [iso-8859-1] Sun Aug 31 23:00:29 2014 @@ -31,11 +31,13 @@ ULONG biClrImportant; } BITMAPINFOHEADER, *PBITMAPINFOHEADER; +/* Supported bitmap compression formats */ +#define BI_RGB 0 +#define BI_RLE4 2 + VOID NTAPI -InitializePalette( - VOID -); +InitializePalette(VOID); /* Globals */ extern USHORT AT_Initialization[]; Modified: trunk/reactos/include/ndk/inbvfuncs.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/inbvfuncs.h?re…
============================================================================== --- trunk/reactos/include/ndk/inbvfuncs.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/inbvfuncs.h [iso-8859-1] Sun Aug 31 23:00:29 2014 @@ -94,8 +94,8 @@ InbvSetScrollRegion( _In_ ULONG Left, _In_ ULONG Top, - _In_ ULONG Width, - _In_ ULONG Height + _In_ ULONG Right, + _In_ ULONG Bottom ); VOID @@ -109,8 +109,8 @@ InbvSolidColorFill( _In_ ULONG Left, _In_ ULONG Top, - _In_ ULONG Width, - _In_ ULONG Height, + _In_ ULONG Right, + _In_ ULONG Bottom, _In_ ULONG Color ); Modified: trunk/reactos/include/reactos/drivers/bootvid/bootvid.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/bo…
============================================================================== --- trunk/reactos/include/reactos/drivers/bootvid/bootvid.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/drivers/bootvid/bootvid.h [iso-8859-1] Sun Aug 31 23:00:29 2014 @@ -11,22 +11,21 @@ ULONG NTAPI -VidSetTextColor(ULONG Color); +VidSetTextColor(IN ULONG Color); VOID NTAPI -VidDisplayStringXY(PUCHAR String, - ULONG Left, - ULONG Top, - BOOLEAN Transparent); +VidDisplayStringXY(IN PUCHAR String, + IN ULONG Left, + IN ULONG Top, + IN BOOLEAN Transparent); VOID NTAPI -VidSetScrollRegion(ULONG x1, - ULONG y1, - ULONG x2, - ULONG y2); - +VidSetScrollRegion(IN ULONG Left, + IN ULONG Top, + IN ULONG Right, + IN ULONG Bottom); VOID NTAPI @@ -43,22 +42,22 @@ VOID NTAPI -VidDisplayString(PUCHAR String); +VidDisplayString(IN PUCHAR String); VOID NTAPI -VidBitBlt(PUCHAR Buffer, - ULONG Left, - ULONG Top); +VidBitBlt(IN PUCHAR Buffer, + IN ULONG Left, + IN ULONG Top); VOID NTAPI -VidScreenToBufferBlt(PUCHAR Buffer, - ULONG Left, - ULONG Top, - ULONG Width, - ULONG Height, - ULONG Delta); +VidScreenToBufferBlt(IN PUCHAR Buffer, + IN ULONG Left, + IN ULONG Top, + IN ULONG Width, + IN ULONG Height, + IN ULONG Delta); VOID NTAPI Modified: trunk/reactos/ntoskrnl/inbv/inbv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/inbv/inbv.c?rev=6…
============================================================================== --- trunk/reactos/ntoskrnl/inbv/inbv.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/inbv/inbv.c [iso-8859-1] Sun Aug 31 23:00:29 2014 @@ -363,7 +363,7 @@ InbvAcquireLock(); /* Make sure we're installed and display the string */ - if (InbvBootDriverInstalled) VidDisplayString((PUCHAR) String); + if (InbvBootDriverInstalled) VidDisplayString((PUCHAR)String); /* Print the string on the EMS port */ HeadlessDispatch(HeadlessCmdPutString, @@ -462,11 +462,11 @@ NTAPI InbvSetScrollRegion(IN ULONG Left, IN ULONG Top, - IN ULONG Width, - IN ULONG Height) + IN ULONG Right, + IN ULONG Bottom) { /* Just call bootvid */ - VidSetScrollRegion(Left, Top, Width, Height); + VidSetScrollRegion(Left, Top, Right, Bottom); } VOID @@ -483,8 +483,8 @@ NTAPI InbvSolidColorFill(IN ULONG Left, IN ULONG Top, - IN ULONG Width, - IN ULONG Height, + IN ULONG Right, + IN ULONG Bottom, IN ULONG Color) { /* Make sure we own it */ @@ -497,7 +497,7 @@ if (InbvBootDriverInstalled) { /* Call bootvid */ - VidSolidColorFill(Left, Top, Width, Height, (UCHAR)Color); + VidSolidColorFill(Left, Top, Right, Bottom, (UCHAR)Color); } /* FIXME: Headless */
10 years
1
0
0
0
[tkreuzer] 64016: [PSDK/XDK] First version of autogenerated ntdef.h and winnt.h
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Aug 31 20:44:56 2014 New Revision: 64016 URL:
http://svn.reactos.org/svn/reactos?rev=64016&view=rev
Log: [PSDK/XDK] First version of autogenerated ntdef.h and winnt.h Modified: trunk/reactos/include/psdk/ntdef.h trunk/reactos/include/psdk/winnt.h trunk/reactos/include/xdk/ntbasedef.h trunk/reactos/include/xdk/ntdef.template.h trunk/reactos/include/xdk/winnt.template.h trunk/reactos/include/xdk/winnt_old.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/include/psdk/ntdef.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntdef.h?rev=6…
Modified: trunk/reactos/include/psdk/winnt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=6…
Modified: trunk/reactos/include/xdk/ntbasedef.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/ntbasedef.h?re…
Modified: trunk/reactos/include/xdk/ntdef.template.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/ntdef.template…
Modified: trunk/reactos/include/xdk/winnt.template.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/winnt.template…
Modified: trunk/reactos/include/xdk/winnt_old.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/xdk/winnt_old.h?re…
10 years
1
0
0
0
[tfaber] 64015: [NETAPI32] - Generate empty strings instead of NULL strings in BuildUserInfoBuffer CORE-8343 #resolve
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Aug 31 19:37:19 2014 New Revision: 64015 URL:
http://svn.reactos.org/svn/reactos?rev=64015&view=rev
Log: [NETAPI32] - Generate empty strings instead of NULL strings in BuildUserInfoBuffer CORE-8343 #resolve Modified: trunk/reactos/dll/win32/netapi32/user.c Modified: trunk/reactos/dll/win32/netapi32/user.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/user.c?…
============================================================================== --- trunk/reactos/dll/win32/netapi32/user.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/user.c [iso-8859-1] Sun Aug 31 19:37:19 2014 @@ -451,166 +451,84 @@ case 1: Size = sizeof(USER_INFO_1) + - UserInfo->UserName.Length + sizeof(WCHAR); - - if (UserInfo->HomeDirectory.Length > 0) - Size += UserInfo->HomeDirectory.Length + sizeof(WCHAR); - - if (UserInfo->AdminComment.Length > 0) - Size += UserInfo->AdminComment.Length + sizeof(WCHAR); - - if (UserInfo->ScriptPath.Length > 0) - Size += UserInfo->ScriptPath.Length + sizeof(WCHAR); + UserInfo->UserName.Length + sizeof(WCHAR) + + UserInfo->HomeDirectory.Length + sizeof(WCHAR) + + UserInfo->AdminComment.Length + sizeof(WCHAR) + + UserInfo->ScriptPath.Length + sizeof(WCHAR); break; case 2: Size = sizeof(USER_INFO_2) + - UserInfo->UserName.Length + sizeof(WCHAR); - - if (UserInfo->HomeDirectory.Length > 0) - Size += UserInfo->HomeDirectory.Length + sizeof(WCHAR); - - if (UserInfo->AdminComment.Length > 0) - Size += UserInfo->AdminComment.Length + sizeof(WCHAR); - - if (UserInfo->ScriptPath.Length > 0) - Size += UserInfo->ScriptPath.Length + sizeof(WCHAR); - - if (UserInfo->FullName.Length > 0) - Size += UserInfo->FullName.Length + sizeof(WCHAR); - - if (UserInfo->UserComment.Length > 0) - Size += UserInfo->UserComment.Length + sizeof(WCHAR); - - if (UserInfo->Parameters.Length > 0) - Size += UserInfo->Parameters.Length + sizeof(WCHAR); - - if (UserInfo->WorkStations.Length > 0) - Size += UserInfo->WorkStations.Length + sizeof(WCHAR); + UserInfo->UserName.Length + sizeof(WCHAR) + + UserInfo->HomeDirectory.Length + sizeof(WCHAR) + + UserInfo->AdminComment.Length + sizeof(WCHAR) + + UserInfo->ScriptPath.Length + sizeof(WCHAR) + + UserInfo->FullName.Length + sizeof(WCHAR) + + UserInfo->UserComment.Length + sizeof(WCHAR) + + UserInfo->Parameters.Length + sizeof(WCHAR) + + UserInfo->WorkStations.Length + sizeof(WCHAR) + + LogonServer.Length + sizeof(WCHAR); if (UserInfo->LogonHours.UnitsPerWeek > 0) Size += (((ULONG)UserInfo->LogonHours.UnitsPerWeek) + 7) / 8; - - if (LogonServer.Length > 0) - Size += LogonServer.Length + sizeof(WCHAR); break; case 3: Size = sizeof(USER_INFO_3) + - UserInfo->UserName.Length + sizeof(WCHAR); - - if (UserInfo->HomeDirectory.Length > 0) - Size += UserInfo->HomeDirectory.Length + sizeof(WCHAR); - - if (UserInfo->AdminComment.Length > 0) - Size += UserInfo->AdminComment.Length + sizeof(WCHAR); - - if (UserInfo->ScriptPath.Length > 0) - Size += UserInfo->ScriptPath.Length + sizeof(WCHAR); - - if (UserInfo->FullName.Length > 0) - Size += UserInfo->FullName.Length + sizeof(WCHAR); - - if (UserInfo->UserComment.Length > 0) - Size += UserInfo->UserComment.Length + sizeof(WCHAR); - - if (UserInfo->Parameters.Length > 0) - Size += UserInfo->Parameters.Length + sizeof(WCHAR); - - if (UserInfo->WorkStations.Length > 0) - Size += UserInfo->WorkStations.Length + sizeof(WCHAR); + UserInfo->UserName.Length + sizeof(WCHAR) + + UserInfo->HomeDirectory.Length + sizeof(WCHAR) + + UserInfo->AdminComment.Length + sizeof(WCHAR) + + UserInfo->ScriptPath.Length + sizeof(WCHAR) + + UserInfo->FullName.Length + sizeof(WCHAR) + + UserInfo->UserComment.Length + sizeof(WCHAR) + + UserInfo->Parameters.Length + sizeof(WCHAR) + + UserInfo->WorkStations.Length + sizeof(WCHAR) + + LogonServer.Length + sizeof(WCHAR) + + UserInfo->ProfilePath.Length + sizeof(WCHAR) + + UserInfo->HomeDirectoryDrive.Length + sizeof(WCHAR); if (UserInfo->LogonHours.UnitsPerWeek > 0) Size += (((ULONG)UserInfo->LogonHours.UnitsPerWeek) + 7) / 8; - - if (LogonServer.Length > 0) - Size += LogonServer.Length + sizeof(WCHAR); - - if (UserInfo->ProfilePath.Length > 0) - Size += UserInfo->ProfilePath.Length + sizeof(WCHAR); - - if (UserInfo->HomeDirectoryDrive.Length > 0) - Size += UserInfo->HomeDirectoryDrive.Length + sizeof(WCHAR); break; case 4: Size = sizeof(USER_INFO_4) + - UserInfo->UserName.Length + sizeof(WCHAR); - - if (UserInfo->HomeDirectory.Length > 0) - Size += UserInfo->HomeDirectory.Length + sizeof(WCHAR); - - if (UserInfo->AdminComment.Length > 0) - Size += UserInfo->AdminComment.Length + sizeof(WCHAR); - - if (UserInfo->ScriptPath.Length > 0) - Size += UserInfo->ScriptPath.Length + sizeof(WCHAR); - - if (UserInfo->FullName.Length > 0) - Size += UserInfo->FullName.Length + sizeof(WCHAR); - - if (UserInfo->UserComment.Length > 0) - Size += UserInfo->UserComment.Length + sizeof(WCHAR); - - if (UserInfo->Parameters.Length > 0) - Size += UserInfo->Parameters.Length + sizeof(WCHAR); - - if (UserInfo->WorkStations.Length > 0) - Size += UserInfo->WorkStations.Length + sizeof(WCHAR); + UserInfo->UserName.Length + sizeof(WCHAR) + + UserInfo->HomeDirectory.Length + sizeof(WCHAR) + + UserInfo->AdminComment.Length + sizeof(WCHAR) + + UserInfo->ScriptPath.Length + sizeof(WCHAR) + + UserInfo->FullName.Length + sizeof(WCHAR) + + UserInfo->UserComment.Length + sizeof(WCHAR) + + UserInfo->Parameters.Length + sizeof(WCHAR) + + UserInfo->WorkStations.Length + sizeof(WCHAR) + + LogonServer.Length + sizeof(WCHAR) + + UserInfo->ProfilePath.Length + sizeof(WCHAR) + + UserInfo->HomeDirectoryDrive.Length + sizeof(WCHAR); if (UserInfo->LogonHours.UnitsPerWeek > 0) Size += (((ULONG)UserInfo->LogonHours.UnitsPerWeek) + 7) / 8; - if (LogonServer.Length > 0) - Size += LogonServer.Length + sizeof(WCHAR); - /* FIXME: usri4_user_sid */ - - if (UserInfo->ProfilePath.Length > 0) - Size += UserInfo->ProfilePath.Length + sizeof(WCHAR); - - if (UserInfo->HomeDirectoryDrive.Length > 0) - Size += UserInfo->HomeDirectoryDrive.Length + sizeof(WCHAR); break; case 10: Size = sizeof(USER_INFO_10) + - UserInfo->UserName.Length + sizeof(WCHAR); - - if (UserInfo->AdminComment.Length > 0) - Size += UserInfo->AdminComment.Length + sizeof(WCHAR); - - if (UserInfo->UserComment.Length > 0) - Size += UserInfo->UserComment.Length + sizeof(WCHAR); - - if (UserInfo->FullName.Length > 0) - Size += UserInfo->FullName.Length + sizeof(WCHAR); + UserInfo->UserName.Length + sizeof(WCHAR) + + UserInfo->AdminComment.Length + sizeof(WCHAR) + + UserInfo->UserComment.Length + sizeof(WCHAR) + + UserInfo->FullName.Length + sizeof(WCHAR); break; case 11: Size = sizeof(USER_INFO_11) + - UserInfo->UserName.Length + sizeof(WCHAR); - - if (UserInfo->AdminComment.Length > 0) - Size += UserInfo->AdminComment.Length + sizeof(WCHAR); - - if (UserInfo->UserComment.Length > 0) - Size += UserInfo->UserComment.Length + sizeof(WCHAR); - - if (UserInfo->FullName.Length > 0) - Size += UserInfo->FullName.Length + sizeof(WCHAR); - - if (UserInfo->HomeDirectory.Length > 0) - Size += UserInfo->HomeDirectory.Length + sizeof(WCHAR); - - if (UserInfo->Parameters.Length > 0) - Size += UserInfo->Parameters.Length + sizeof(WCHAR); - - if (LogonServer.Length > 0) - Size += LogonServer.Length + sizeof(WCHAR); - - if (UserInfo->WorkStations.Length > 0) - Size += UserInfo->WorkStations.Length + sizeof(WCHAR); + UserInfo->UserName.Length + sizeof(WCHAR) + + UserInfo->AdminComment.Length + sizeof(WCHAR) + + UserInfo->UserComment.Length + sizeof(WCHAR) + + UserInfo->FullName.Length + sizeof(WCHAR) + + UserInfo->HomeDirectory.Length + sizeof(WCHAR) + + UserInfo->Parameters.Length + sizeof(WCHAR) + + LogonServer.Length + sizeof(WCHAR) + + UserInfo->WorkStations.Length + sizeof(WCHAR); if (UserInfo->LogonHours.UnitsPerWeek > 0) Size += (((ULONG)UserInfo->LogonHours.UnitsPerWeek) + 7) / 8; @@ -618,24 +536,16 @@ case 20: Size = sizeof(USER_INFO_20) + - UserInfo->UserName.Length + sizeof(WCHAR); - - if (UserInfo->FullName.Length > 0) - Size += UserInfo->FullName.Length + sizeof(WCHAR); - - if (UserInfo->AdminComment.Length > 0) - Size += UserInfo->AdminComment.Length + sizeof(WCHAR); + UserInfo->UserName.Length + sizeof(WCHAR) + + UserInfo->FullName.Length + sizeof(WCHAR) + + UserInfo->AdminComment.Length + sizeof(WCHAR); break; case 23: Size = sizeof(USER_INFO_23) + - UserInfo->UserName.Length + sizeof(WCHAR); - - if (UserInfo->FullName.Length > 0) - Size += UserInfo->FullName.Length + sizeof(WCHAR); - - if (UserInfo->AdminComment.Length > 0) - Size += UserInfo->AdminComment.Length + sizeof(WCHAR); + UserInfo->UserName.Length + sizeof(WCHAR) + + UserInfo->FullName.Length + sizeof(WCHAR) + + UserInfo->AdminComment.Length + sizeof(WCHAR); /* FIXME: usri23_user_sid */ break; @@ -685,42 +595,28 @@ /* FIXME: usri1_priv */ - if (UserInfo->HomeDirectory.Length > 0) - { - UserInfo1->usri1_home_dir = Ptr; - - memcpy(UserInfo1->usri1_home_dir, - UserInfo->HomeDirectory.Buffer, - UserInfo->HomeDirectory.Length); - UserInfo1->usri1_home_dir[UserInfo->HomeDirectory.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectory.Length + sizeof(WCHAR)); - } - - if (UserInfo->AdminComment.Length > 0) - { - UserInfo1->usri1_comment = Ptr; - - memcpy(UserInfo1->usri1_comment, - UserInfo->AdminComment.Buffer, - UserInfo->AdminComment.Length); - UserInfo1->usri1_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); - } + UserInfo1->usri1_home_dir = Ptr; + memcpy(UserInfo1->usri1_home_dir, + UserInfo->HomeDirectory.Buffer, + UserInfo->HomeDirectory.Length); + UserInfo1->usri1_home_dir[UserInfo->HomeDirectory.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectory.Length + sizeof(WCHAR)); + + UserInfo1->usri1_comment = Ptr; + memcpy(UserInfo1->usri1_comment, + UserInfo->AdminComment.Buffer, + UserInfo->AdminComment.Length); + UserInfo1->usri1_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); UserInfo1->usri1_flags = GetAccountFlags(UserInfo->UserAccountControl, Dacl); - if (UserInfo->ScriptPath.Length > 0) - { - UserInfo1->usri1_script_path = Ptr; - - memcpy(UserInfo1->usri1_script_path, - UserInfo->ScriptPath.Buffer, - UserInfo->ScriptPath.Length); - UserInfo1->usri1_script_path[UserInfo->ScriptPath.Length / sizeof(WCHAR)] = UNICODE_NULL; - } + UserInfo1->usri1_script_path = Ptr; + memcpy(UserInfo1->usri1_script_path, + UserInfo->ScriptPath.Buffer, + UserInfo->ScriptPath.Length); + UserInfo1->usri1_script_path[UserInfo->ScriptPath.Length / sizeof(WCHAR)] = UNICODE_NULL; break; case 2: @@ -742,94 +638,59 @@ /* FIXME: usri2_priv */ - if (UserInfo->HomeDirectory.Length > 0) - { - UserInfo2->usri2_home_dir = Ptr; - - memcpy(UserInfo2->usri2_home_dir, - UserInfo->HomeDirectory.Buffer, - UserInfo->HomeDirectory.Length); - UserInfo2->usri2_home_dir[UserInfo->HomeDirectory.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectory.Length + sizeof(WCHAR)); - } - - if (UserInfo->AdminComment.Length > 0) - { - UserInfo2->usri2_comment = Ptr; - - memcpy(UserInfo2->usri2_comment, - UserInfo->AdminComment.Buffer, - UserInfo->AdminComment.Length); - UserInfo2->usri2_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); - } + UserInfo2->usri2_home_dir = Ptr; + memcpy(UserInfo2->usri2_home_dir, + UserInfo->HomeDirectory.Buffer, + UserInfo->HomeDirectory.Length); + UserInfo2->usri2_home_dir[UserInfo->HomeDirectory.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectory.Length + sizeof(WCHAR)); + + UserInfo2->usri2_comment = Ptr; + memcpy(UserInfo2->usri2_comment, + UserInfo->AdminComment.Buffer, + UserInfo->AdminComment.Length); + UserInfo2->usri2_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); UserInfo2->usri2_flags = GetAccountFlags(UserInfo->UserAccountControl, Dacl); - if (UserInfo->ScriptPath.Length > 0) - { - UserInfo2->usri2_script_path = Ptr; - - memcpy(UserInfo2->usri2_script_path, - UserInfo->ScriptPath.Buffer, - UserInfo->ScriptPath.Length); - UserInfo2->usri2_script_path[UserInfo->ScriptPath.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->ScriptPath.Length + sizeof(WCHAR)); - } + UserInfo2->usri2_script_path = Ptr; + memcpy(UserInfo2->usri2_script_path, + UserInfo->ScriptPath.Buffer, + UserInfo->ScriptPath.Length); + UserInfo2->usri2_script_path[UserInfo->ScriptPath.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->ScriptPath.Length + sizeof(WCHAR)); /* FIXME: usri2_auth_flags */ - if (UserInfo->FullName.Length > 0) - { - UserInfo2->usri2_full_name = Ptr; - - memcpy(UserInfo2->usri2_full_name, - UserInfo->FullName.Buffer, - UserInfo->FullName.Length); - UserInfo2->usri2_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); - } - - if (UserInfo->UserComment.Length > 0) - { - UserInfo2->usri2_usr_comment = Ptr; - - memcpy(UserInfo2->usri2_usr_comment, - UserInfo->UserComment.Buffer, - UserInfo->UserComment.Length); - UserInfo2->usri2_usr_comment[UserInfo->UserComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserComment.Length + sizeof(WCHAR)); - } - - if (UserInfo->Parameters.Length > 0) - { - UserInfo2->usri2_parms = Ptr; - - memcpy(UserInfo2->usri2_parms, - UserInfo->Parameters.Buffer, - UserInfo->Parameters.Length); - UserInfo2->usri2_parms[UserInfo->Parameters.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->Parameters.Length + sizeof(WCHAR)); - } - - if (UserInfo->WorkStations.Length > 0) - { - UserInfo2->usri2_workstations = Ptr; - - memcpy(UserInfo2->usri2_workstations, - UserInfo->WorkStations.Buffer, - UserInfo->WorkStations.Length); - UserInfo2->usri2_workstations[UserInfo->WorkStations.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->WorkStations.Length + sizeof(WCHAR)); - } + UserInfo2->usri2_full_name = Ptr; + memcpy(UserInfo2->usri2_full_name, + UserInfo->FullName.Buffer, + UserInfo->FullName.Length); + UserInfo2->usri2_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); + + UserInfo2->usri2_usr_comment = Ptr; + memcpy(UserInfo2->usri2_usr_comment, + UserInfo->UserComment.Buffer, + UserInfo->UserComment.Length); + UserInfo2->usri2_usr_comment[UserInfo->UserComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserComment.Length + sizeof(WCHAR)); + + UserInfo2->usri2_parms = Ptr; + memcpy(UserInfo2->usri2_parms, + UserInfo->Parameters.Buffer, + UserInfo->Parameters.Length); + UserInfo2->usri2_parms[UserInfo->Parameters.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->Parameters.Length + sizeof(WCHAR)); + + UserInfo2->usri2_workstations = Ptr; + memcpy(UserInfo2->usri2_workstations, + UserInfo->WorkStations.Buffer, + UserInfo->WorkStations.Length); + UserInfo2->usri2_workstations[UserInfo->WorkStations.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->WorkStations.Length + sizeof(WCHAR)); RtlTimeToSecondsSince1970(&UserInfo->LastLogon, &UserInfo2->usri2_last_logon); @@ -857,17 +718,12 @@ UserInfo2->usri2_bad_pw_count = UserInfo->BadPasswordCount; UserInfo2->usri2_num_logons = UserInfo->LogonCount; - if (LogonServer.Length > 0) - { - UserInfo2->usri2_logon_server = Ptr; - - memcpy(UserInfo2->usri2_logon_server, - LogonServer.Buffer, - LogonServer.Length); - UserInfo2->usri2_logon_server[LogonServer.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + LogonServer.Length + sizeof(WCHAR)); - } + UserInfo2->usri2_logon_server = Ptr; + memcpy(UserInfo2->usri2_logon_server, + LogonServer.Buffer, + LogonServer.Length); + UserInfo2->usri2_logon_server[LogonServer.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + LogonServer.Length + sizeof(WCHAR)); UserInfo2->usri2_country_code = UserInfo->CountryCode; UserInfo2->usri2_code_page = UserInfo->CodePage; @@ -892,94 +748,59 @@ /* FIXME: usri3_priv */ - if (UserInfo->HomeDirectory.Length > 0) - { - UserInfo3->usri3_home_dir = Ptr; - - memcpy(UserInfo3->usri3_home_dir, - UserInfo->HomeDirectory.Buffer, - UserInfo->HomeDirectory.Length); - UserInfo3->usri3_home_dir[UserInfo->HomeDirectory.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectory.Length + sizeof(WCHAR)); - } - - if (UserInfo->AdminComment.Length > 0) - { - UserInfo3->usri3_comment = Ptr; - - memcpy(UserInfo3->usri3_comment, - UserInfo->AdminComment.Buffer, - UserInfo->AdminComment.Length); - UserInfo3->usri3_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); - } + UserInfo3->usri3_home_dir = Ptr; + memcpy(UserInfo3->usri3_home_dir, + UserInfo->HomeDirectory.Buffer, + UserInfo->HomeDirectory.Length); + UserInfo3->usri3_home_dir[UserInfo->HomeDirectory.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectory.Length + sizeof(WCHAR)); + + UserInfo3->usri3_comment = Ptr; + memcpy(UserInfo3->usri3_comment, + UserInfo->AdminComment.Buffer, + UserInfo->AdminComment.Length); + UserInfo3->usri3_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); UserInfo3->usri3_flags = GetAccountFlags(UserInfo->UserAccountControl, Dacl); - if (UserInfo->ScriptPath.Length > 0) - { - UserInfo3->usri3_script_path = Ptr; - - memcpy(UserInfo3->usri3_script_path, - UserInfo->ScriptPath.Buffer, - UserInfo->ScriptPath.Length); - UserInfo3->usri3_script_path[UserInfo->ScriptPath.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->ScriptPath.Length + sizeof(WCHAR)); - } + UserInfo3->usri3_script_path = Ptr; + memcpy(UserInfo3->usri3_script_path, + UserInfo->ScriptPath.Buffer, + UserInfo->ScriptPath.Length); + UserInfo3->usri3_script_path[UserInfo->ScriptPath.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->ScriptPath.Length + sizeof(WCHAR)); /* FIXME: usri3_auth_flags */ - if (UserInfo->FullName.Length > 0) - { - UserInfo3->usri3_full_name = Ptr; - - memcpy(UserInfo3->usri3_full_name, - UserInfo->FullName.Buffer, - UserInfo->FullName.Length); - UserInfo3->usri3_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); - } - - if (UserInfo->UserComment.Length > 0) - { - UserInfo3->usri3_usr_comment = Ptr; - - memcpy(UserInfo3->usri3_usr_comment, - UserInfo->UserComment.Buffer, - UserInfo->UserComment.Length); - UserInfo3->usri3_usr_comment[UserInfo->UserComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserComment.Length + sizeof(WCHAR)); - } - - if (UserInfo->Parameters.Length > 0) - { - UserInfo3->usri3_parms = Ptr; - - memcpy(UserInfo3->usri3_parms, - UserInfo->Parameters.Buffer, - UserInfo->Parameters.Length); - UserInfo3->usri3_parms[UserInfo->Parameters.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->Parameters.Length + sizeof(WCHAR)); - } - - if (UserInfo->WorkStations.Length > 0) - { - UserInfo3->usri3_workstations = Ptr; - - memcpy(UserInfo3->usri3_workstations, - UserInfo->WorkStations.Buffer, - UserInfo->WorkStations.Length); - UserInfo3->usri3_workstations[UserInfo->WorkStations.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->WorkStations.Length + sizeof(WCHAR)); - } + UserInfo3->usri3_full_name = Ptr; + memcpy(UserInfo3->usri3_full_name, + UserInfo->FullName.Buffer, + UserInfo->FullName.Length); + UserInfo3->usri3_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); + + UserInfo3->usri3_usr_comment = Ptr; + memcpy(UserInfo3->usri3_usr_comment, + UserInfo->UserComment.Buffer, + UserInfo->UserComment.Length); + UserInfo3->usri3_usr_comment[UserInfo->UserComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserComment.Length + sizeof(WCHAR)); + + UserInfo3->usri3_parms = Ptr; + memcpy(UserInfo3->usri3_parms, + UserInfo->Parameters.Buffer, + UserInfo->Parameters.Length); + UserInfo3->usri3_parms[UserInfo->Parameters.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->Parameters.Length + sizeof(WCHAR)); + + UserInfo3->usri3_workstations = Ptr; + memcpy(UserInfo3->usri3_workstations, + UserInfo->WorkStations.Buffer, + UserInfo->WorkStations.Length); + UserInfo3->usri3_workstations[UserInfo->WorkStations.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->WorkStations.Length + sizeof(WCHAR)); RtlTimeToSecondsSince1970(&UserInfo->LastLogon, &UserInfo3->usri3_last_logon); @@ -1007,46 +828,31 @@ UserInfo3->usri3_bad_pw_count = UserInfo->BadPasswordCount; UserInfo3->usri3_num_logons = UserInfo->LogonCount; - if (LogonServer.Length > 0) - { - UserInfo3->usri3_logon_server = Ptr; - - memcpy(UserInfo3->usri3_logon_server, - LogonServer.Buffer, - LogonServer.Length); - UserInfo3->usri3_logon_server[LogonServer.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + LogonServer.Length + sizeof(WCHAR)); - } + UserInfo3->usri3_logon_server = Ptr; + memcpy(UserInfo3->usri3_logon_server, + LogonServer.Buffer, + LogonServer.Length); + UserInfo3->usri3_logon_server[LogonServer.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + LogonServer.Length + sizeof(WCHAR)); UserInfo3->usri3_country_code = UserInfo->CountryCode; UserInfo3->usri3_code_page = UserInfo->CodePage; UserInfo3->usri3_user_id = RelativeId; UserInfo3->usri3_primary_group_id = UserInfo->PrimaryGroupId; - if (UserInfo->ProfilePath.Length > 0) - { - UserInfo3->usri3_profile = Ptr; - - memcpy(UserInfo3->usri3_profile, - UserInfo->ProfilePath.Buffer, - UserInfo->ProfilePath.Length); - UserInfo3->usri3_profile[UserInfo->ProfilePath.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->ProfilePath.Length + sizeof(WCHAR)); - } - - if (UserInfo->HomeDirectoryDrive.Length > 0) - { - UserInfo3->usri3_home_dir_drive = Ptr; - - memcpy(UserInfo3->usri3_home_dir_drive, - UserInfo->HomeDirectoryDrive.Buffer, - UserInfo->HomeDirectoryDrive.Length); - UserInfo3->usri3_home_dir_drive[UserInfo->HomeDirectoryDrive.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectoryDrive.Length + sizeof(WCHAR)); - } + UserInfo3->usri3_profile = Ptr; + memcpy(UserInfo3->usri3_profile, + UserInfo->ProfilePath.Buffer, + UserInfo->ProfilePath.Length); + UserInfo3->usri3_profile[UserInfo->ProfilePath.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->ProfilePath.Length + sizeof(WCHAR)); + + UserInfo3->usri3_home_dir_drive = Ptr; + memcpy(UserInfo3->usri3_home_dir_drive, + UserInfo->HomeDirectoryDrive.Buffer, + UserInfo->HomeDirectoryDrive.Length); + UserInfo3->usri3_home_dir_drive[UserInfo->HomeDirectoryDrive.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectoryDrive.Length + sizeof(WCHAR)); UserInfo3->usri3_password_expired = (UserInfo->UserAccountControl & USER_PASSWORD_EXPIRED); break; @@ -1070,94 +876,59 @@ /* FIXME: usri4_priv */ - if (UserInfo->HomeDirectory.Length > 0) - { - UserInfo4->usri4_home_dir = Ptr; - - memcpy(UserInfo4->usri4_home_dir, - UserInfo->HomeDirectory.Buffer, - UserInfo->HomeDirectory.Length); - UserInfo4->usri4_home_dir[UserInfo->HomeDirectory.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectory.Length + sizeof(WCHAR)); - } - - if (UserInfo->AdminComment.Length > 0) - { - UserInfo4->usri4_comment = Ptr; - - memcpy(UserInfo4->usri4_comment, - UserInfo->AdminComment.Buffer, - UserInfo->AdminComment.Length); - UserInfo4->usri4_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); - } + UserInfo4->usri4_home_dir = Ptr; + memcpy(UserInfo4->usri4_home_dir, + UserInfo->HomeDirectory.Buffer, + UserInfo->HomeDirectory.Length); + UserInfo4->usri4_home_dir[UserInfo->HomeDirectory.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectory.Length + sizeof(WCHAR)); + + UserInfo4->usri4_comment = Ptr; + memcpy(UserInfo4->usri4_comment, + UserInfo->AdminComment.Buffer, + UserInfo->AdminComment.Length); + UserInfo4->usri4_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); UserInfo4->usri4_flags = GetAccountFlags(UserInfo->UserAccountControl, Dacl); - if (UserInfo->ScriptPath.Length > 0) - { - UserInfo4->usri4_script_path = Ptr; - - memcpy(UserInfo4->usri4_script_path, - UserInfo->ScriptPath.Buffer, - UserInfo->ScriptPath.Length); - UserInfo4->usri4_script_path[UserInfo->ScriptPath.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->ScriptPath.Length + sizeof(WCHAR)); - } + UserInfo4->usri4_script_path = Ptr; + memcpy(UserInfo4->usri4_script_path, + UserInfo->ScriptPath.Buffer, + UserInfo->ScriptPath.Length); + UserInfo4->usri4_script_path[UserInfo->ScriptPath.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->ScriptPath.Length + sizeof(WCHAR)); /* FIXME: usri4_auth_flags */ - if (UserInfo->FullName.Length > 0) - { - UserInfo4->usri4_full_name = Ptr; - - memcpy(UserInfo4->usri4_full_name, - UserInfo->FullName.Buffer, - UserInfo->FullName.Length); - UserInfo4->usri4_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); - } - - if (UserInfo->UserComment.Length > 0) - { - UserInfo4->usri4_usr_comment = Ptr; - - memcpy(UserInfo4->usri4_usr_comment, - UserInfo->UserComment.Buffer, - UserInfo->UserComment.Length); - UserInfo4->usri4_usr_comment[UserInfo->UserComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserComment.Length + sizeof(WCHAR)); - } - - if (UserInfo->Parameters.Length > 0) - { - UserInfo4->usri4_parms = Ptr; - - memcpy(UserInfo4->usri4_parms, - UserInfo->Parameters.Buffer, - UserInfo->Parameters.Length); - UserInfo4->usri4_parms[UserInfo->Parameters.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->Parameters.Length + sizeof(WCHAR)); - } - - if (UserInfo->WorkStations.Length > 0) - { - UserInfo4->usri4_workstations = Ptr; - - memcpy(UserInfo4->usri4_workstations, - UserInfo->WorkStations.Buffer, - UserInfo->WorkStations.Length); - UserInfo4->usri4_workstations[UserInfo->WorkStations.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->WorkStations.Length + sizeof(WCHAR)); - } + UserInfo4->usri4_full_name = Ptr; + memcpy(UserInfo4->usri4_full_name, + UserInfo->FullName.Buffer, + UserInfo->FullName.Length); + UserInfo4->usri4_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); + + UserInfo4->usri4_usr_comment = Ptr; + memcpy(UserInfo4->usri4_usr_comment, + UserInfo->UserComment.Buffer, + UserInfo->UserComment.Length); + UserInfo4->usri4_usr_comment[UserInfo->UserComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserComment.Length + sizeof(WCHAR)); + + UserInfo4->usri4_parms = Ptr; + memcpy(UserInfo4->usri4_parms, + UserInfo->Parameters.Buffer, + UserInfo->Parameters.Length); + UserInfo4->usri4_parms[UserInfo->Parameters.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->Parameters.Length + sizeof(WCHAR)); + + UserInfo4->usri4_workstations = Ptr; + memcpy(UserInfo4->usri4_workstations, + UserInfo->WorkStations.Buffer, + UserInfo->WorkStations.Length); + UserInfo4->usri4_workstations[UserInfo->WorkStations.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->WorkStations.Length + sizeof(WCHAR)); RtlTimeToSecondsSince1970(&UserInfo->LastLogon, &UserInfo4->usri4_last_logon); @@ -1185,17 +956,12 @@ UserInfo4->usri4_bad_pw_count = UserInfo->BadPasswordCount; UserInfo4->usri4_num_logons = UserInfo->LogonCount; - if (LogonServer.Length > 0) - { - UserInfo4->usri4_logon_server = Ptr; - - memcpy(UserInfo4->usri4_logon_server, - LogonServer.Buffer, - LogonServer.Length); - UserInfo4->usri4_logon_server[LogonServer.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + LogonServer.Length + sizeof(WCHAR)); - } + UserInfo4->usri4_logon_server = Ptr; + memcpy(UserInfo4->usri4_logon_server, + LogonServer.Buffer, + LogonServer.Length); + UserInfo4->usri4_logon_server[LogonServer.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + LogonServer.Length + sizeof(WCHAR)); UserInfo4->usri4_country_code = UserInfo->CountryCode; UserInfo4->usri4_code_page = UserInfo->CodePage; @@ -1204,29 +970,19 @@ UserInfo4->usri4_primary_group_id = UserInfo->PrimaryGroupId; - if (UserInfo->ProfilePath.Length > 0) - { - UserInfo4->usri4_profile = Ptr; - - memcpy(UserInfo4->usri4_profile, - UserInfo->ProfilePath.Buffer, - UserInfo->ProfilePath.Length); - UserInfo4->usri4_profile[UserInfo->ProfilePath.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->ProfilePath.Length + sizeof(WCHAR)); - } - - if (UserInfo->HomeDirectoryDrive.Length > 0) - { - UserInfo4->usri4_home_dir_drive = Ptr; - - memcpy(UserInfo4->usri4_home_dir_drive, - UserInfo->HomeDirectoryDrive.Buffer, - UserInfo->HomeDirectoryDrive.Length); - UserInfo4->usri4_home_dir_drive[UserInfo->HomeDirectoryDrive.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectoryDrive.Length + sizeof(WCHAR)); - } + UserInfo4->usri4_profile = Ptr; + memcpy(UserInfo4->usri4_profile, + UserInfo->ProfilePath.Buffer, + UserInfo->ProfilePath.Length); + UserInfo4->usri4_profile[UserInfo->ProfilePath.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->ProfilePath.Length + sizeof(WCHAR)); + + UserInfo4->usri4_home_dir_drive = Ptr; + memcpy(UserInfo4->usri4_home_dir_drive, + UserInfo->HomeDirectoryDrive.Buffer, + UserInfo->HomeDirectoryDrive.Length); + UserInfo4->usri4_home_dir_drive[UserInfo->HomeDirectoryDrive.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectoryDrive.Length + sizeof(WCHAR)); UserInfo4->usri4_password_expired = (UserInfo->UserAccountControl & USER_PASSWORD_EXPIRED); break; @@ -1245,39 +1001,25 @@ Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserName.Length + sizeof(WCHAR)); - if (UserInfo->AdminComment.Length > 0) - { - UserInfo10->usri10_comment = Ptr; - - memcpy(UserInfo10->usri10_comment, - UserInfo->AdminComment.Buffer, - UserInfo->AdminComment.Length); - UserInfo10->usri10_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); - } - - if (UserInfo->UserComment.Length > 0) - { - UserInfo10->usri10_usr_comment = Ptr; - - memcpy(UserInfo10->usri10_usr_comment, - UserInfo->UserComment.Buffer, - UserInfo->UserComment.Length); - UserInfo10->usri10_usr_comment[UserInfo->UserComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserComment.Length + sizeof(WCHAR)); - } - - if (UserInfo->FullName.Length > 0) - { - UserInfo10->usri10_full_name = Ptr; - - memcpy(UserInfo10->usri10_full_name, - UserInfo->FullName.Buffer, - UserInfo->FullName.Length); - UserInfo10->usri10_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; - } + UserInfo10->usri10_comment = Ptr; + memcpy(UserInfo10->usri10_comment, + UserInfo->AdminComment.Buffer, + UserInfo->AdminComment.Length); + UserInfo10->usri10_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); + + UserInfo10->usri10_usr_comment = Ptr; + memcpy(UserInfo10->usri10_usr_comment, + UserInfo->UserComment.Buffer, + UserInfo->UserComment.Length); + UserInfo10->usri10_usr_comment[UserInfo->UserComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserComment.Length + sizeof(WCHAR)); + + UserInfo10->usri10_full_name = Ptr; + memcpy(UserInfo10->usri10_full_name, + UserInfo->FullName.Buffer, + UserInfo->FullName.Length); + UserInfo10->usri10_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; break; case 11: @@ -1294,70 +1036,45 @@ Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserName.Length + sizeof(WCHAR)); - if (UserInfo->AdminComment.Length > 0) - { - UserInfo11->usri11_comment = Ptr; - - memcpy(UserInfo11->usri11_comment, - UserInfo->AdminComment.Buffer, - UserInfo->AdminComment.Length); - UserInfo11->usri11_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); - } - - if (UserInfo->UserComment.Length > 0) - { - UserInfo11->usri11_usr_comment = Ptr; - - memcpy(UserInfo11->usri11_usr_comment, - UserInfo->UserComment.Buffer, - UserInfo->UserComment.Length); - UserInfo11->usri11_usr_comment[UserInfo->UserComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserComment.Length + sizeof(WCHAR)); - } - - if (UserInfo->FullName.Length > 0) - { - UserInfo11->usri11_full_name = Ptr; - - memcpy(UserInfo11->usri11_full_name, - UserInfo->FullName.Buffer, - UserInfo->FullName.Length); - UserInfo11->usri11_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); - } + UserInfo11->usri11_comment = Ptr; + memcpy(UserInfo11->usri11_comment, + UserInfo->AdminComment.Buffer, + UserInfo->AdminComment.Length); + UserInfo11->usri11_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); + + UserInfo11->usri11_usr_comment = Ptr; + memcpy(UserInfo11->usri11_usr_comment, + UserInfo->UserComment.Buffer, + UserInfo->UserComment.Length); + UserInfo11->usri11_usr_comment[UserInfo->UserComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserComment.Length + sizeof(WCHAR)); + + UserInfo11->usri11_full_name = Ptr; + memcpy(UserInfo11->usri11_full_name, + UserInfo->FullName.Buffer, + UserInfo->FullName.Length); + UserInfo11->usri11_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); /* FIXME: usri11_priv */ /* FIXME: usri11_auth_flags */ UserInfo11->usri11_password_age = GetPasswordAge(&UserInfo->PasswordLastSet); - if (UserInfo->HomeDirectory.Length > 0) - { - UserInfo11->usri11_home_dir = Ptr; - - memcpy(UserInfo11->usri11_home_dir, - UserInfo->HomeDirectory.Buffer, - UserInfo->HomeDirectory.Length); - UserInfo11->usri11_home_dir[UserInfo->HomeDirectory.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectory.Length + sizeof(WCHAR)); - } - - if (UserInfo->Parameters.Length > 0) - { - UserInfo11->usri11_parms = Ptr; - - memcpy(UserInfo11->usri11_parms, - UserInfo->Parameters.Buffer, - UserInfo->Parameters.Length); - UserInfo11->usri11_parms[UserInfo->Parameters.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->Parameters.Length + sizeof(WCHAR)); - } + UserInfo11->usri11_home_dir = Ptr; + memcpy(UserInfo11->usri11_home_dir, + UserInfo->HomeDirectory.Buffer, + UserInfo->HomeDirectory.Length); + UserInfo11->usri11_home_dir[UserInfo->HomeDirectory.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->HomeDirectory.Length + sizeof(WCHAR)); + + UserInfo11->usri11_parms = Ptr; + memcpy(UserInfo11->usri11_parms, + UserInfo->Parameters.Buffer, + UserInfo->Parameters.Length); + UserInfo11->usri11_parms[UserInfo->Parameters.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->Parameters.Length + sizeof(WCHAR)); RtlTimeToSecondsSince1970(&UserInfo->LastLogon, &UserInfo11->usri11_last_logon); @@ -1368,31 +1085,21 @@ UserInfo11->usri11_bad_pw_count = UserInfo->BadPasswordCount; UserInfo11->usri11_num_logons = UserInfo->LogonCount; - if (LogonServer.Length > 0) - { - UserInfo11->usri11_logon_server = Ptr; - - memcpy(UserInfo11->usri11_logon_server, - LogonServer.Buffer, - LogonServer.Length); - UserInfo11->usri11_logon_server[LogonServer.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + LogonServer.Length + sizeof(WCHAR)); - } + UserInfo11->usri11_logon_server = Ptr; + memcpy(UserInfo11->usri11_logon_server, + LogonServer.Buffer, + LogonServer.Length); + UserInfo11->usri11_logon_server[LogonServer.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + LogonServer.Length + sizeof(WCHAR)); UserInfo11->usri11_country_code = UserInfo->CountryCode; - if (UserInfo->WorkStations.Length > 0) - { - UserInfo11->usri11_workstations = Ptr; - - memcpy(UserInfo11->usri11_workstations, - UserInfo->WorkStations.Buffer, - UserInfo->WorkStations.Length); - UserInfo11->usri11_workstations[UserInfo->WorkStations.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->WorkStations.Length + sizeof(WCHAR)); - } + UserInfo11->usri11_workstations = Ptr; + memcpy(UserInfo11->usri11_workstations, + UserInfo->WorkStations.Buffer, + UserInfo->WorkStations.Length); + UserInfo11->usri11_workstations[UserInfo->WorkStations.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->WorkStations.Length + sizeof(WCHAR)); UserInfo11->usri11_max_storage = USER_MAXSTORAGE_UNLIMITED; UserInfo11->usri11_units_per_week = UserInfo->LogonHours.UnitsPerWeek; @@ -1425,29 +1132,19 @@ Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserName.Length + sizeof(WCHAR)); - if (UserInfo->FullName.Length > 0) - { - UserInfo20->usri20_full_name = Ptr; - - memcpy(UserInfo20->usri20_full_name, - UserInfo->FullName.Buffer, - UserInfo->FullName.Length); - UserInfo20->usri20_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); - } - - if (UserInfo->AdminComment.Length > 0) - { - UserInfo20->usri20_comment = Ptr; - - memcpy(UserInfo20->usri20_comment, - UserInfo->AdminComment.Buffer, - UserInfo->AdminComment.Length); - UserInfo20->usri20_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); - } + UserInfo20->usri20_full_name = Ptr; + memcpy(UserInfo20->usri20_full_name, + UserInfo->FullName.Buffer, + UserInfo->FullName.Length); + UserInfo20->usri20_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); + + UserInfo20->usri20_comment = Ptr; + memcpy(UserInfo20->usri20_comment, + UserInfo->AdminComment.Buffer, + UserInfo->AdminComment.Length); + UserInfo20->usri20_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); UserInfo20->usri20_flags = GetAccountFlags(UserInfo->UserAccountControl, Dacl); @@ -1469,29 +1166,19 @@ Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserName.Length + sizeof(WCHAR)); - if (UserInfo->FullName.Length > 0) - { - UserInfo23->usri23_full_name = Ptr; - - memcpy(UserInfo23->usri23_full_name, - UserInfo->FullName.Buffer, - UserInfo->FullName.Length); - UserInfo23->usri23_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); - } - - if (UserInfo->AdminComment.Length > 0) - { - UserInfo23->usri23_comment = Ptr; - - memcpy(UserInfo23->usri23_comment, - UserInfo->AdminComment.Buffer, - UserInfo->AdminComment.Length); - UserInfo23->usri23_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); - } + UserInfo23->usri23_full_name = Ptr; + memcpy(UserInfo23->usri23_full_name, + UserInfo->FullName.Buffer, + UserInfo->FullName.Length); + UserInfo23->usri23_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); + + UserInfo23->usri23_comment = Ptr; + memcpy(UserInfo23->usri23_comment, + UserInfo->AdminComment.Buffer, + UserInfo->AdminComment.Length); + UserInfo23->usri23_comment[UserInfo->AdminComment.Length / sizeof(WCHAR)] = UNICODE_NULL; + Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->AdminComment.Length + sizeof(WCHAR)); UserInfo23->usri23_flags = GetAccountFlags(UserInfo->UserAccountControl, Dacl);
10 years
1
0
0
0
[tfaber] 64014: [NETAPI32] - Make the code in BuildUserInfoBuffer slightly more uniform so it can be generated. See https://reactos.org/wiki/User:ThFabba/netuser.py for the generation script CORE-8343
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Aug 31 19:29:53 2014 New Revision: 64014 URL:
http://svn.reactos.org/svn/reactos?rev=64014&view=rev
Log: [NETAPI32] - Make the code in BuildUserInfoBuffer slightly more uniform so it can be generated. See
https://reactos.org/wiki/User:ThFabba/netuser.py
for the generation script CORE-8343 Modified: trunk/reactos/dll/win32/netapi32/user.c Modified: trunk/reactos/dll/win32/netapi32/user.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/netapi32/user.c?…
============================================================================== --- trunk/reactos/dll/win32/netapi32/user.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/netapi32/user.c [iso-8859-1] Sun Aug 31 19:29:53 2014 @@ -657,6 +657,7 @@ UserInfo0 = (PUSER_INFO_0)LocalBuffer; Ptr = (LPWSTR)((ULONG_PTR)UserInfo0 + sizeof(USER_INFO_0)); + UserInfo0->usri0_name = Ptr; memcpy(UserInfo0->usri0_name, @@ -680,10 +681,9 @@ Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserName.Length + sizeof(WCHAR)); UserInfo1->usri1_password = NULL; - UserInfo1->usri1_password_age = GetPasswordAge(&UserInfo->PasswordLastSet); - /* FIXME: UserInfo1->usri1_priv */ + /* FIXME: usri1_priv */ if (UserInfo->HomeDirectory.Length > 0) { @@ -737,6 +737,7 @@ Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserName.Length + sizeof(WCHAR)); + UserInfo2->usri2_password = NULL; UserInfo2->usri2_password_age = GetPasswordAge(&UserInfo->PasswordLastSet); /* FIXME: usri2_priv */ @@ -886,6 +887,7 @@ Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->UserName.Length + sizeof(WCHAR)); + UserInfo3->usri3_password = NULL; UserInfo3->usri3_password_age = GetPasswordAge(&UserInfo->PasswordLastSet); /* FIXME: usri3_priv */ @@ -1275,8 +1277,6 @@ UserInfo->FullName.Buffer, UserInfo->FullName.Length); UserInfo10->usri10_full_name[UserInfo->FullName.Length / sizeof(WCHAR)] = UNICODE_NULL; - - Ptr = (LPWSTR)((ULONG_PTR)Ptr + UserInfo->FullName.Length + sizeof(WCHAR)); } break; @@ -1497,7 +1497,7 @@ Dacl); /* FIXME: usri23_user_sid */ - break; + break; } done:
10 years
1
0
0
0
[tkreuzer] 64013: [winnt.h] - UNLONG -> DWORD - Add missing PROBE_ALIGNMENT32, DECLSPEC_NOTHROW, SYSTEM_CACHE_ALIGNMENT_SIZE, DECLSPEC_CACHEALIGN, DECLSPEC_UUID, DECLSPEC_DEPRECATED, DECLSPEC_DEPRE...
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Aug 31 15:57:16 2014 New Revision: 64013 URL:
http://svn.reactos.org/svn/reactos?rev=64013&view=rev
Log: [winnt.h] - UNLONG -> DWORD - Add missing PROBE_ALIGNMENT32, DECLSPEC_NOTHROW, SYSTEM_CACHE_ALIGNMENT_SIZE, DECLSPEC_CACHEALIGN, DECLSPEC_UUID, DECLSPEC_DEPRECATED, DECLSPEC_DEPRECATED_DDK, COMPARTMENT_ID, OBJECTID, ALL_PROCESSOR_GROUPS, RATE_QUOTA_LIMIT, PRODUCT_*, LANG_*, SORT_* - Remove PRODUCT_SERVER_V, PRODUCT_CORE_LANGUAGESPECIFIC - Add some missing definitions for ARM - Fix tag of LIST_ENTRY32/64 => one step closer to wo^Z^Z autogeneration. Modified: trunk/reactos/include/psdk/winnt.h Modified: trunk/reactos/include/psdk/winnt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=6…
============================================================================== --- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Sun Aug 31 15:57:16 2014 @@ -15,7 +15,7 @@ #include <excpt.h> #include <basetsd.h> #include <guiddef.h> -#include "intrin.h" +#include <intrin.h> #undef __need_wchar_t #include <winerror.h> @@ -26,7 +26,10 @@ #endif +/* Defines the "size" of an any-size array */ +#ifndef ANYSIZE_ARRAY #define ANYSIZE_ARRAY 1 +#endif #ifndef __ANONYMOUS_DEFINED #define __ANONYMOUS_DEFINED @@ -101,7 +104,7 @@ #define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG) #define MEMORY_ALLOCATION_ALIGNMENT 16 #else -#define MAX_NATURAL_ALIGNMENT sizeof(ULONG) + #define MAX_NATURAL_ALIGNMENT sizeof(DWORD) #define MEMORY_ALLOCATION_ALIGNMENT 8 #endif @@ -139,11 +142,15 @@ #endif #if defined(_AMD64_) || defined(_X86_) -#define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT(ULONG) + #define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT(DWORD) #elif defined(_IA64_) || defined(_ARM_) -#define PROBE_ALIGNMENT(_s) max((TYPE_ALIGNMENT(_s), TYPE_ALIGNMENT(ULONG)) + #define PROBE_ALIGNMENT(_s) max((TYPE_ALIGNMENT(_s), TYPE_ALIGNMENT(DWORD)) #else #error "unknown architecture" +#endif + +#if defined(_WIN64) + #define PROBE_ALIGNMENT32(_s) TYPE_ALIGNMENT(DWORD) #endif #ifdef __cplusplus @@ -179,6 +186,13 @@ #endif #endif /* DECLSPEC_ADDRSAFE */ +#ifndef DECLSPEC_NOTHROW + #if !defined(MIDL_PASS) + #define DECLSPEC_NOTHROW __declspec(nothrow) + #else + #define DECLSPEC_NOTHROW + #endif +#endif #ifndef NOP_FUNCTION #if (_MSC_VER >= 1210) @@ -226,6 +240,25 @@ # endif #endif /* DECLSPEC_ALIGN */ +#ifndef SYSTEM_CACHE_ALIGNMENT_SIZE + #if defined(_AMD64_) || defined(_X86_) + #define SYSTEM_CACHE_ALIGNMENT_SIZE 64 + #else + #define SYSTEM_CACHE_ALIGNMENT_SIZE 128 + #endif +#endif /* SYSTEM_CACHE_ALIGNMENT_SIZE */ + +#ifndef DECLSPEC_CACHEALIGN + #define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE) +#endif /* DECLSPEC_CACHEALIGN */ + +#ifndef DECLSPEC_UUID + #if defined(_MSC_VER) && defined(__cplusplus) + #define DECLSPEC_UUID(x) __declspec(uuid(x)) + #else + #define DECLSPEC_UUID(x) + #endif +#endif /* DECLSPEC_UUID */ #ifndef DECLSPEC_NOVTABLE # if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined(__cplusplus) @@ -243,6 +276,32 @@ #endif #endif +#ifndef DECLSPEC_DEPRECATED + #if (defined(_MSC_VER) || defined(__GNUC__)) && !defined(MIDL_PASS) + #define DECLSPEC_DEPRECATED __declspec(deprecated) + #define DEPRECATE_SUPPORTED + #else + #define DECLSPEC_DEPRECATED + #undef DEPRECATE_SUPPORTED + #endif +#endif /* DECLSPEC_DEPRECATED */ + +#ifdef DEPRECATE_DDK_FUNCTIONS + #ifdef _NTDDK_ + #define DECLSPEC_DEPRECATED_DDK DECLSPEC_DEPRECATED + #ifdef DEPRECATE_SUPPORTED + #define PRAGMA_DEPRECATED_DDK 1 + #endif + #else + #define DECLSPEC_DEPRECATED_DDK + #define PRAGMA_DEPRECATED_DDK 1 + #endif +#else + #define DECLSPEC_DEPRECATED_DDK + #define PRAGMA_DEPRECATED_DDK 0 +#endif /* DEPRECATE_DDK_FUNCTIONS */ + +/* Use to silence unused variable warnings when it is intentional */ #define UNREFERENCED_PARAMETER(P) {(P)=(P);} #define UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L)) #define DBG_UNREFERENCED_PARAMETER(P) {(P)=(P);} @@ -366,6 +425,22 @@ typedef PDWORD PLCID; typedef WORD LANGID; +#ifndef __COMPARTMENT_ID_DEFINED__ +#define __COMPARTMENT_ID_DEFINED__ +typedef enum +{ + UNSPECIFIED_COMPARTMENT_ID = 0, + DEFAULT_COMPARTMENT_ID +} COMPARTMENT_ID, *PCOMPARTMENT_ID; +#endif /* __COMPARTMENT_ID_DEFINED__ */ + +#ifndef __OBJECTID_DEFINED +#define __OBJECTID_DEFINED +typedef struct _OBJECTID { + GUID Lineage; + DWORD Uniquifier; +} OBJECTID; +#endif /* __OBJECTID_DEFINED */ #ifdef _M_PPC #define LARGE_INTEGER_ORDER(x) x HighPart; DWORD LowPart; @@ -414,21 +489,23 @@ #define UNICODE_STRING_MAX_CHARS (32767) +/* Doubly Linked Lists */ typedef struct _LIST_ENTRY { struct _LIST_ENTRY *Flink; struct _LIST_ENTRY *Blink; } LIST_ENTRY, *PLIST_ENTRY, *RESTRICTED_POINTER PRLIST_ENTRY; -typedef struct _LIST_ENTRY32 { +typedef struct LIST_ENTRY32 { DWORD Flink; DWORD Blink; } LIST_ENTRY32,*PLIST_ENTRY32; -typedef struct _LIST_ENTRY64 { +typedef struct LIST_ENTRY64 { ULONGLONG Flink; ULONGLONG Blink; } LIST_ENTRY64,*PLIST_ENTRY64; +/* Singly Linked Lists */ typedef struct _SINGLE_LIST_ENTRY { struct _SINGLE_LIST_ENTRY *Next; } SINGLE_LIST_ENTRY,*PSINGLE_LIST_ENTRY; @@ -439,6 +516,8 @@ BYTE Number; BYTE Reserved; } PROCESSOR_NUMBER, *PPROCESSOR_NUMBER; + +#define ALL_PROCESSOR_GROUPS 0xffff typedef _IRQL_requires_same_ @@ -514,7 +593,7 @@ #define MAXBYTE 0xff #define MAXWORD 0xffff #define MAXDWORD 0xffffffff -#define MAXLONGLONG (((LONGLONG)0x7fffffff << 32) | 0xffffffff) +#define MAXLONGLONG (0x7fffffffffffffffLL) #ifdef _HAVE_INT64 #define Int32x32To64(a,b) ((LONGLONG)(a)*(LONGLONG)(b)) @@ -554,9 +633,7 @@ #define VER_SUITE_COMPUTE_SERVER 16384 #define VER_SUITE_WH_SERVER 32768 -/* - * Product types - */ +/* Product types */ #define PRODUCT_UNDEFINED 0x00000000 #define PRODUCT_ULTIMATE 0x00000001 #define PRODUCT_HOME_BASIC 0x00000002 @@ -595,7 +672,6 @@ #define PRODUCT_SERVER_FOR_SMALLBUSINESS_V 0x00000023 #define PRODUCT_STANDARD_SERVER_V 0x00000024 #define PRODUCT_DATACENTER_SERVER_V 0x00000025 -#define PRODUCT_SERVER_V 0x00000025 #define PRODUCT_ENTERPRISE_SERVER_V 0x00000026 #define PRODUCT_DATACENTER_SERVER_CORE_V 0x00000027 #define PRODUCT_STANDARD_SERVER_CORE_V 0x00000028 @@ -615,6 +691,7 @@ #define PRODUCT_SB_SOLUTION_SERVER_EM 0x00000036 #define PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM 0x00000037 #define PRODUCT_SOLUTION_EMBEDDEDSERVER 0x00000038 +#define PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE 0x00000039 #define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT 0x0000003B #define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL 0x0000003C #define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC 0x0000003D @@ -634,12 +711,20 @@ #define PRODUCT_STANDARD_EVALUATION_SERVER 0x0000004F #define PRODUCT_DATACENTER_EVALUATION_SERVER 0x00000050 #define PRODUCT_ENTERPRISE_N_EVALUATION 0x00000054 +#define PRODUCT_EMBEDDED_AUTOMOTIVE 0x00000055 +#define PRODUCT_EMBEDDED_INDUSTRY_A 0x00000056 +#define PRODUCT_THINPC 0x00000057 +#define PRODUCT_EMBEDDED_A 0x00000058 +#define PRODUCT_EMBEDDED_INDUSTRY 0x00000059 +#define PRODUCT_EMBEDDED_E 0x0000005A +#define PRODUCT_EMBEDDED_INDUSTRY_E 0x0000005B +#define PRODUCT_EMBEDDED_INDUSTRY_A_E 0x0000005C #define PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER 0x0000005F #define PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER 0x00000060 #define PRODUCT_CORE_ARM 0x00000061 #define PRODUCT_CORE_N 0x00000062 #define PRODUCT_CORE_COUNTRYSPECIFIC 0x00000063 -#define PRODUCT_CORE_LANGUAGESPECIFIC 0x00000064 +#define PRODUCT_CORE_SINGLELANGUAGE 0x00000064 #define PRODUCT_CORE 0x00000065 #define PRODUCT_PROFESSIONAL_WMC 0x00000067 #define PRODUCT_UNLICENSED 0xABCDABCD @@ -652,9 +737,10 @@ #define SORTIDFROMLCID(l) ((WORD)((((DWORD)(l))&NLS_VALID_LOCALE_MASK)>>16)) #define SORTVERSIONFROMLCID(l) ((WORD)((((DWORD)(l))>>20)&0xf)) -#define NLS_VALID_LOCALE_MASK 1048575 +#define NLS_VALID_LOCALE_MASK 0x000fffff #define LOCALE_NAME_MAX_LENGTH 85 +/* Primary language IDs. */ #define LANG_NEUTRAL 0x00 #define LANG_INVARIANT 0x7f #define LANG_AFRIKAANS 0x36 @@ -665,19 +751,23 @@ #define LANG_ARMENIAN 0x2b #define LANG_ASSAMESE 0x4d #define LANG_AZERI 0x2c +#define LANG_AZERBAIJANI 0x2c +#define LANG_BANGLA 0x45 #define LANG_BASHKIR 0x6d #define LANG_BASQUE 0x2d #define LANG_BELARUSIAN 0x23 #define LANG_BENGALI 0x45 #define LANG_BOSNIAN 0x1a +#define LANG_BOSNIAN_NEUTRAL 0x781a #define LANG_BRETON 0x7e #define LANG_BULGARIAN 0x02 #define LANG_CATALAN 0x03 +#define LANG_CENTRAL_KURDISH 0x92 +#define LANG_CHEROKEE 0x5c #define LANG_CHINESE 0x04 #define LANG_CHINESE_SIMPLIFIED 0x04 #define LANG_CHINESE_TRADITIONAL 0x7c04 #define LANG_CORSICAN 0x83 -#define LANG_CROATIAN 0x1a #define LANG_CROATIAN 0x1a #define LANG_CZECH 0x05 #define LANG_DANISH 0x06 @@ -687,10 +777,12 @@ #define LANG_ENGLISH 0x09 #define LANG_ESTONIAN 0x25 #define LANG_FAEROESE 0x38 +#define LANG_FARSI 0x29 #define LANG_FILIPINO 0x64 #define LANG_FINNISH 0x0b #define LANG_FRENCH 0x0c #define LANG_FRISIAN 0x62 +#define LANG_FULAH 0x67 #define LANG_GALICIAN 0x56 #define LANG_GEORGIAN 0x37 #define LANG_GERMAN 0x07 @@ -698,6 +790,7 @@ #define LANG_GREENLANDIC 0x6f #define LANG_GUJARATI 0x47 #define LANG_HAUSA 0x68 +#define LANG_HAWAIIAN 0x75 #define LANG_HEBREW 0x0d #define LANG_HINDI 0x39 #define LANG_HUNGARIAN 0x0e @@ -735,27 +828,29 @@ #define LANG_NEPALI 0x61 #define LANG_NORWEGIAN 0x14 #define LANG_OCCITAN 0x82 +#define LANG_ODIA 0x48 #define LANG_ORIYA 0x48 #define LANG_PASHTO 0x63 -#define LANG_FARSI 0x29 #define LANG_PERSIAN 0x29 #define LANG_POLISH 0x15 #define LANG_PORTUGUESE 0x16 +#define LANG_PULAR 0x67 #define LANG_PUNJABI 0x46 #define LANG_QUECHUA 0x6b #define LANG_ROMANIAN 0x18 #define LANG_ROMANSH 0x17 #define LANG_RUSSIAN 0x19 +#define LANG_SAKHA 0x85 #define LANG_SAMI 0x3b #define LANG_SANSKRIT 0x4f #define LANG_SCOTTISH_GAELIC 0x91 #define LANG_SERBIAN 0x1a -#define LANG_SOTHO 0x6c -#define LANG_TSWANA 0x32 +#define LANG_SERBIAN_NEUTRAL 0x7c1a #define LANG_SINDHI 0x59 #define LANG_SINHALESE 0x5b #define LANG_SLOVAK 0x1b #define LANG_SLOVENIAN 0x24 +#define LANG_SOTHO 0x6c #define LANG_SPANISH 0x0a #define LANG_SWAHILI 0x41 #define LANG_SWEDISH 0x1d @@ -768,6 +863,8 @@ #define LANG_THAI 0x1e #define LANG_TIBETAN 0x51 #define LANG_TIGRIGNA 0x73 +#define LANG_TIGRINYA 0x73 +#define LANG_TSWANA 0x32 #define LANG_TURKISH 0x1f #define LANG_TURKMEN 0x42 #define LANG_UIGHUR 0x80 @@ -775,6 +872,7 @@ #define LANG_UPPER_SORBIAN 0x2e #define LANG_URDU 0x20 #define LANG_UZBEK 0x43 +#define LANG_VALENCIAN 0x03 #define LANG_VIETNAMESE 0x2a #define LANG_WELSH 0x52 #define LANG_WOLOF 0x88 @@ -1012,27 +1110,33 @@ #define SUBLANG_YORUBA_NIGERIA 0x01 #define SUBLANG_ZULU_SOUTH_AFRICA 0x01 -#define SORT_DEFAULT 0 -#define SORT_JAPANESE_XJIS 0 -#define SORT_JAPANESE_UNICODE 1 -#define SORT_CHINESE_BIG5 0 -#define SORT_CHINESE_PRCP 0 -#define SORT_CHINESE_UNICODE 1 -#define SORT_CHINESE_PRC 2 -#define SORT_CHINESE_BOPOMOFO 3 -#define SORT_KOREAN_KSC 0 -#define SORT_KOREAN_UNICODE 1 -#define SORT_GERMAN_PHONE_BOOK 1 -#define SORT_HUNGARIAN_DEFAULT 0 -#define SORT_HUNGARIAN_TECHNICAL 1 -#define SORT_GEORGIAN_TRADITIONAL 0 -#define SORT_GEORGIAN_MODERN 1 +#define SORT_DEFAULT 0x0 +#define SORT_INVARIANT_MATH 0x1 +#define SORT_JAPANESE_XJIS 0x0 +#define SORT_JAPANESE_UNICODE 0x1 +#define SORT_JAPANESE_RADICALSTROKE 0x4 +#define SORT_CHINESE_BIG5 0x0 +#define SORT_CHINESE_PRCP 0x0 +#define SORT_CHINESE_UNICODE 0x1 +#define SORT_CHINESE_PRC 0x2 +#define SORT_CHINESE_BOPOMOFO 0x3 +#define SORT_CHINESE_RADICALSTROKE 0x4 +#define SORT_KOREAN_KSC 0x0 +#define SORT_KOREAN_UNICODE 0x1 +#define SORT_GERMAN_PHONE_BOOK 0x1 +#define SORT_HUNGARIAN_DEFAULT 0x0 +#define SORT_HUNGARIAN_TECHNICAL 0x1 +#define SORT_GEORGIAN_TRADITIONAL 0x0 +#define SORT_GEORGIAN_MODERN 0x1 #define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT) #define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT) #define LOCALE_SYSTEM_DEFAULT MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT) #define LOCALE_USER_DEFAULT MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT) +#define LOCALE_CUSTOM_DEFAULT MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_DEFAULT), SORT_DEFAULT) +#define LOCALE_CUSTOM_UNSPECIFIED MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_UNSPECIFIED), SORT_DEFAULT) +#define LOCALE_CUSTOM_UI_DEFAULT MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_UI_CUSTOM_DEFAULT), SORT_DEFAULT) #define LOCALE_NEUTRAL MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT) #define LOCALE_INVARIANT MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT) @@ -1833,7 +1937,6 @@ #define RTL_CRITSECT_TYPE 0 #define RTL_RESOURCE_TYPE 1 -/* end winddk.h */ #define IMAGE_SIZEOF_FILE_HEADER 20 #define IMAGE_FILE_RELOCS_STRIPPED 1 #define IMAGE_FILE_EXECUTABLE_IMAGE 2 @@ -2909,13 +3012,13 @@ typedef struct _UNWIND_HISTORY_TABLE_ENTRY { - ULONG64 ImageBase; + DWORD64 ImageBase; PRUNTIME_FUNCTION FunctionEntry; } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY; typedef struct _UNWIND_HISTORY_TABLE { - ULONG Count; + DWORD Count; UCHAR Search; ULONG64 LowAddress; ULONG64 HighAddress; @@ -3166,16 +3269,16 @@ /* These are the debug or break registers on the SH3 */ typedef struct _DEBUG_REGISTERS { - ULONG BarA; + DWORD BarA; UCHAR BasrA; UCHAR BamrA; USHORT BbrA; - ULONG BarB; + DWORD BarB; UCHAR BasrB; UCHAR BamrB; USHORT BbrB; - ULONG BdrB; - ULONG BdmrB; + DWORD BdrB; + DWORD BdmrB; USHORT Brcr; USHORT Align; } DEBUG_REGISTERS, *PDEBUG_REGISTERS; @@ -3221,7 +3324,7 @@ /* The context record is never used as an OUT only parameter. */ - ULONG ContextFlags; + DWORD ContextFlags; /* This section is specified/returned if the ContextFlags word contains */ /* the flag CONTEXT_INTEGER. */ @@ -3230,26 +3333,26 @@ /* considered part of the control context rather than part of the integer */ /* context. */ - ULONG PR; - ULONG MACH; - ULONG MACL; - ULONG GBR; - ULONG R0; - ULONG R1; - ULONG R2; - ULONG R3; - ULONG R4; - ULONG R5; - ULONG R6; - ULONG R7; - ULONG R8; - ULONG R9; - ULONG R10; - ULONG R11; - ULONG R12; - ULONG R13; - ULONG R14; - ULONG R15; + DWORD PR; + DWORD MACH; + DWORD MACL; + DWORD GBR; + DWORD R0; + DWORD R1; + DWORD R2; + DWORD R3; + DWORD R4; + DWORD R5; + DWORD R6; + DWORD R7; + DWORD R8; + DWORD R9; + DWORD R10; + DWORD R11; + DWORD R12; + DWORD R13; + DWORD R14; + DWORD R15; /* This section is specified/returned if the ContextFlags word contains */ /* the flag CONTEXT_CONTROL. */ @@ -3258,18 +3361,18 @@ /* but are considered part of the control context rather than part of */ /* the integer context. */ - ULONG Fir; - ULONG Psr; + DWORD Fir; + DWORD Psr; #if !defined(SH3e) && !defined(SH4) - ULONG OldStuff[2]; + DWORD OldStuff[2]; DEBUG_REGISTERS DebugRegisters; #else - ULONG Fpscr; - ULONG Fpul; - ULONG FRegs[16]; + DWORD Fpscr; + DWORD Fpul; + DWORD FRegs[16]; #if defined(SH4) - ULONG xFRegs[16]; + DWORD xFRegs[16]; #endif #endif } CONTEXT; @@ -3453,28 +3556,28 @@ The context record is never used as an OUT only parameter. */ - ULONG ContextFlags; + DWORD ContextFlags; /* This section is specified/returned if the ContextFlags word contains the flag CONTEXT_INTEGER. */ - ULONG R0; - ULONG R1; - ULONG R2; - ULONG R3; - ULONG R4; - ULONG R5; - ULONG R6; - ULONG R7; - ULONG R8; - ULONG R9; - ULONG R10; - ULONG R11; - ULONG R12; - - ULONG Sp; - ULONG Lr; - ULONG Pc; - ULONG Psr; + DWORD R0; + DWORD R1; + DWORD R2; + DWORD R3; + DWORD R4; + DWORD R5; + DWORD R6; + DWORD R7; + DWORD R8; + DWORD R9; + DWORD R10; + DWORD R11; + DWORD R12; + + DWORD Sp; + DWORD Lr; + DWORD Pc; + DWORD Psr; } CONTEXT; #else @@ -3767,6 +3870,14 @@ LARGE_INTEGER TimeLimit; } QUOTA_LIMITS,*PQUOTA_LIMITS; +typedef union _RATE_QUOTA_LIMIT { + DWORD RateData; + struct { + DWORD RatePercent : 7; + DWORD Reserved0 : 25; + } DUMMYSTRUCTNAME; +} RATE_QUOTA_LIMIT, *PRATE_QUOTA_LIMIT; + typedef struct _QUOTA_LIMITS_EX { SIZE_T PagedPoolLimit; SIZE_T NonPagedPoolLimit; @@ -3778,8 +3889,8 @@ SIZE_T Reserved2; SIZE_T Reserved3; SIZE_T Reserved4; - ULONG Flags; - ULONG Reserved5; + DWORD Flags; + RATE_QUOTA_LIMIT CpuRateLimit; } QUOTA_LIMITS_EX, *PQUOTA_LIMITS_EX; typedef struct _IO_COUNTERS { @@ -3826,8 +3937,8 @@ } TAPE_GET_MEDIA_PARAMETERS, *PTAPE_GET_MEDIA_PARAMETERS; typedef struct _TAPE_GET_POSITION { - ULONG Type; - ULONG Partition; + DWORD Type; + DWORD Partition; LARGE_INTEGER Offset; } TAPE_GET_POSITION, *PTAPE_GET_POSITION; @@ -5265,6 +5376,7 @@ DWORD DefaultAlert2; } SYSTEM_BATTERY_STATE, *PSYSTEM_BATTERY_STATE; +// FIXME: This should not be here! typedef struct _PROCESSOR_POWER_INFORMATION { ULONG Number; ULONG MaxMhz; @@ -5274,7 +5386,7 @@ ULONG CurrentIdleState; } PROCESSOR_POWER_INFORMATION, *PPROCESSOR_POWER_INFORMATION; -typedef DWORD EXECUTION_STATE; +typedef DWORD EXECUTION_STATE, *PEXECUTION_STATE; typedef enum _POWER_INFORMATION_LEVEL { SystemPowerPolicyAc, @@ -5595,7 +5707,19 @@ #endif } #elif defined (_M_ARM) - PVOID WINAPI GetCurrentFiber(VOID); +#define CP15_PMSELR 15, 0, 9, 12, 5 +#define CP15_PMXEVCNTR 15, 0, 9, 13, 2 +#define CP15_TPIDRURW 15, 0, 13, 0, 2 +#define CP15_TPIDRURO 15, 0, 13, 0, 3 +#define CP15_TPIDRPRW 15, 0, 13, 0, 4 +FORCEINLINE struct _TEB * NtCurrentTeb(void) +{ + return (struct _TEB *)(ULONG_PTR)_MoveFromCoprocessor(CP15_TPIDRURW); +} +FORCEINLINE PVOID GetCurrentFiber(VOID) +{ + return ((PNT_TIB )(ULONG_PTR)_MoveFromCoprocessor(CP15_TPIDRURW))->FiberData; +} #elif defined(_M_PPC) FORCEINLINE unsigned long _read_teb_dword(const unsigned long Offset) { @@ -5619,7 +5743,7 @@ #error Unknown architecture #endif -static __inline PVOID GetFiberData(void) +FORCEINLINE PVOID GetFiberData(void) { return *((PVOID *)GetCurrentFiber()); }
10 years
1
0
0
0
[hbelusca] 64012: Code formatting only.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Aug 31 14:57:43 2014 New Revision: 64012 URL:
http://svn.reactos.org/svn/reactos?rev=64012&view=rev
Log: Code formatting only. Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.c branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/terminal.c branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h branches/condrv_restructure/win32ss/user/winsrv/consrv/procinit.h Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.c [iso-8859-1] Sun Aug 31 14:57:43 2014 @@ -474,7 +474,8 @@ lpTarget = (ConsoleAliasRequest->TargetLength != 0 ? ConsoleAliasRequest->Target : NULL); - Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); + Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), + &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; Status = STATUS_SUCCESS; @@ -570,7 +571,8 @@ return STATUS_INVALID_PARAMETER; } - Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); + Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), + &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; Header = IntFindAliasHeader(Console, @@ -647,7 +649,8 @@ return STATUS_INVALID_PARAMETER; } - Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); + Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), + &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; Header = IntFindAliasHeader(Console, @@ -747,7 +750,8 @@ return STATUS_INVALID_PARAMETER; } - Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); + Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), + &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; Header = IntFindAliasHeader(Console, @@ -787,7 +791,8 @@ return STATUS_INVALID_PARAMETER; } - Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); + Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), + &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; if (IntGetConsoleAliasesExesLength(Console->Aliases, GetAliasesExesRequest->Unicode) > GetAliasesExesRequest->Length) @@ -864,7 +869,8 @@ DPRINT1("SrvGetConsoleAliasExesLength entered ApiMessage %p\n", ApiMessage); - Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); + Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), + &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; GetAliasesExesLengthRequest->Length = Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/terminal.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/terminal.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/terminal.c [iso-8859-1] Sun Aug 31 14:57:43 2014 @@ -137,7 +137,7 @@ * NOTE: Each entry of the table should be retrieved when loading a front-end * (examples of the CSR servers which register some data for CSRSS). */ -struct +static struct { CHAR FrontEndName[80]; FRONTEND_LOAD FrontEndLoad; Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] Sun Aug 31 14:57:43 2014 @@ -300,12 +300,13 @@ typedef struct _CONSOLE { /******************************* Console Set-up *******************************/ + +#ifndef USE_NEW_CONSOLE_WAY + WINSRV_CONSOLE; // HACK HACK!! +#endif + LONG ReferenceCount; /* Is incremented each time a handle to something in the console (a screen-buffer or the input buffer of this console) gets referenced */ CRITICAL_SECTION Lock; - -#ifndef USE_NEW_CONSOLE_WAY - /**/WINSRV_CONSOLE;/**/ // HACK HACK!! -#endif CONSOLE_STATE State; /* State of the console */ TERMINAL TermIFace; /* Frontend-specific interface */ Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h [iso-8859-1] Sun Aug 31 14:57:43 2014 @@ -131,7 +131,8 @@ /* This **MUST** be FIRST!! */ #ifdef USE_NEW_CONSOLE_WAY CONSOLE; - // PCONSOLE Console; + // CONSOLE Console; + // // PCONSOLE Console; #endif // LONG ReferenceCount; /* Is incremented each time a handle to something in the console (a screen-buffer or the input buffer of this console) gets referenced */ Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/procinit.h URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/procinit.h [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/procinit.h [iso-8859-1] Sun Aug 31 14:57:43 2014 @@ -9,14 +9,14 @@ #pragma once NTSTATUS ConSrvAllocateConsole(PCONSOLE_PROCESS_DATA ProcessData, - PHANDLE pInputHandle, - PHANDLE pOutputHandle, - PHANDLE pErrorHandle, - PCONSOLE_START_INFO ConsoleStartInfo); + PHANDLE pInputHandle, + PHANDLE pOutputHandle, + PHANDLE pErrorHandle, + PCONSOLE_START_INFO ConsoleStartInfo); NTSTATUS ConSrvInheritConsole(PCONSOLE_PROCESS_DATA ProcessData, - HANDLE ConsoleHandle, - BOOLEAN CreateNewHandlesTable, - PHANDLE pInputHandle, - PHANDLE pOutputHandle, - PHANDLE pErrorHandle); + HANDLE ConsoleHandle, + BOOLEAN CreateNewHandlesTable, + PHANDLE pInputHandle, + PHANDLE pOutputHandle, + PHANDLE pErrorHandle); VOID ConSrvRemoveConsole(PCONSOLE_PROCESS_DATA ProcessData);
10 years
1
0
0
0
[hbelusca] 64011: [CONSRV]: Continuing code refactoring of revisions 63866, 63867, 63868 and 63874.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Aug 31 14:04:03 2014 New Revision: 64011 URL:
http://svn.reactos.org/svn/reactos?rev=64011&view=rev
Log: [CONSRV]: Continuing code refactoring of revisions 63866, 63867, 63868 and 63874. Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.c branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/console.c branches/condrv_restructure/win32ss/user/winsrv/consrv/coninput.c branches/condrv_restructure/win32ss/user/winsrv/consrv/conoutput.c branches/condrv_restructure/win32ss/user/winsrv/consrv/console.c branches/condrv_restructure/win32ss/user/winsrv/consrv/console.h branches/condrv_restructure/win32ss/user/winsrv/consrv/consrv.h branches/condrv_restructure/win32ss/user/winsrv/consrv/frontendctl.c branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/terminal.c branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h branches/condrv_restructure/win32ss/user/winsrv/consrv/init.c Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/alias.c [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -34,7 +34,7 @@ BOOLEAN -ConvertInputAnsiToUnicode(PCONSOLE Console, +ConvertInputAnsiToUnicode(PCONSRV_CONSOLE Console, PVOID Source, USHORT SourceLength, // BOOLEAN IsUnicode, @@ -61,7 +61,7 @@ } BOOLEAN -ConvertInputUnicodeToAnsi(PCONSOLE Console, +ConvertInputUnicodeToAnsi(PCONSRV_CONSOLE Console, PVOID Source, USHORT SourceLength, // BOOLEAN IsAnsi, Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/console.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/condrv/console.c [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -460,7 +460,6 @@ /* Discard all entries in the input event queue */ PurgeInputBuffer(Console); - if (Console->LineBuffer) ConsoleFreeHeap(Console->LineBuffer); /* Delete the last screen buffer */ ConioDeleteScreenBuffer(Console->ActiveBuffer); Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/coninput.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/coninput.c [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -158,7 +158,7 @@ IN ULONG NumEventsToWrite, OUT PULONG NumEventsWritten OPTIONAL); static NTSTATUS -ConioAddInputEvents(PCONSOLE Console, +ConioAddInputEvents(PCONSRV_CONSOLE Console, PINPUT_RECORD InputRecords, // InputEvent ULONG NumEventsToWrite, PULONG NumEventsWritten, @@ -177,7 +177,7 @@ // NumEventsWritten, // AppendToEnd); - Status = ConDrvWriteConsoleInput(Console, + Status = ConDrvWriteConsoleInput((PCONSOLE)Console, &Console->InputBuffer, AppendToEnd, InputRecords, @@ -192,7 +192,7 @@ /* FIXME: This function can be called by CONDRV, in ConioResizeBuffer() in text.c */ NTSTATUS -ConioProcessInputEvent(PCONSOLE Console, +ConioProcessInputEvent(PCONSRV_CONSOLE Console, PINPUT_RECORD InputEvent) { ULONG NumEventsWritten; @@ -213,13 +213,14 @@ if (CreateWaitBlock) { PGET_INPUT_INFO CapturedInputInfo; + PCONSRV_CONSOLE Console = (PCONSRV_CONSOLE)InputInfo->InputBuffer->Header.Console; CapturedInputInfo = ConsoleAllocHeap(0, sizeof(GET_INPUT_INFO)); if (!CapturedInputInfo) return STATUS_NO_MEMORY; RtlMoveMemory(CapturedInputInfo, InputInfo, sizeof(GET_INPUT_INFO)); - if (!CsrCreateWait(&InputInfo->InputBuffer->Header.Console->ReadWaitQueue, + if (!CsrCreateWait(&Console->ReadWaitQueue, WaitFunction, InputInfo->CallingThread, ApiMessage, @@ -728,7 +729,7 @@ /* Now, add the events */ NumEventsWritten = 0; - Status = ConioAddInputEvents(InputBuffer->Header.Console, + Status = ConioAddInputEvents((PCONSRV_CONSOLE)InputBuffer->Header.Console, // InputBuffer, InputRecord, WriteInputRequest->NumRecords, Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/conoutput.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -252,7 +252,7 @@ } Status = ConDrvCreateScreenBuffer(&Buff, - Console, + (PCONSOLE)Console, CreateScreenBufferRequest->ScreenBufferType, ScreenBufferInfo); if (!NT_SUCCESS(Status)) goto Quit; @@ -417,7 +417,9 @@ { if (CreateWaitBlock) { - if (!CsrCreateWait(&ScreenBuffer->Header.Console->WriteWaitQueue, + PCONSRV_CONSOLE Console = (PCONSRV_CONSOLE)ScreenBuffer->Header.Console; + + if (!CsrCreateWait(&Console->WriteWaitQueue, WriteConsoleThread, ClientThread, ApiMessage, Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/console.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/console.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/console.c [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -472,6 +472,9 @@ /* Remove the console from the list */ RemoveConsoleByPointer(Console); + + /* Clean the Input Line Discipline */ + if (Console->LineBuffer) ConsoleFreeHeap(Console->LineBuffer); /* Clean aliases and history */ IntDeleteAllAliases(Console); Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/console.h URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/console.h [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/console.h [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -13,22 +13,22 @@ NTSTATUS NTAPI ConSrvInitConsole(OUT PHANDLE NewConsoleHandle, - OUT struct _CONSOLE** /* PCONSOLE* */ NewConsole, + OUT struct _CONSRV_CONSOLE** /* PCONSRV_CONSOLE* */ NewConsole, IN OUT PCONSOLE_START_INFO ConsoleStartInfo, IN ULONG ConsoleLeaderProcessId); -VOID NTAPI ConSrvDeleteConsole(struct _CONSOLE* /* PCONSOLE */ Console); +VOID NTAPI ConSrvDeleteConsole(struct _CONSRV_CONSOLE* /* PCONSRV_CONSOLE */ Console); NTSTATUS ConSrvGetConsole(IN PCONSOLE_PROCESS_DATA ProcessData, - OUT struct _CONSOLE** /* PCONSOLE* */ Console, + OUT struct _CONSRV_CONSOLE** /* PCONSRV_CONSOLE* */ Console, IN BOOLEAN LockConsole); VOID -ConSrvReleaseConsole(IN struct _CONSOLE* /* PCONSOLE */ Console, +ConSrvReleaseConsole(IN struct _CONSRV_CONSOLE* /* PCONSRV_CONSOLE */ Console, IN BOOLEAN WasConsoleLocked); BOOLEAN NTAPI -ConSrvValidateConsole(OUT struct _CONSOLE** /* PCONSOLE* */ Console, +ConSrvValidateConsole(OUT struct _CONSRV_CONSOLE** /* PCONSRV_CONSOLE* */ Console, IN HANDLE ConsoleHandle, IN CONSOLE_STATE ExpectedState, IN BOOLEAN LockConsole); Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/consrv.h URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/consrv.h [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/consrv.h [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -66,8 +66,16 @@ LPTHREAD_START_ROUTINE PropDispatcher; // We hold the property dialog handler there, till all the GUI thingie moves out from CSRSS. } CONSOLE_PROCESS_DATA, *PCONSOLE_PROCESS_DATA; + +// Helper for code refactoring +// #define USE_NEW_CONSOLE_WAY + +#ifndef USE_NEW_CONSOLE_WAY #include "include/conio.h" -// #include "include/conio_winsrv.h" +#else +#include "include/conio_winsrv.h" +#endif + #include "include/console.h" #include "include/settings.h" #include "include/term.h" Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontendctl.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontendctl.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontendctl.c [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -143,7 +143,7 @@ TRUE); if (!NT_SUCCESS(Status)) return Status; - Console = Buff->Header.Console; + Console = (PCONSRV_CONSOLE)Buff->Header.Console; if (TermSetDisplayMode(Console, SetDisplayModeRequest->DisplayMode)) { @@ -163,14 +163,14 @@ { NTSTATUS Status; PCONSOLE_GETLARGESTWINDOWSIZE GetLargestWindowSizeRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetLargestWindowSizeRequest; - PCONSOLE_SCREEN_BUFFER Buff; - PCONSRV_CONSOLE Console; + PCONSOLE /*PCONSRV_CONSOLE*/ Console; + PCONSOLE_SCREEN_BUFFER Buff; Status = ConSrvGetTextModeBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), - GetLargestWindowSizeRequest->OutputHandle, - &Buff, - GENERIC_READ, - TRUE); + GetLargestWindowSizeRequest->OutputHandle, + &Buff, + GENERIC_READ, + TRUE); if (!NT_SUCCESS(Status)) return Status; Console = Buff->Header.Console; @@ -184,7 +184,7 @@ { NTSTATUS Status; PCONSOLE_SHOWCURSOR ShowCursorRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ShowCursorRequest; - PCONSRV_CONSOLE Console; + PCONSOLE /*PCONSRV_CONSOLE*/ Console; PCONSOLE_SCREEN_BUFFER Buff; Status = ConSrvGetScreenBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process), @@ -220,7 +220,7 @@ TRUE); if (!NT_SUCCESS(Status)) return Status; - Console = Buff->Header.Console; + Console = (PCONSRV_CONSOLE)Buff->Header.Console; Success = TermSetMouseCursor(Console, SetCursorRequest->CursorHandle); @@ -242,7 +242,7 @@ TRUE); if (!NT_SUCCESS(Status)) return Status; - Console = Buff->Header.Console; + Console = (PCONSRV_CONSOLE)Buff->Header.Console; MenuControlRequest->MenuHandle = TermMenuControl(Console, MenuControlRequest->CmdIdLow, @@ -275,7 +275,8 @@ PCONSOLE_GETWINDOW GetWindowRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetWindowRequest; PCONSRV_CONSOLE Console; - Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); + Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), + &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; GetWindowRequest->WindowHandle = TermGetConsoleWindowHandle(Console); @@ -290,7 +291,8 @@ PCONSOLE_SETICON SetIconRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetIconRequest; PCONSRV_CONSOLE Console; - Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); + Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), + &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; Status = (TermChangeIcon(Console, SetIconRequest->IconHandle) @@ -307,7 +309,8 @@ PCONSOLE_GETSELECTIONINFO GetSelectionInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetSelectionInfoRequest; PCONSRV_CONSOLE Console; - Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); + Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), + &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; Status = (TermGetSelectionInfo(Console, &GetSelectionInfoRequest->Info) Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/terminal.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/terminal.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/terminal.c [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -260,7 +260,7 @@ static NTSTATUS NTAPI ConSrvTermInitTerminal(IN OUT PTERMINAL This, - IN PCONSOLE Console) + IN PCONSOLE Console) { NTSTATUS Status; PFRONTEND FrontEnd = This->Data; Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -12,7 +12,7 @@ #ifdef TUITERM_COMPILE #include "consrv.h" -#include "include/conio.h" +// #include "include/conio.h" #include "include/console.h" #include "include/settings.h" #include "tuiterm.h" Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio.h [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -11,6 +11,22 @@ #pragma once #include "rect.h" + +// This is ALMOST a HACK!!!!!!! +// Helpers for code refactoring +#ifdef USE_NEW_CONSOLE_WAY + +#define _CONSRV_CONSOLE _WINSRV_CONSOLE +#define CONSRV_CONSOLE WINSRV_CONSOLE +#define PCONSRV_CONSOLE PWINSRV_CONSOLE + +#else + +#define _CONSRV_CONSOLE _CONSOLE +#define CONSRV_CONSOLE CONSOLE +#define PCONSRV_CONSOLE PCONSOLE + +#endif /* Default attributes */ #define DEFAULT_SCREEN_ATTRIB (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED) @@ -277,7 +293,9 @@ // HACK!! struct _CONSOLE; /* HACK: */ typedef struct _CONSOLE *PCONSOLE; +#ifndef USE_NEW_CONSOLE_WAY #include "conio_winsrv.h" +#endif typedef struct _CONSOLE { @@ -285,7 +303,9 @@ LONG ReferenceCount; /* Is incremented each time a handle to something in the console (a screen-buffer or the input buffer of this console) gets referenced */ CRITICAL_SECTION Lock; +#ifndef USE_NEW_CONSOLE_WAY /**/WINSRV_CONSOLE;/**/ // HACK HACK!! +#endif CONSOLE_STATE State; /* State of the console */ TERMINAL TermIFace; /* Frontend-specific interface */ @@ -325,8 +345,8 @@ /* conoutput.c */ PCHAR_INFO ConioCoordToPointer(PTEXTMODE_SCREEN_BUFFER Buff, ULONG X, ULONG Y); -VOID ConioDrawConsole(PCONSOLE Console); -NTSTATUS ConioResizeBuffer(PCONSOLE Console, +VOID ConioDrawConsole(PCONSOLE /*PCONSRV_CONSOLE*/ Console); +NTSTATUS ConioResizeBuffer(PCONSOLE /*PCONSRV_CONSOLE*/ Console, PTEXTMODE_SCREEN_BUFFER ScreenBuffer, COORD Size); Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/include/conio_winsrv.h [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -14,14 +14,19 @@ // This is ALMOST a HACK!!!!!!! // Helpers for code refactoring +#ifdef USE_NEW_CONSOLE_WAY + +#define _CONSRV_CONSOLE _WINSRV_CONSOLE +#define CONSRV_CONSOLE WINSRV_CONSOLE +#define PCONSRV_CONSOLE PWINSRV_CONSOLE + +#else + #define _CONSRV_CONSOLE _CONSOLE #define CONSRV_CONSOLE CONSOLE #define PCONSRV_CONSOLE PCONSOLE -// #define _CONSRV_CONSOLE _WINSRV_CONSOLE -// #define CONSRV_CONSOLE WINSRV_CONSOLE -// #define PCONSRV_CONSOLE PWINSRV_CONSOLE - +#endif #define CSR_DEFAULT_CURSOR_SIZE 25 @@ -33,6 +38,12 @@ } CHAR_CELL, *PCHAR_CELL; C_ASSERT(sizeof(CHAR_CELL) == 2); +// HACK!! +struct _WINSRV_CONSOLE; +/* HACK: */ typedef struct _WINSRV_CONSOLE *PWINSRV_CONSOLE; +#ifdef USE_NEW_CONSOLE_WAY +#include "conio.h" +#endif typedef struct _FRONTEND FRONTEND, *PFRONTEND; /* HACK: */ typedef struct _CONSOLE_INFO *PCONSOLE_INFO; @@ -118,8 +129,10 @@ { /******************************* Console Set-up *******************************/ /* This **MUST** be FIRST!! */ - // CONSOLE; +#ifdef USE_NEW_CONSOLE_WAY + CONSOLE; // PCONSOLE Console; +#endif // LONG ReferenceCount; /* Is incremented each time a handle to something in the console (a screen-buffer or the input buffer of this console) gets referenced */ // CRITICAL_SECTION Lock; @@ -172,7 +185,7 @@ LIST_ENTRY PopupWindows; /*List of popup windows */ COLORREF Colors[16]; /* Colour palette */ -} WINSRV_CONSOLE, *PWINSRV_CONSOLE; +} WINSRV_CONSOLE; // , *PWINSRV_CONSOLE; /* console.c */ VOID ConioPause(PCONSRV_CONSOLE Console, UINT Flags); @@ -199,8 +212,8 @@ /* conoutput.c */ PCHAR_INFO ConioCoordToPointer(PTEXTMODE_SCREEN_BUFFER Buff, ULONG X, ULONG Y); -VOID ConioDrawConsole(PCONSRV_CONSOLE Console); -NTSTATUS ConioResizeBuffer(PCONSRV_CONSOLE Console, +VOID ConioDrawConsole(PCONSOLE /*PCONSRV_CONSOLE*/ Console); +NTSTATUS ConioResizeBuffer(PCONSOLE /*PCONSRV_CONSOLE*/ Console, PTEXTMODE_SCREEN_BUFFER ScreenBuffer, COORD Size); Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/init.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/init.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/init.c [iso-8859-1] Sun Aug 31 14:04:03 2014 @@ -380,7 +380,7 @@ if (TargetProcessData->ConsoleApp /* && SourceProcessData->ConsoleApp */) { PCONSOLE_PROCESS_DATA SourceProcessData = ConsoleGetPerProcessData(SourceProcess); - PCONSOLE SourceConsole; + PCONSRV_CONSOLE SourceConsole; /* Validate and lock the parent's console */ if (ConSrvValidateConsole(&SourceConsole,
10 years
1
0
0
0
[hbelusca] 64010: [CONSRV]: Merge again ConDrvProcessKey and ConioProcessKey.
by hbelusca@svn.reactos.org
Author: hbelusca Date: Sun Aug 31 14:01:21 2014 New Revision: 64010 URL:
http://svn.reactos.org/svn/reactos?rev=64010&view=rev
Log: [CONSRV]: Merge again ConDrvProcessKey and ConioProcessKey. Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/input.c Modified: branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/input.c URL:
http://svn.reactos.org/svn/reactos/branches/condrv_restructure/win32ss/user…
============================================================================== --- branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/input.c [iso-8859-1] (original) +++ branches/condrv_restructure/win32ss/user/winsrv/consrv/frontends/input.c [iso-8859-1] Sun Aug 31 14:01:21 2014 @@ -10,7 +10,6 @@ /* INCLUDES *******************************************************************/ #include "consrv.h" -#include "include/conio.h" #include "include/term.h" #include "coninput.h" @@ -19,77 +18,6 @@ /* PRIVATE FUNCTIONS **********************************************************/ - -static VOID -ConDrvProcessKey(IN PCONSOLE Console, - IN BOOLEAN Down, - IN UINT VirtualKeyCode, - IN UINT VirtualScanCode, - IN WCHAR UnicodeChar, - IN ULONG ShiftState, - IN BYTE KeyStateCtrl) -{ - INPUT_RECORD er; - - /* process Ctrl-C and Ctrl-Break */ - if ( Console->InputBuffer.Mode & ENABLE_PROCESSED_INPUT && - Down && (VirtualKeyCode == VK_PAUSE || VirtualKeyCode == 'C') && - (ShiftState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED) || KeyStateCtrl & 0x80) ) - { - DPRINT1("Console_Api Ctrl-C\n"); - ConSrvConsoleProcessCtrlEvent(Console, 0, CTRL_C_EVENT); - - if (Console->LineBuffer && !Console->LineComplete) - { - /* Line input is in progress; end it */ - Console->LinePos = Console->LineSize = 0; - Console->LineComplete = TRUE; - } - return; - } - - if ( (ShiftState & (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED)) != 0 && - (VK_UP == VirtualKeyCode || VK_DOWN == VirtualKeyCode) ) - { - if (!Down) return; - - /* scroll up or down */ - if (VK_UP == VirtualKeyCode) - { - /* only scroll up if there is room to scroll up into */ - if (Console->ActiveBuffer->CursorPosition.Y != Console->ActiveBuffer->ScreenBufferSize.Y - 1) - { - Console->ActiveBuffer->VirtualY = (Console->ActiveBuffer->VirtualY + - Console->ActiveBuffer->ScreenBufferSize.Y - 1) % - Console->ActiveBuffer->ScreenBufferSize.Y; - Console->ActiveBuffer->CursorPosition.Y++; - } - } - else - { - /* only scroll down if there is room to scroll down into */ - if (Console->ActiveBuffer->CursorPosition.Y != 0) - { - Console->ActiveBuffer->VirtualY = (Console->ActiveBuffer->VirtualY + 1) % - Console->ActiveBuffer->ScreenBufferSize.Y; - Console->ActiveBuffer->CursorPosition.Y--; - } - } - - ConioDrawConsole(Console); - return; - } - - er.EventType = KEY_EVENT; - er.Event.KeyEvent.bKeyDown = Down; - er.Event.KeyEvent.wRepeatCount = 1; - er.Event.KeyEvent.wVirtualKeyCode = VirtualKeyCode; - er.Event.KeyEvent.wVirtualScanCode = VirtualScanCode; - er.Event.KeyEvent.uChar.UnicodeChar = UnicodeChar; - er.Event.KeyEvent.dwControlKeyState = ShiftState; - - ConioProcessInputEvent(Console, &er); -} static DWORD ConioGetShiftState(PBYTE KeyState, LPARAM lParam) @@ -138,8 +66,10 @@ UINT VirtualKeyCode; UINT VirtualScanCode; BOOL Down = FALSE; - BOOLEAN Fake; // synthesized, not a real event - BOOLEAN NotChar; // message should not be used to return a character + BOOLEAN Fake; // Synthesized, not a real event + BOOLEAN NotChar; // Message should not be used to return a character + + INPUT_RECORD er; if (NULL == Console) { @@ -172,7 +102,7 @@ 2, 0, NULL); - UnicodeChar = (1 == RetChars ? Chars[0] : 0); + UnicodeChar = (RetChars == 1 ? Chars[0] : 0); } Fake = UnicodeChar && @@ -194,14 +124,66 @@ if (Fake) return; + /* Process Ctrl-C and Ctrl-Break */ + if ( Console->InputBuffer.Mode & ENABLE_PROCESSED_INPUT && + Down && (VirtualKeyCode == VK_PAUSE || VirtualKeyCode == 'C') && + (ShiftState & (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED) || KeyState[VK_CONTROL] & 0x80) ) + { + DPRINT1("Console_Api Ctrl-C\n"); + ConSrvConsoleProcessCtrlEvent(Console, 0, CTRL_C_EVENT); + + if (Console->LineBuffer && !Console->LineComplete) + { + /* Line input is in progress; end it */ + Console->LinePos = Console->LineSize = 0; + Console->LineComplete = TRUE; + } + return; + } + + if ( (ShiftState & (RIGHT_ALT_PRESSED | LEFT_ALT_PRESSED)) != 0 && + (VirtualKeyCode == VK_UP || VirtualKeyCode == VK_DOWN) ) + { + if (!Down) return; + + /* Scroll up or down */ + if (VirtualKeyCode == VK_UP) + { + /* Only scroll up if there is room to scroll up into */ + if (Console->ActiveBuffer->CursorPosition.Y != Console->ActiveBuffer->ScreenBufferSize.Y - 1) + { + Console->ActiveBuffer->VirtualY = (Console->ActiveBuffer->VirtualY + + Console->ActiveBuffer->ScreenBufferSize.Y - 1) % + Console->ActiveBuffer->ScreenBufferSize.Y; + Console->ActiveBuffer->CursorPosition.Y++; + } + } + else + { + /* Only scroll down if there is room to scroll down into */ + if (Console->ActiveBuffer->CursorPosition.Y != 0) + { + Console->ActiveBuffer->VirtualY = (Console->ActiveBuffer->VirtualY + 1) % + Console->ActiveBuffer->ScreenBufferSize.Y; + Console->ActiveBuffer->CursorPosition.Y--; + } + } + + ConioDrawConsole((PCONSOLE)Console); + return; + } + /* Send the key press to the console driver */ - ConDrvProcessKey(Console, - Down, - VirtualKeyCode, - VirtualScanCode, - UnicodeChar, - ShiftState, - KeyState[VK_CONTROL]); + + er.EventType = KEY_EVENT; + er.Event.KeyEvent.bKeyDown = Down; + er.Event.KeyEvent.wRepeatCount = 1; + er.Event.KeyEvent.wVirtualKeyCode = VirtualKeyCode; + er.Event.KeyEvent.wVirtualScanCode = VirtualScanCode; + er.Event.KeyEvent.uChar.UnicodeChar = UnicodeChar; + er.Event.KeyEvent.dwControlKeyState = ShiftState; + + ConioProcessInputEvent(Console, &er); } DWORD
10 years
1
0
0
0
[tkreuzer] 64009: [winnt.h] Change the order of definitions to more closely match ntdef.h
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun Aug 31 13:41:14 2014 New Revision: 64009 URL:
http://svn.reactos.org/svn/reactos?rev=64009&view=rev
Log: [winnt.h] Change the order of definitions to more closely match ntdef.h Modified: trunk/reactos/include/psdk/winnt.h Modified: trunk/reactos/include/psdk/winnt.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/winnt.h?rev=6…
============================================================================== --- trunk/reactos/include/psdk/winnt.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/winnt.h [iso-8859-1] Sun Aug 31 13:41:14 2014 @@ -7,9 +7,26 @@ #endif #endif +#include <ctype.h> #ifdef __GNUC__ #include <msvctarget.h> #endif + +#include <excpt.h> +#include <basetsd.h> +#include <guiddef.h> +#include "intrin.h" + +#undef __need_wchar_t +#include <winerror.h> +#include <stddef.h> +#include <sdkddkver.h> +#ifndef RC_INVOKED +#include <string.h> +#endif + + +#define ANYSIZE_ARRAY 1 #ifndef __ANONYMOUS_DEFINED #define __ANONYMOUS_DEFINED @@ -66,112 +83,6 @@ #endif #endif /* __ANONYMOUS_DEFINED */ -#undef __C89_NAMELESS -#undef __C89_NAMELESSSTRUCTNAME -#undef __C89_NAMELESSSTRUCTNAME1 -#undef __C89_NAMELESSSTRUCTNAME2 -#undef __C89_NAMELESSSTRUCTNAME3 -#undef __C89_NAMELESSSTRUCTNAME4 -#undef __C89_NAMELESSSTRUCTNAME5 -#undef __C89_NAMELESSUNIONNAME -#undef __C89_NAMELESSUNIONNAME1 -#undef __C89_NAMELESSUNIONNAME2 -#undef __C89_NAMELESSUNIONNAME3 -#undef __C89_NAMELESSUNIONNAME4 -#undef __C89_NAMELESSUNIONNAME5 -#undef __C89_NAMELESSUNIONNAME6 -#undef __C89_NAMELESSUNIONNAME7 -#undef __C89_NAMELESSUNIONNAME8 - -#if !defined(__WINESRC__) && !defined(WINE_NO_NAMELESS_EXTENSION) -# ifdef __GNUC__ - /* Anonymous structs support starts with gcc 2.96/g++ 2.95 */ -# if (__GNUC__ > 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ > 95) || ((__GNUC_MINOR__ == 95) && defined(__cplusplus)))) -# define __C89_NAMELESS __extension__ -# endif -# elif defined(_MSC_VER) -# define __C89_NAMELESS -# endif -#endif - -#ifdef __C89_NAMELESS -# define __C89_NAMELESSSTRUCTNAME -# define __C89_NAMELESSSTRUCTNAME1 -# define __C89_NAMELESSSTRUCTNAME2 -# define __C89_NAMELESSSTRUCTNAME3 -# define __C89_NAMELESSSTRUCTNAME4 -# define __C89_NAMELESSSTRUCTNAME5 -# define __C89_NAMELESSUNIONNAME -# define __C89_NAMELESSUNIONNAME1 -# define __C89_NAMELESSUNIONNAME2 -# define __C89_NAMELESSUNIONNAME3 -# define __C89_NAMELESSUNIONNAME4 -# define __C89_NAMELESSUNIONNAME5 -# define __C89_NAMELESSUNIONNAME6 -# define __C89_NAMELESSUNIONNAME7 -# define __C89_NAMELESSUNIONNAME8 -#else -# define __C89_NAMELESS -# define __C89_NAMELESSSTRUCTNAME DUMMYSTRUCTNAME -# define __C89_NAMELESSSTRUCTNAME1 DUMMYSTRUCTNAME1 -# define __C89_NAMELESSSTRUCTNAME2 DUMMYSTRUCTNAME2 -# define __C89_NAMELESSSTRUCTNAME3 DUMMYSTRUCTNAME3 -# define __C89_NAMELESSSTRUCTNAME4 DUMMYSTRUCTNAME4 -# define __C89_NAMELESSSTRUCTNAME5 DUMMYSTRUCTNAME5 -# define __C89_NAMELESSUNIONNAME DUMMYUNIONNAME -# define __C89_NAMELESSUNIONNAME1 DUMMYUNIONNAME1 -# define __C89_NAMELESSUNIONNAME2 DUMMYUNIONNAME2 -# define __C89_NAMELESSUNIONNAME3 DUMMYUNIONNAME3 -# define __C89_NAMELESSUNIONNAME4 DUMMYUNIONNAME4 -# define __C89_NAMELESSUNIONNAME5 DUMMYUNIONNAME5 -# define __C89_NAMELESSUNIONNAME6 DUMMYUNIONNAME6 -# define __C89_NAMELESSUNIONNAME7 DUMMYUNIONNAME7 -# define __C89_NAMELESSUNIONNAME8 DUMMYUNIONNAME8 -#endif - -#define UNREFERENCED_PARAMETER(P) {(P)=(P);} -#define UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L)) -#define DBG_UNREFERENCED_PARAMETER(P) {(P)=(P);} -#define DBG_UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L)) - -#ifndef DECLSPEC_ALIGN -# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) -# define DECLSPEC_ALIGN(x) __declspec(align(x)) -# elif defined(__GNUC__) -# define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) -# else -# define DECLSPEC_ALIGN(x) -# endif -#endif - -#ifndef NOP_FUNCTION -#if (_MSC_VER >= 1210) -#define NOP_FUNCTION __noop -#else -#define NOP_FUNCTION (void)0 -#endif -#endif - -# define DECLSPEC_HIDDEN - -#ifdef __cplusplus -extern "C" { -#endif - -#include <excpt.h> -#include <basetsd.h> -#include <guiddef.h> - -#include <ctype.h> -#undef __need_wchar_t - -#include <winerror.h> -#include <stddef.h> -#include <sdkddkver.h> - -#ifndef RC_INVOKED -#include <string.h> - #if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64) #define ALIGNMENT_MACHINE #define UNALIGNED __unaligned @@ -194,6 +105,32 @@ #define MEMORY_ALLOCATION_ALIGNMENT 8 #endif +/* C99 restrict support */ +#if defined(ENABLE_RESTRICTED) && !defined(MIDL_PASS) && !defined(RC_INVOKED) + #if defined(_MSC_VER) && defined(_M_MRX000) + #define RESTRICTED_POINTER __restrict + #elif defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95))) + #define RESTRICTED_POINTER __restrict + #else + #define RESTRICTED_POINTER + #endif +#else + #define RESTRICTED_POINTER +#endif + + +#ifndef CONTAINING_RECORD +#define CONTAINING_RECORD(address, type, field) \ + ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field)))) +#endif + +/* Also in winddk.h */ +#if !defined(__GNUC__) +#define FIELD_OFFSET(t,f) ((LONG)(LONG_PTR)&(((t*) 0)->f)) +#else +#define FIELD_OFFSET(t,f) ((LONG)__builtin_offsetof(t,f)) +#endif + /* Returns the type's alignment */ #if defined(_MSC_VER) && (_MSC_VER >= 1300) #define TYPE_ALIGNMENT(t) __alignof(t) @@ -209,21 +146,30 @@ #error "unknown architecture" #endif -#ifndef DECLSPEC_NOVTABLE -# if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined(__cplusplus) -# define DECLSPEC_NOVTABLE __declspec(novtable) -# else -# define DECLSPEC_NOVTABLE -# endif -#endif - -#ifndef DECLSPEC_SELECTANY -#if (_MSC_VER >= 1100) || defined(__GNUC__) -#define DECLSPEC_SELECTANY __declspec(selectany) +#ifdef __cplusplus +# define EXTERN_C extern "C" #else -#define DECLSPEC_SELECTANY -#endif -#endif +# define EXTERN_C extern +#endif + + +#define NTAPI __stdcall + +#define STDMETHODCALLTYPE __stdcall +#define STDMETHODVCALLTYPE __cdecl +#define STDAPICALLTYPE __stdcall +#define STDAPIVCALLTYPE __cdecl +#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE +#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE +#define STDMETHODIMP HRESULT STDMETHODCALLTYPE +#define STDMETHODIMP_(type) type STDMETHODCALLTYPE +#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE +#define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE +#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE +#define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE + + + #ifndef DECLSPEC_ADDRSAFE #if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64)) @@ -231,15 +177,28 @@ #else #define DECLSPEC_ADDRSAFE #endif -#endif - -/*#ifdef _WINE*/ -#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) -#define __WINE_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) +#endif /* DECLSPEC_ADDRSAFE */ + + +#ifndef NOP_FUNCTION +#if (_MSC_VER >= 1210) +#define NOP_FUNCTION __noop #else -#define __WINE_ALLOC_SIZE(x) -#endif -/*#endif*/ +#define NOP_FUNCTION (void)0 +#endif +#endif + +#if !defined(_NTSYSTEM_) +#define NTSYSAPI DECLSPEC_IMPORT +#define NTSYSCALLAPI DECLSPEC_IMPORT +#else +#define NTSYSAPI +#if defined(_NTDLLBUILD_) +#define NTSYSCALLAPI +#else +#define NTSYSCALLAPI DECLSPEC_ADDRSAFE +#endif +#endif #ifndef FORCEINLINE #if (_MSC_VER >= 1200) @@ -253,74 +212,115 @@ # define FORCEINLINE extern __inline__ __attribute__((__always_inline__)) # endif #endif -#endif - -#if !defined(_NTSYSTEM_) -#define NTSYSAPI DECLSPEC_IMPORT -#define NTSYSCALLAPI DECLSPEC_IMPORT +#endif /* FORCEINLINE */ + + + +#ifndef DECLSPEC_ALIGN +# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) +# define DECLSPEC_ALIGN(x) __declspec(align(x)) +# elif defined(__GNUC__) +# define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) +# else +# define DECLSPEC_ALIGN(x) +# endif +#endif /* DECLSPEC_ALIGN */ + + +#ifndef DECLSPEC_NOVTABLE +# if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined(__cplusplus) +# define DECLSPEC_NOVTABLE __declspec(novtable) +# else +# define DECLSPEC_NOVTABLE +# endif +#endif + +#ifndef DECLSPEC_SELECTANY +#if (_MSC_VER >= 1100) || defined(__GNUC__) +#define DECLSPEC_SELECTANY __declspec(selectany) #else -#define NTSYSAPI -#if defined(_NTDLLBUILD_) -#define NTSYSCALLAPI +#define DECLSPEC_SELECTANY +#endif +#endif + +#define UNREFERENCED_PARAMETER(P) {(P)=(P);} +#define UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L)) +#define DBG_UNREFERENCED_PARAMETER(P) {(P)=(P);} +#define DBG_UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L)) + +typedef void *PVOID; + +#ifdef STRICT +typedef void *HANDLE; +#define DECLARE_HANDLE(n) typedef struct n##__{int i;}*n #else -#define NTSYSCALLAPI DECLSPEC_ADDRSAFE -#endif -#endif +typedef PVOID HANDLE; +#define DECLARE_HANDLE(n) typedef HANDLE n +#endif +typedef HANDLE *PHANDLE; #ifndef VOID #define VOID void #endif + typedef char CHAR; typedef short SHORT; + #if !defined(__ROS_LONG64__) || defined(_M_AMD64) typedef long LONG; + + #else typedef int LONG; #endif -typedef char CCHAR, *PCCHAR; -typedef void *PVOID; - -/* FIXME for __WIN64 */ -#ifndef __ptr64 -#define __ptr64 -#endif -typedef void* __ptr64 PVOID64; - -#ifdef __cplusplus -# define EXTERN_C extern "C" + +typedef SHORT *PSHORT; +typedef LONG *PLONG; + +typedef BYTE FCHAR; +typedef WORD FSHORT; +typedef DWORD FLONG; + +typedef BYTE BOOLEAN,*PBOOLEAN; + +#ifdef __GNUC__ + #define _HAVE_INT64 + #ifndef _INTEGRAL_MAX_BITS + #define _INTEGRAL_MAX_BITS 64 + #endif + #undef __int64 + #define __int64 long long +#elif (defined(__WATCOMC__) || defined(_MSC_VER)) && (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64 ) + #define _HAVE_INT64 +#endif /* __GNUC__/__WATCOMC */ + +#if defined(_HAVE_INT64) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64) + typedef __int64 LONGLONG; + typedef unsigned __int64 DWORDLONG; #else -# define EXTERN_C extern -#endif - -#define STDMETHODCALLTYPE __stdcall -#define STDMETHODVCALLTYPE __cdecl -#define STDAPICALLTYPE __stdcall -#define STDAPIVCALLTYPE __cdecl - -#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE -#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE -#define STDMETHODIMP HRESULT STDMETHODCALLTYPE -#define STDMETHODIMP_(type) type STDMETHODCALLTYPE -#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE -#define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE -#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE -#define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE - -/* C99 restrict support */ -#if defined(ENABLE_RESTRICTED) && !defined(MIDL_PASS) && !defined(RC_INVOKED) - #if defined(_MSC_VER) && defined(_M_MRX000) - #define RESTRICTED_POINTER __restrict - #elif defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95))) - #define RESTRICTED_POINTER __restrict - #else - #define RESTRICTED_POINTER - #endif -#else - #define RESTRICTED_POINTER -#endif + typedef double LONGLONG,DWORDLONG; +#endif + +typedef LONGLONG *PLONGLONG; +typedef DWORDLONG *PDWORDLONG; +typedef DWORDLONG ULONGLONG,*PULONGLONG; +typedef LONGLONG USN; + +typedef CHAR *PCHAR, *LPCH, *PCH; +typedef CONST CHAR *LPCCH, *PCCH; +typedef _Null_terminated_ CHAR *NPSTR, *LPSTR, *PSTR; +typedef _Null_terminated_ PSTR *PZPSTR; +typedef _Null_terminated_ CONST PSTR *PCZPSTR; +typedef _Null_terminated_ CONST CHAR *LPCSTR, *PCSTR; +typedef _Null_terminated_ PCSTR *PZPCSTR; + +typedef _NullNull_terminated_ CHAR *PZZSTR; +typedef _NullNull_terminated_ CONST CHAR *PCZZSTR; + typedef wchar_t WCHAR; - +typedef WCHAR *PWCHAR, *LPWCH, *PWCH; +typedef CONST WCHAR *LPCWCH, *PCWCH; typedef _Null_terminated_ WCHAR *NWPSTR, *LPWSTR, *PWSTR; typedef _Null_terminated_ PWSTR *PZPWSTR; typedef _Null_terminated_ CONST PWSTR *PCZPWSTR; @@ -334,93 +334,195 @@ typedef _NullNull_terminated_ WCHAR UNALIGNED *PUZZWSTR; typedef _NullNull_terminated_ CONST WCHAR UNALIGNED *PCUZZWSTR; -typedef WCHAR *PWCHAR, *LPWCH, *PWCH; -typedef CONST WCHAR *LPCWCH, *PCWCH; -typedef CHAR *PCHAR, *LPCH, *PCH; -typedef CONST CHAR *LPCCH, *PCCH; - -typedef _Null_terminated_ CHAR *NPSTR, *LPSTR, *PSTR; -typedef _Null_terminated_ PSTR *PZPSTR; -typedef _Null_terminated_ CONST PSTR *PCZPSTR; -typedef _Null_terminated_ CONST CHAR *LPCSTR, *PCSTR; -typedef _Null_terminated_ PCSTR *PZPCSTR; - -typedef _NullNull_terminated_ CHAR *PZZSTR; -typedef _NullNull_terminated_ CONST CHAR *PCZZSTR; - #ifdef UNICODE -#ifndef _TCHAR_DEFINED -#define _TCHAR_DEFINED + #ifndef _TCHAR_DEFINED + #define _TCHAR_DEFINED typedef WCHAR TCHAR,*PTCHAR; typedef WCHAR TBYTE ,*PTBYTE; -#endif - typedef LPWSTR LPTCH,PTCH,PTSTR,LPTSTR,LP; - typedef LPCWSTR PCTSTR,LPCTSTR; - typedef LPUWSTR PUTSTR,LPUTSTR; - typedef LPCUWSTR PCUTSTR,LPCUTSTR; -#define __TEXT(quote) L##quote -#else -#ifndef _TCHAR_DEFINED -#define _TCHAR_DEFINED + #endif + typedef LPWSTR LPTCH,PTCH,PTSTR,LPTSTR,LP; + typedef LPCWSTR PCTSTR,LPCTSTR; + typedef LPUWSTR PUTSTR,LPUTSTR; + typedef LPCUWSTR PCUTSTR,LPCUTSTR; + #define __TEXT(quote) L##quote + +#else /* UNICODE */ + + #ifndef _TCHAR_DEFINED + #define _TCHAR_DEFINED typedef char TCHAR,*PTCHAR; typedef unsigned char TBYTE ,*PTBYTE; -#endif - typedef LPSTR LPTCH,PTCH,PTSTR,LPTSTR,PUTSTR,LPUTSTR; - typedef LPCSTR PCTSTR,LPCTSTR,PCUTSTR,LPCUTSTR; -#define __TEXT(quote) quote -#endif + #endif + typedef LPSTR LPTCH,PTCH,PTSTR,LPTSTR,PUTSTR,LPUTSTR; + typedef LPCSTR PCTSTR,LPCTSTR,PCUTSTR,LPCUTSTR; + #define __TEXT(quote) quote +#endif /* UNICODE */ #define TEXT(quote) __TEXT(quote) -typedef SHORT *PSHORT; -typedef LONG *PLONG; -#ifdef STRICT -typedef void *HANDLE; -#define DECLARE_HANDLE(n) typedef struct n##__{int i;}*n -#else -typedef PVOID HANDLE; -#define DECLARE_HANDLE(n) typedef HANDLE n -#endif -typedef HANDLE *PHANDLE; +typedef char CCHAR, *PCCHAR; + typedef DWORD LCID; typedef PDWORD PLCID; typedef WORD LANGID; -#ifdef __GNUC__ -#define _HAVE_INT64 -#ifndef _INTEGRAL_MAX_BITS -# define _INTEGRAL_MAX_BITS 64 -#endif -#undef __int64 -#define __int64 long long -#elif (defined(__WATCOMC__) || defined(_MSC_VER)) && (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64 ) -#define _HAVE_INT64 -#endif /* __GNUC__/__WATCOMC */ -#if defined(_HAVE_INT64) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64) -typedef __int64 LONGLONG; -typedef unsigned __int64 DWORDLONG; + + +#ifdef _M_PPC +#define LARGE_INTEGER_ORDER(x) x HighPart; DWORD LowPart; #else -typedef double LONGLONG,DWORDLONG; -#endif -typedef LONGLONG *PLONGLONG; -typedef DWORDLONG *PDWORDLONG; -typedef DWORDLONG ULONGLONG,*PULONGLONG; -typedef LONGLONG USN; -#ifdef _HAVE_INT64 -#define Int32x32To64(a,b) ((LONGLONG)(a)*(LONGLONG)(b)) -#define UInt32x32To64(a,b) ((DWORDLONG)(a)*(DWORDLONG)(b)) -#define Int64ShllMod32(a,b) ((DWORDLONG)(a)<<(b)) -#define Int64ShraMod32(a,b) ((LONGLONG)(a)>>(b)) -#define Int64ShrlMod32(a,b) ((DWORDLONG)(a)>>(b)) -#endif +#define LARGE_INTEGER_ORDER(x) DWORD LowPart; x HighPart; +#endif +typedef union _LARGE_INTEGER { +#if ! defined(NONAMELESSUNION) || defined(__cplusplus) + _ANONYMOUS_STRUCT struct { + LARGE_INTEGER_ORDER(LONG) + }; +#endif /* NONAMELESSUNION */ + struct { + LARGE_INTEGER_ORDER(LONG) + } u; + LONGLONG QuadPart; +} LARGE_INTEGER, *PLARGE_INTEGER; + +typedef union _ULARGE_INTEGER { +#if ! defined(NONAMELESSUNION) || defined(__cplusplus) + _ANONYMOUS_STRUCT struct { + LARGE_INTEGER_ORDER(DWORD) + }; +#endif /* NONAMELESSUNION */ + struct { + LARGE_INTEGER_ORDER(DWORD) + } u; + ULONGLONG QuadPart; +} ULARGE_INTEGER, *PULARGE_INTEGER; + +typedef struct _LUID { + LARGE_INTEGER_ORDER(LONG) +} LUID, *PLUID; + +#define APPLICATION_ERROR_MASK 0x20000000 +#define ERROR_SEVERITY_SUCCESS 0x00000000 +#define ERROR_SEVERITY_INFORMATIONAL 0x40000000 +#define ERROR_SEVERITY_WARNING 0x80000000 +#define ERROR_SEVERITY_ERROR 0xC0000000 + + + #define ANSI_NULL ((CHAR)0) #define UNICODE_NULL ((WCHAR)0) #define UNICODE_STRING_MAX_BYTES ((USHORT) 65534) #define UNICODE_STRING_MAX_CHARS (32767) -typedef BYTE BOOLEAN,*PBOOLEAN; -#endif -typedef BYTE FCHAR; -typedef WORD FSHORT; -typedef DWORD FLONG; + + +typedef struct _LIST_ENTRY { + struct _LIST_ENTRY *Flink; + struct _LIST_ENTRY *Blink; +} LIST_ENTRY, *PLIST_ENTRY, *RESTRICTED_POINTER PRLIST_ENTRY; + +typedef struct _LIST_ENTRY32 { + DWORD Flink; + DWORD Blink; +} LIST_ENTRY32,*PLIST_ENTRY32; + +typedef struct _LIST_ENTRY64 { + ULONGLONG Flink; + ULONGLONG Blink; +} LIST_ENTRY64,*PLIST_ENTRY64; + +typedef struct _SINGLE_LIST_ENTRY { + struct _SINGLE_LIST_ENTRY *Next; +} SINGLE_LIST_ENTRY,*PSINGLE_LIST_ENTRY; + + +typedef struct _PROCESSOR_NUMBER { + WORD Group; + BYTE Number; + BYTE Reserved; +} PROCESSOR_NUMBER, *PPROCESSOR_NUMBER; + +typedef +_IRQL_requires_same_ +_Function_class_(EXCEPTION_ROUTINE) +EXCEPTION_DISPOSITION +NTAPI +EXCEPTION_ROUTINE( + _Inout_ struct _EXCEPTION_RECORD *ExceptionRecord, + _In_ PVOID EstablisherFrame, + _Inout_ struct _CONTEXT *ContextRecord, + _In_ PVOID DispatcherContext); + +typedef EXCEPTION_ROUTINE *PEXCEPTION_ROUTINE; + +typedef struct _GROUP_AFFINITY { + KAFFINITY Mask; + WORD Group; + WORD Reserved[3]; +} GROUP_AFFINITY, *PGROUP_AFFINITY; + +#define RTL_FIELD_TYPE(type, field) (((type*)0)->field) +#define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8) +#define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field))) +#define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field)) + +#define RTL_SIZEOF_THROUGH_FIELD(type, field) \ + (FIELD_OFFSET(type, field) + RTL_FIELD_SIZE(type, field)) + +#define RTL_CONTAINS_FIELD(Struct, Size, Field) \ + ((((PCHAR) (&(Struct)->Field)) + sizeof((Struct)->Field)) <= (((PCHAR) (Struct)) + (Size))) + +#define RTL_NUMBER_OF_V1(A) (sizeof(A)/sizeof((A)[0])) + +#if defined(__cplusplus) && \ + !defined(MIDL_PASS) && \ + !defined(RC_INVOKED) && \ + !defined(_PREFAST_) && \ + (_MSC_FULL_VER >= 13009466) && \ + !defined(SORTPP_PASS) +#define RTL_NUMBER_OF_V2(A) (sizeof(*RtlpNumberOf(A))) +#else +#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A) +#endif + +#ifdef ENABLE_RTL_NUMBER_OF_V2 +#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V2(A) +#else +#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A) +#endif + +#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A) +#define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A) + +#define RTL_NUMBER_OF_FIELD(type, field) (RTL_NUMBER_OF(RTL_FIELD_TYPE(type, field))) + +#define RTL_PADDING_BETWEEN_FIELDS(T, F1, F2) \ + ((FIELD_OFFSET(T, F2) > FIELD_OFFSET(T, F1)) \ + ? (FIELD_OFFSET(T, F2) - FIELD_OFFSET(T, F1) - RTL_FIELD_SIZE(T, F1)) \ + : (FIELD_OFFSET(T, F1) - FIELD_OFFSET(T, F2) - RTL_FIELD_SIZE(T, F2))) + +#if defined(__cplusplus) +#define RTL_CONST_CAST(type) const_cast<type> +#else +#define RTL_CONST_CAST(type) (type) +#endif + +#define MINCHAR 0x80 +#define MAXCHAR 0x7f +#define MINSHORT 0x8000 +#define MAXSHORT 0x7fff +#define MINLONG 0x80000000 +#define MAXLONG 0x7fffffff +#define MAXBYTE 0xff +#define MAXWORD 0xffff +#define MAXDWORD 0xffffffff +#define MAXLONGLONG (((LONGLONG)0x7fffffff << 32) | 0xffffffff) + +#ifdef _HAVE_INT64 + #define Int32x32To64(a,b) ((LONGLONG)(a)*(LONGLONG)(b)) + #define UInt32x32To64(a,b) ((DWORDLONG)(a)*(DWORDLONG)(b)) + #define Int64ShllMod32(a,b) ((DWORDLONG)(a)<<(b)) + #define Int64ShraMod32(a,b) ((LONGLONG)(a)>>(b)) + #define Int64ShrlMod32(a,b) ((DWORDLONG)(a)>>(b)) +#endif #define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1] @@ -433,546 +535,24 @@ # define DEFAULT_UNREACHABLE default: break #endif -#include "intrin.h" - -#define NTAPI __stdcall -#include <basetsd.h> - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable:4201) -#pragma warning(disable:4214) -#pragma warning(disable:4820) -#endif - -#define ACE_OBJECT_TYPE_PRESENT 0x00000001 -#define ACE_INHERITED_OBJECT_TYPE_PRESENT 0x00000002 -#define APPLICATION_ERROR_MASK 0x20000000 -#define ERROR_SEVERITY_SUCCESS 0x00000000 -#define ERROR_SEVERITY_INFORMATIONAL 0x40000000 -#define ERROR_SEVERITY_WARNING 0x80000000 -#define ERROR_SEVERITY_ERROR 0xC0000000 - -#ifdef __cplusplus -#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \ -extern "C++" { \ - inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a)|((int)b)); } \ - inline ENUMTYPE operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \ - inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a)&((int)b)); } \ - inline ENUMTYPE operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \ - inline ENUMTYPE operator ~ (ENUMTYPE a) { return (ENUMTYPE)(~((int)a)); } \ - inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a)^((int)b)); } \ - inline ENUMTYPE operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \ -} -#else -#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) /* */ -#endif - -/* also in ddk/ntifs.h */ -#define COMPRESSION_FORMAT_NONE (0x0000) -#define COMPRESSION_FORMAT_DEFAULT (0x0001) -#define COMPRESSION_FORMAT_LZNT1 (0x0002) -#define COMPRESSION_ENGINE_STANDARD (0x0000) -#define COMPRESSION_ENGINE_MAXIMUM (0x0100) -#define COMPRESSION_ENGINE_HIBER (0x0200) -#define ACCESS_ALLOWED_ACE_TYPE (0x0) -#define ACCESS_DENIED_ACE_TYPE (0x1) -#define SYSTEM_AUDIT_ACE_TYPE (0x2) -#define SYSTEM_ALARM_ACE_TYPE (0x3) -/*end ntifs.h */ -#define ANYSIZE_ARRAY 1 -#define OBJECT_INHERIT_ACE 1 -#define CONTAINER_INHERIT_ACE 2 -#define NO_PROPAGATE_INHERIT_ACE 4 -#define INHERIT_ONLY_ACE 8 -#define INHERITED_ACE 16 -#define VALID_INHERIT_FLAGS 0x1F -#define SUCCESSFUL_ACCESS_ACE_FLAG 64 -#define FAILED_ACCESS_ACE_FLAG 128 -#define DELETE 0x00010000L -#define READ_CONTROL 0x20000L -#define WRITE_DAC 0x40000L -#define WRITE_OWNER 0x80000L -#define SYNCHRONIZE 0x100000L -#define STANDARD_RIGHTS_REQUIRED 0xF0000 -#define STANDARD_RIGHTS_READ 0x20000 -#define STANDARD_RIGHTS_WRITE 0x20000 -#define STANDARD_RIGHTS_EXECUTE 0x20000 -#define STANDARD_RIGHTS_ALL 0x1F0000 -#define SPECIFIC_RIGHTS_ALL 0xFFFF -#define ACCESS_SYSTEM_SECURITY 0x1000000 - -#define REG_STANDARD_FORMAT 1 -#define REG_LATEST_FORMAT 2 -#define REG_NO_COMPRESSION 4 - -#ifndef WIN32_NO_STATUS - -#define STATUS_WAIT_0 ((DWORD)0x00000000) -#define STATUS_ABANDONED_WAIT_0 ((DWORD)0x00000080) -#define STATUS_USER_APC ((DWORD)0x000000C0) -#define STATUS_TIMEOUT ((DWORD)0x00000102) -#define STATUS_PENDING ((DWORD)0x00000103) -#define STATUS_SEGMENT_NOTIFICATION ((DWORD)0x40000005) -#define STATUS_GUARD_PAGE_VIOLATION ((DWORD)0x80000001) -#define STATUS_DATATYPE_MISALIGNMENT ((DWORD)0x80000002) -#define STATUS_BREAKPOINT ((DWORD)0x80000003) -#define STATUS_SINGLE_STEP ((DWORD)0x80000004) -#define STATUS_ACCESS_VIOLATION ((DWORD)0xC0000005) -#define STATUS_IN_PAGE_ERROR ((DWORD)0xC0000006) -#define STATUS_INVALID_HANDLE ((DWORD)0xC0000008) -#define STATUS_NO_MEMORY ((DWORD)0xC0000017) -#define STATUS_ILLEGAL_INSTRUCTION ((DWORD)0xC000001D) -#define STATUS_NONCONTINUABLE_EXCEPTION ((DWORD)0xC0000025) -#define STATUS_INVALID_DISPOSITION ((DWORD)0xC0000026) -#define STATUS_ARRAY_BOUNDS_EXCEEDED ((DWORD)0xC000008C) -#define STATUS_FLOAT_DENORMAL_OPERAND ((DWORD)0xC000008D) -#define STATUS_FLOAT_DIVIDE_BY_ZERO ((DWORD)0xC000008E) -#define STATUS_FLOAT_INEXACT_RESULT ((DWORD)0xC000008F) -#define STATUS_FLOAT_INVALID_OPERATION ((DWORD)0xC0000090) -#define STATUS_FLOAT_OVERFLOW ((DWORD)0xC0000091) -#define STATUS_FLOAT_STACK_CHECK ((DWORD)0xC0000092) -#define STATUS_FLOAT_UNDERFLOW ((DWORD)0xC0000093) -#define STATUS_INTEGER_DIVIDE_BY_ZERO ((DWORD)0xC0000094) -#define STATUS_INTEGER_OVERFLOW ((DWORD)0xC0000095) -#define STATUS_PRIVILEGED_INSTRUCTION ((DWORD)0xC0000096) -#define STATUS_STACK_OVERFLOW ((DWORD)0xC00000FD) -#define STATUS_CONTROL_C_EXIT ((DWORD)0xC000013A) -#define STATUS_FLOAT_MULTIPLE_FAULTS ((DWORD)0xC00002B4) -#define STATUS_FLOAT_MULTIPLE_TRAPS ((DWORD)0xC00002B5) -#define STATUS_REG_NAT_CONSUMPTION ((DWORD)0xC00002C9) -#define STATUS_SXS_EARLY_DEACTIVATION ((DWORD)0xC015000F) -#define STATUS_SXS_INVALID_DEACTIVATION ((DWORD)0xC0150010) - -#define DBG_EXCEPTION_HANDLED ((DWORD)0x00010001) -#define DBG_CONTINUE ((DWORD)0x00010002) -#define DBG_TERMINATE_THREAD ((DWORD)0x40010003) -#define DBG_TERMINATE_PROCESS ((DWORD)0x40010004) -#define DBG_CONTROL_C ((DWORD)0x40010005) -#define DBG_CONTROL_BREAK ((DWORD)0x40010008) -#define DBG_COMMAND_EXCEPTION ((DWORD)0x40010009) -#define DBG_EXCEPTION_NOT_HANDLED ((DWORD)0x80010001) - -#endif /* WIN32_NO_STATUS */ - -#define MAXIMUM_ALLOWED 0x2000000 -#define GENERIC_READ 0x80000000 -#define GENERIC_WRITE 0x40000000 -#define GENERIC_EXECUTE 0x20000000 -#define GENERIC_ALL 0x10000000 - -#define INVALID_FILE_ATTRIBUTES ((DWORD)-1) - -/* Also in ddk/winddk.h */ -#define FILE_LIST_DIRECTORY 0x00000001 -#define FILE_READ_DATA 0x00000001 -#define FILE_ADD_FILE 0x00000002 -#define FILE_WRITE_DATA 0x00000002 -#define FILE_ADD_SUBDIRECTORY 0x00000004 -#define FILE_APPEND_DATA 0x00000004 -#define FILE_CREATE_PIPE_INSTANCE 0x00000004 -#define FILE_READ_EA 0x00000008 -#define FILE_READ_PROPERTIES 0x00000008 -#define FILE_WRITE_EA 0x00000010 -#define FILE_WRITE_PROPERTIES 0x00000010 -#define FILE_EXECUTE 0x00000020 -#define FILE_TRAVERSE 0x00000020 -#define FILE_DELETE_CHILD 0x00000040 -#define FILE_READ_ATTRIBUTES 0x00000080 -#define FILE_WRITE_ATTRIBUTES 0x00000100 - -#define FILE_SHARE_READ 0x00000001 -#define FILE_SHARE_WRITE 0x00000002 -#define FILE_SHARE_DELETE 0x00000004 -#define FILE_SHARE_VALID_FLAGS 0x00000007 - -#define FILE_ATTRIBUTE_READONLY 0x00000001 -#define FILE_ATTRIBUTE_HIDDEN 0x00000002 -#define FILE_ATTRIBUTE_SYSTEM 0x00000004 -#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 -#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 -#define FILE_ATTRIBUTE_DEVICE 0x00000040 -#define FILE_ATTRIBUTE_NORMAL 0x00000080 -#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 -#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 -#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 -#define FILE_ATTRIBUTE_COMPRESSED 0x00000800 -#define FILE_ATTRIBUTE_OFFLINE 0x00001000 -#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 -#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000 -#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7 -#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7 - -#define FILE_COPY_STRUCTURED_STORAGE 0x00000041 -#define FILE_STRUCTURED_STORAGE 0x00000441 - -#define FILE_VALID_OPTION_FLAGS 0x00ffffff -#define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032 -#define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032 -#define FILE_VALID_SET_FLAGS 0x00000036 - -#define FILE_DIRECTORY_FILE 0x00000001 -#define FILE_WRITE_THROUGH 0x00000002 -#define FILE_SEQUENTIAL_ONLY 0x00000004 -#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008 -#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010 -#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020 -#define FILE_NON_DIRECTORY_FILE 0x00000040 -#define FILE_CREATE_TREE_CONNECTION 0x00000080 -#define FILE_COMPLETE_IF_OPLOCKED 0x00000100 -#define FILE_NO_EA_KNOWLEDGE 0x00000200 -#define FILE_OPEN_REMOTE_INSTANCE 0x00000400 -#define FILE_RANDOM_ACCESS 0x00000800 -#define FILE_DELETE_ON_CLOSE 0x00001000 -#define FILE_OPEN_BY_FILE_ID 0x00002000 -#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000 -#define FILE_NO_COMPRESSION 0x00008000 -#define FILE_RESERVE_OPFILTER 0x00100000 -#define FILE_OPEN_REPARSE_POINT 0x00200000 -#define FILE_OPEN_NO_RECALL 0x00400000 -#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 - -#define FILE_ALL_ACCESS \ - (STANDARD_RIGHTS_REQUIRED | \ - SYNCHRONIZE | \ - 0x1FF) - -#define FILE_GENERIC_EXECUTE \ - (STANDARD_RIGHTS_EXECUTE | \ - FILE_READ_ATTRIBUTES | \ - FILE_EXECUTE | \ - SYNCHRONIZE) - -#define FILE_GENERIC_READ \ - (STANDARD_RIGHTS_READ | \ - FILE_READ_DATA | \ - FILE_READ_ATTRIBUTES | \ - FILE_READ_EA | \ - SYNCHRONIZE) - -#define FILE_GENERIC_WRITE \ - (STANDARD_RIGHTS_WRITE | \ - FILE_WRITE_DATA | \ - FILE_WRITE_ATTRIBUTES | \ - FILE_WRITE_EA | \ - FILE_APPEND_DATA | \ - SYNCHRONIZE) -/* end winddk.h */ -/* also in ddk/ntifs.h */ -#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001 -#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002 -#define FILE_NOTIFY_CHANGE_NAME 0x00000003 -#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004 -#define FILE_NOTIFY_CHANGE_SIZE 0x00000008 -#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010 -#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020 -#define FILE_NOTIFY_CHANGE_CREATION 0x00000040 -#define FILE_NOTIFY_CHANGE_EA 0x00000080 -#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100 -#define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200 -#define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400 -#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800 -#define FILE_NOTIFY_VALID_MASK 0x00000fff - -#define FILE_CASE_SENSITIVE_SEARCH 0x00000001 -#define FILE_CASE_PRESERVED_NAMES 0x00000002 -#define FILE_UNICODE_ON_DISK 0x00000004 -#define FILE_PERSISTENT_ACLS 0x00000008 -#define FILE_FILE_COMPRESSION 0x00000010 -#define FILE_VOLUME_QUOTAS 0x00000020 -#define FILE_SUPPORTS_SPARSE_FILES 0x00000040 -#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080 -#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100 -#define FS_LFN_APIS 0x00004000 -#define FILE_VOLUME_IS_COMPRESSED 0x00008000 -#define FILE_SUPPORTS_OBJECT_IDS 0x00010000 -#define FILE_SUPPORTS_ENCRYPTION 0x00020000 -#define FILE_NAMED_STREAMS 0x00040000 - -#define IO_COMPLETION_QUERY_STATE 0x0001 -#define IO_COMPLETION_MODIFY_STATE 0x0002 -#define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3) -/* end ntifs.h */ - -/* also in ddk/winddk.h */ -#define DUPLICATE_CLOSE_SOURCE 0x00000001 -#define DUPLICATE_SAME_ACCESS 0x00000002 -/* end winddk.k */ - -#define MAILSLOT_NO_MESSAGE ((DWORD)-1) -#define MAILSLOT_WAIT_FOREVER ((DWORD)-1) -#define PROCESS_TERMINATE 1 -#define PROCESS_CREATE_THREAD 2 -#define PROCESS_SET_SESSIONID 4 -#define PROCESS_VM_OPERATION 8 -#define PROCESS_VM_READ 16 -#define PROCESS_VM_WRITE 32 -#define PROCESS_CREATE_PROCESS 128 -#define PROCESS_SET_QUOTA 256 -#define PROCESS_SET_INFORMATION 512 -#define PROCESS_QUERY_INFORMATION 1024 -#define PROCESS_SUSPEND_RESUME 2048 -#define PROCESS_QUERY_LIMITED_INFORMATION 0x1000 -#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xFFF) -#define PROCESS_DUP_HANDLE 64 -#define THREAD_TERMINATE 1 -#define THREAD_SUSPEND_RESUME 2 -#define THREAD_GET_CONTEXT 8 -#define THREAD_SET_CONTEXT 16 -#define THREAD_SET_INFORMATION 32 -#define THREAD_QUERY_INFORMATION 64 -#define THREAD_SET_THREAD_TOKEN 128 -#define THREAD_IMPERSONATE 256 -#define THREAD_DIRECT_IMPERSONATION 0x200 -#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF) -#define MUTANT_QUERY_STATE 0x0001 -#define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE) -#define TIMER_QUERY_STATE 0x0001 -#define TIMER_MODIFY_STATE 0x0002 -#define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|TIMER_QUERY_STATE|TIMER_MODIFY_STATE) -#define THREAD_BASE_PRIORITY_LOWRT 15 -#define THREAD_BASE_PRIORITY_MAX 2 -#define THREAD_BASE_PRIORITY_MIN (-2) -#define THREAD_BASE_PRIORITY_IDLE (-15) -/* - * To prevent gcc compiler warnings, bracket these defines when initialising - * a SID_IDENTIFIER_AUTHORITY, eg. - * SID_IDENTIFIER_AUTHORITY aNullSidAuthority = {SECURITY_NULL_SID_AUTHORITY}; - */ -#define SID_MAX_SUB_AUTHORITIES 15 - -/* security entities */ -#define SECURITY_NULL_RID (0x00000000L) -#define SECURITY_WORLD_RID (0x00000000L) -#define SECURITY_LOCAL_RID (0X00000000L) - -#define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0} - -/* S-1-1 */ -#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1} - -/* S-1-2 */ -#define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2} - -/* S-1-3 */ -#define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3} -#define SECURITY_CREATOR_OWNER_RID (0x00000000L) -#define SECURITY_CREATOR_GROUP_RID (0x00000001L) -#define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L) -#define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L) - -/* S-1-4 */ -#define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4} - -/* S-1-5 */ -#define SECURITY_NT_AUTHORITY {0,0,0,0,0,5} -#define SECURITY_DIALUP_RID 0x00000001L -#define SECURITY_NETWORK_RID 0x00000002L -#define SECURITY_BATCH_RID 0x00000003L -#define SECURITY_INTERACTIVE_RID 0x00000004L -#define SECURITY_LOGON_IDS_RID 0x00000005L -#define SECURITY_SERVICE_RID 0x00000006L -#define SECURITY_ANONYMOUS_LOGON_RID 0x00000007L -#define SECURITY_PROXY_RID 0x00000008L -#define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x00000009L -#define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID -#define SECURITY_PRINCIPAL_SELF_RID 0x0000000AL -#define SECURITY_AUTHENTICATED_USER_RID 0x0000000BL -#define SECURITY_RESTRICTED_CODE_RID 0x0000000CL -#define SECURITY_TERMINAL_SERVER_RID 0x0000000DL -#define SECURITY_REMOTE_LOGON_RID 0x0000000EL -#define SECURITY_THIS_ORGANIZATION_RID 0x0000000FL -#define SECURITY_LOCAL_SYSTEM_RID 0x00000012L -#define SECURITY_LOCAL_SERVICE_RID 0x00000013L -#define SECURITY_NETWORK_SERVICE_RID 0x00000014L -#define SECURITY_NT_NON_UNIQUE 0x00000015L -#define SECURITY_BUILTIN_DOMAIN_RID 0x00000020L - -#define SECURITY_PACKAGE_BASE_RID 0x00000040L -#define SECURITY_PACKAGE_NTLM_RID 0x0000000AL -#define SECURITY_PACKAGE_SCHANNEL_RID 0x0000000EL -#define SECURITY_PACKAGE_DIGEST_RID 0x00000015L -#define SECURITY_OTHER_ORGANIZATION_RID 0x000003E8L - -#define SECURITY_LOGON_IDS_RID_COUNT 0x3 -#define SID_REVISION 1 - -#define FOREST_USER_RID_MAX 0x000001F3L -#define DOMAIN_USER_RID_ADMIN 0x000001F4L -#define DOMAIN_USER_RID_GUEST 0x000001F5L -#define DOMAIN_USER_RID_KRBTGT 0x000001F6L -#define DOMAIN_USER_RID_MAX 0x000003E7L - -#define DOMAIN_GROUP_RID_ADMINS 0x00000200L -#define DOMAIN_GROUP_RID_USERS 0x00000201L -#define DOMAIN_GROUP_RID_GUESTS 0x00000202L -#define DOMAIN_GROUP_RID_COMPUTERS 0x00000203L -#define DOMAIN_GROUP_RID_CONTROLLERS 0x00000204L -#define DOMAIN_GROUP_RID_CERT_ADMINS 0x00000205L -#define DOMAIN_GROUP_RID_SCHEMA_ADMINS 0x00000206L -#define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS 0x00000207L -#define DOMAIN_GROUP_RID_POLICY_ADMINS 0x00000208L - -#define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16} -#define SECURITY_MANDATORY_UNTRUSTED_RID 0x00000000L -#define SECURITY_MANDATORY_LOW_RID 0x00001000L -#define SECURITY_MANDATORY_MEDIUM_RID 0x00002000L -#define SECURITY_MANDATORY_HIGH_RID 0x00003000L -#define SECURITY_MANDATORY_SYSTEM_RID 0x00004000L -#define SECURITY_MANDATORY_PROTECTED_PROCESS_RID 0x00005000L - -#define DOMAIN_ALIAS_RID_ADMINS 0x00000220L -#define DOMAIN_ALIAS_RID_USERS 0x00000221L -#define DOMAIN_ALIAS_RID_GUESTS 0x00000222L -#define DOMAIN_ALIAS_RID_POWER_USERS 0x00000223L - -#define DOMAIN_ALIAS_RID_ACCOUNT_OPS 0x00000224L -#define DOMAIN_ALIAS_RID_SYSTEM_OPS 0x00000225L -#define DOMAIN_ALIAS_RID_PRINT_OPS 0x00000226L -#define DOMAIN_ALIAS_RID_BACKUP_OPS 0x00000227L - -#define DOMAIN_ALIAS_RID_REPLICATOR 0x00000228L -#define DOMAIN_ALIAS_RID_RAS_SERVERS 0x00000229L -#define DOMAIN_ALIAS_RID_PREW2KCOMPACCESS 0x0000022AL -#define DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS 0x0000022BL -#define DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS 0x0000022CL -#define DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS 0x0000022DL - -#define DOMAIN_ALIAS_RID_MONITORING_USERS 0x0000022EL -#define DOMAIN_ALIAS_RID_LOGGING_USERS 0x0000022FL -#define DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS 0x00000230L -#define DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS 0x00000231L -#define DOMAIN_ALIAS_RID_DCOM_USERS 0x00000232L - -#define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16} - -typedef enum { - WinNullSid = 0, - WinWorldSid = 1, - WinLocalSid = 2, - WinCreatorOwnerSid = 3, - WinCreatorGroupSid = 4, - WinCreatorOwnerServerSid = 5, - WinCreatorGroupServerSid = 6, - WinNtAuthoritySid = 7, - WinDialupSid = 8, - WinNetworkSid = 9, - WinBatchSid = 10, - WinInteractiveSid = 11, - WinServiceSid = 12, - WinAnonymousSid = 13, - WinProxySid = 14, - WinEnterpriseControllersSid = 15, - WinSelfSid = 16, - WinAuthenticatedUserSid = 17, - WinRestrictedCodeSid = 18, - WinTerminalServerSid = 19, - WinRemoteLogonIdSid = 20, - WinLogonIdsSid = 21, - WinLocalSystemSid = 22, - WinLocalServiceSid = 23, - WinNetworkServiceSid = 24, - WinBuiltinDomainSid = 25, - WinBuiltinAdministratorsSid = 26, - WinBuiltinUsersSid = 27, - WinBuiltinGuestsSid = 28, - WinBuiltinPowerUsersSid = 29, - WinBuiltinAccountOperatorsSid = 30, - WinBuiltinSystemOperatorsSid = 31, - WinBuiltinPrintOperatorsSid = 32, - WinBuiltinBackupOperatorsSid = 33, - WinBuiltinReplicatorSid = 34, - WinBuiltinPreWindows2000CompatibleAccessSid = 35, - WinBuiltinRemoteDesktopUsersSid = 36, - WinBuiltinNetworkConfigurationOperatorsSid = 37, - WinAccountAdministratorSid = 38, - WinAccountGuestSid = 39, - WinAccountKrbtgtSid = 40, - WinAccountDomainAdminsSid = 41, - WinAccountDomainUsersSid = 42, - WinAccountDomainGuestsSid = 43, - WinAccountComputersSid = 44, - WinAccountControllersSid = 45, - WinAccountCertAdminsSid = 46, - WinAccountSchemaAdminsSid = 47, - WinAccountEnterpriseAdminsSid = 48, - WinAccountPolicyAdminsSid = 49, - WinAccountRasAndIasServersSid = 50, - WinNTLMAuthenticationSid = 51, - WinDigestAuthenticationSid = 52, - WinSChannelAuthenticationSid = 53, - WinThisOrganizationSid = 54, - WinOtherOrganizationSid = 55, - WinBuiltinIncomingForestTrustBuildersSid = 56, - WinBuiltinPerfMonitoringUsersSid = 57, - WinBuiltinPerfLoggingUsersSid = 58, - WinBuiltinAuthorizationAccessSid = 59, - WinBuiltinTerminalServerLicenseServersSid = 60, - WinBuiltinDCOMUsersSid = 61, - WinBuiltinIUsersSid = 62, - WinIUserSid = 63, - WinBuiltinCryptoOperatorsSid = 64, - WinUntrustedLabelSid = 65, - WinLowLabelSid = 66, - WinMediumLabelSid = 67, - WinHighLabelSid = 68, - WinSystemLabelSid = 69, - WinWriteRestrictedCodeSid = 70, - WinCreatorOwnerRightsSid = 71, - WinCacheablePrincipalsGroupSid = 72, - WinNonCacheablePrincipalsGroupSid = 73, - WinEnterpriseReadonlyControllersSid = 74, - WinAccountReadonlyControllersSid = 75, - WinBuiltinEventLogReadersGroup = 76, - WinNewEnterpriseReadonlyControllersSid = 77, - WinBuiltinCertSvcDComAccessGroup = 78, - WinMediumPlusLabelSid = 79, - WinLocalLogonSid = 80, - WinConsoleLogonSid = 81, - WinThisOrganizationCertificateSid = 82, -} WELL_KNOWN_SID_TYPE; - -#define SE_CREATE_TOKEN_NAME TEXT("SeCreateTokenPrivilege") -#define SE_ASSIGNPRIMARYTOKEN_NAME TEXT("SeAssignPrimaryTokenPrivilege") -#define SE_LOCK_MEMORY_NAME TEXT("SeLockMemoryPrivilege") -#define SE_INCREASE_QUOTA_NAME TEXT("SeIncreaseQuotaPrivilege") -#define SE_UNSOLICITED_INPUT_NAME TEXT("SeUnsolicitedInputPrivilege") -#define SE_MACHINE_ACCOUNT_NAME TEXT("SeMachineAccountPrivilege") -#define SE_TCB_NAME TEXT("SeTcbPrivilege") -#define SE_SECURITY_NAME TEXT("SeSecurityPrivilege") -#define SE_TAKE_OWNERSHIP_NAME TEXT("SeTakeOwnershipPrivilege") -#define SE_LOAD_DRIVER_NAME TEXT("SeLoadDriverPrivilege") -#define SE_SYSTEM_PROFILE_NAME TEXT("SeSystemProfilePrivilege") -#define SE_SYSTEMTIME_NAME TEXT("SeSystemtimePrivilege") -#define SE_PROF_SINGLE_PROCESS_NAME TEXT("SeProfileSingleProcessPrivilege") -#define SE_INC_BASE_PRIORITY_NAME TEXT("SeIncreaseBasePriorityPrivilege") -#define SE_CREATE_PAGEFILE_NAME TEXT("SeCreatePagefilePrivilege") -#define SE_CREATE_PERMANENT_NAME TEXT("SeCreatePermanentPrivilege") -#define SE_BACKUP_NAME TEXT("SeBackupPrivilege") -#define SE_RESTORE_NAME TEXT("SeRestorePrivilege") -#define SE_SHUTDOWN_NAME TEXT("SeShutdownPrivilege") -#define SE_DEBUG_NAME TEXT("SeDebugPrivilege") -#define SE_AUDIT_NAME TEXT("SeAuditPrivilege") -#define SE_SYSTEM_ENVIRONMENT_NAME TEXT("SeSystemEnvironmentPrivilege") -#define SE_CHANGE_NOTIFY_NAME TEXT("SeChangeNotifyPrivilege") -#define SE_REMOTE_SHUTDOWN_NAME TEXT("SeRemoteShutdownPrivilege") -#define SE_UNDOCK_NAME TEXT("SeUndockPrivilege") -#define SE_SYNC_AGENT_NAME TEXT("SeSyncAgentPrivilege") -#define SE_ENABLE_DELEGATION_NAME TEXT("SeEnableDelegationPrivilege") -#define SE_MANAGE_VOLUME_NAME TEXT("SeManageVolumePrivilege") -#define SE_IMPERSONATE_NAME TEXT("SeImpersonatePrivilege") -#define SE_CREATE_GLOBAL_NAME TEXT("SeCreateGlobalPrivilege") - -#define SE_GROUP_MANDATORY 0x00000001 -#define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002 -#define SE_GROUP_ENABLED 0x00000004 -#define SE_GROUP_OWNER 0x00000008 -#define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010 -#define SE_GROUP_INTEGRITY 0x00000020 -#define SE_GROUP_INTEGRITY_ENABLED 0x00000040 -#define SE_GROUP_LOGON_ID 0xC0000000 -#define SE_GROUP_RESOURCE 0x20000000 -#define SE_GROUP_VALID_ATTRIBUTES 0xE000007F +#define VER_WORKSTATION_NT 0x40000000 +#define VER_SERVER_NT 0x80000000 +#define VER_SUITE_SMALLBUSINESS 1 +#define VER_SUITE_ENTERPRISE 2 +#define VER_SUITE_BACKOFFICE 4 +#define VER_SUITE_COMMUNICATIONS 8 +#define VER_SUITE_TERMINAL 16 +#define VER_SUITE_SMALLBUSINESS_RESTRICTED 32 +#define VER_SUITE_EMBEDDEDNT 64 +#define VER_SUITE_DATACENTER 128 +#define VER_SUITE_SINGLEUSERTS 256 +#define VER_SUITE_PERSONAL 512 +#define VER_SUITE_BLADE 1024 +#define VER_SUITE_EMBEDDED_RESTRICTED 2048 +#define VER_SUITE_SECURITY_APPLIANCE 4096 +#define VER_SUITE_STORAGE_SERVER 8192 +#define VER_SUITE_COMPUTE_SERVER 16384 +#define VER_SUITE_WH_SERVER 32768 /* * Product types @@ -1063,6 +643,17 @@ #define PRODUCT_CORE 0x00000065 #define PRODUCT_PROFESSIONAL_WMC 0x00000067 #define PRODUCT_UNLICENSED 0xABCDABCD + +#define MAKELANGID(p,s) ((((WORD)(s))<<10)|(WORD)(p)) +#define PRIMARYLANGID(l) ((WORD)(l)&0x3ff) +#define SUBLANGID(l) ((WORD)(l)>>10) +#define MAKELCID(l,s) ((DWORD)((((DWORD)((WORD)(s)))<<16)|((DWORD)((WORD)(l))))) +#define LANGIDFROMLCID(l) ((WORD)(l)) +#define SORTIDFROMLCID(l) ((WORD)((((DWORD)(l))&NLS_VALID_LOCALE_MASK)>>16)) +#define SORTVERSIONFROMLCID(l) ((WORD)((((DWORD)(l))>>20)&0xf)) + +#define NLS_VALID_LOCALE_MASK 1048575 +#define LOCALE_NAME_MAX_LENGTH 85 #define LANG_NEUTRAL 0x00 #define LANG_INVARIANT 0x7f @@ -1193,26 +784,12 @@ #define LANG_YORUBA 0x6a #define LANG_ZULU 0x35 -/* FIXME: non-standard */ -#define LANG_ESPERANTO 0x8f -#define LANG_WALON 0x90 -#define LANG_CORNISH 0x92 - -/* FIXME: not present in the official headers */ -#define LANG_MALAGASY 0x8d -#define LANG_GAELIC 0x94 -#define LANG_SAAMI 0x3b -#define LANG_SUTU 0x30 -#define LANG_TSONGA 0x31 -#define LANG_VENDA 0x33 -#define LANG_MANX_GAELIC 0x94 - +#define SUBLANG_NEUTRAL 0x00 +#define SUBLANG_DEFAULT 0x01 +#define SUBLANG_SYS_DEFAULT 0x02 +#define SUBLANG_CUSTOM_DEFAULT 0x03 #define SUBLANG_CUSTOM_UNSPECIFIED 0x04 -#define SUBLANG_CUSTOM_DEFAULT 0x03 #define SUBLANG_UI_CUSTOM_DEFAULT 0x05 -#define SUBLANG_NEUTRAL 0x00 -#define SUBLANG_SYS_DEFAULT 0x02 -#define SUBLANG_DEFAULT 0x01 #define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01 #define SUBLANG_ALBANIAN_ALBANIA 0x01 #define SUBLANG_ALSATIAN_FRANCE 0x01 @@ -1307,15 +884,15 @@ #define SUBLANG_ICELANDIC_ICELAND 0x01 #define SUBLANG_IGBO_NIGERIA 0x01 #define SUBLANG_INDONESIAN_INDONESIA 0x01 +#define SUBLANG_INUKTITUT_CANADA 0x01 #define SUBLANG_INUKTITUT_CANADA_LATIN 0x02 -#define SUBLANG_INUKTITUT_CANADA 0x01 #define SUBLANG_IRISH_IRELAND 0x02 #define SUBLANG_ITALIAN 0x01 #define SUBLANG_ITALIAN_SWISS 0x02 #define SUBLANG_JAPANESE_JAPAN 0x01 #define SUBLANG_KANNADA_INDIA 0x01 +#define SUBLANG_KASHMIRI_SASIA 0x02 #define SUBLANG_KASHMIRI_INDIA 0x02 -#define SUBLANG_KASHMIRI_SASIA 0x02 #define SUBLANG_KAZAK_KAZAKHSTAN 0x01 #define SUBLANG_KHMER_CAMBODIA 0x01 #define SUBLANG_KICHE_GUATEMALA 0x01 @@ -1331,8 +908,8 @@ #define SUBLANG_LOWER_SORBIAN_GERMANY 0x02 #define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01 #define SUBLANG_MACEDONIAN_MACEDONIA 0x01 +#define SUBLANG_MALAY_MALAYSIA 0x01 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 -#define SUBLANG_MALAY_MALAYSIA 0x01 #define SUBLANG_MALAYALAM_INDIA 0x01 #define SUBLANG_MALTESE_MALTA 0x01 #define SUBLANG_MAORI_NEW_ZEALAND 0x01 @@ -1341,8 +918,8 @@ #define SUBLANG_MOHAWK_MOHAWK 0x01 #define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01 #define SUBLANG_MONGOLIAN_PRC 0x02 +#define SUBLANG_NEPALI_INDIA 0x02 #define SUBLANG_NEPALI_NEPAL 0x01 -#define SUBLANG_NEPALI_INDIA 0x02 #define SUBLANG_NORWEGIAN_BOKMAL 0x01 #define SUBLANG_NORWEGIAN_NYNORSK 0x02 #define SUBLANG_OCCITAN_FRANCE 0x01 @@ -1350,9 +927,8 @@ #define SUBLANG_PASHTO_AFGHANISTAN 0x01 #define SUBLANG_PERSIAN_IRAN 0x01 #define SUBLANG_POLISH_POLAND 0x01 +#define SUBLANG_PORTUGUESE 0x02 #define SUBLANG_PORTUGUESE_BRAZILIAN 0x01 -#define SUBLANG_PORTUGUESE 0x02 -#define SUBLANG_PORTUGUESE_PORTUGAL 0x02 #define SUBLANG_PUNJABI_INDIA 0x01 #define SUBLANG_QUECHUA_BOLIVIA 0x01 #define SUBLANG_QUECHUA_ECUADOR 0x02 @@ -1423,10 +999,10 @@ #define SUBLANG_UIGHUR_PRC 0x01 #define SUBLANG_UKRAINIAN_UKRAINE 0x01 #define SUBLANG_UPPER_SORBIAN_GERMANY 0x01 +#define SUBLANG_URDU_PAKISTAN 0x01 #define SUBLANG_URDU_INDIA 0x02 -#define SUBLANG_URDU_PAKISTAN 0x01 +#define SUBLANG_UZBEK_LATIN 0x01 #define SUBLANG_UZBEK_CYRILLIC 0x02 -#define SUBLANG_UZBEK_LATIN 0x01 #define SUBLANG_VIETNAMESE_VIETNAM 0x01 #define SUBLANG_WELSH_UNITED_KINGDOM 0x01 #define SUBLANG_WOLOF_SENEGAL 0x01 @@ -1435,7 +1011,7 @@ #define SUBLANG_YI_PRC 0x01 #define SUBLANG_YORUBA_NIGERIA 0x01 #define SUBLANG_ZULU_SOUTH_AFRICA 0x01 -#define NLS_VALID_LOCALE_MASK 1048575 + #define SORT_DEFAULT 0 #define SORT_JAPANESE_XJIS 0 #define SORT_JAPANESE_UNICODE 1 @@ -1451,20 +1027,649 @@ #define SORT_HUNGARIAN_TECHNICAL 1 #define SORT_GEORGIAN_TRADITIONAL 0 #define SORT_GEORGIAN_MODERN 1 -#define MAKELANGID(p,s) ((((WORD)(s))<<10)|(WORD)(p)) -#define MAKELCID(l,s) ((DWORD)((((DWORD)((WORD)(s)))<<16)|((DWORD)((WORD)(l))))) -#define PRIMARYLANGID(l) ((WORD)(l)&0x3ff) -#define SORTIDFROMLCID(l) ((WORD)((((DWORD)(l))&NLS_VALID_LOCALE_MASK)>>16)) -#define SORTVERSIONFROMLCID(l) ((WORD)((((DWORD)(l))>>20)&0xf)) -#define SUBLANGID(l) ((WORD)(l)>>10) -#define LANGIDFROMLCID(l) ((WORD)(l)) + #define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT) #define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT) + #define LOCALE_SYSTEM_DEFAULT MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT) #define LOCALE_USER_DEFAULT MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT) #define LOCALE_NEUTRAL MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT) #define LOCALE_INVARIANT MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT) -#define LOCALE_NAME_MAX_LENGTH 85 + +#undef __C89_NAMELESS +#undef __C89_NAMELESSSTRUCTNAME +#undef __C89_NAMELESSSTRUCTNAME1 +#undef __C89_NAMELESSSTRUCTNAME2 +#undef __C89_NAMELESSSTRUCTNAME3 +#undef __C89_NAMELESSSTRUCTNAME4 +#undef __C89_NAMELESSSTRUCTNAME5 +#undef __C89_NAMELESSUNIONNAME +#undef __C89_NAMELESSUNIONNAME1 +#undef __C89_NAMELESSUNIONNAME2 +#undef __C89_NAMELESSUNIONNAME3 +#undef __C89_NAMELESSUNIONNAME4 +#undef __C89_NAMELESSUNIONNAME5 +#undef __C89_NAMELESSUNIONNAME6 +#undef __C89_NAMELESSUNIONNAME7 +#undef __C89_NAMELESSUNIONNAME8 + +#if !defined(__WINESRC__) && !defined(WINE_NO_NAMELESS_EXTENSION) +# ifdef __GNUC__ + /* Anonymous structs support starts with gcc 2.96/g++ 2.95 */ +# if (__GNUC__ > 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ > 95) || ((__GNUC_MINOR__ == 95) && defined(__cplusplus)))) +# define __C89_NAMELESS __extension__ +# endif +# elif defined(_MSC_VER) +# define __C89_NAMELESS +# endif +#endif + +#ifdef __C89_NAMELESS +# define __C89_NAMELESSSTRUCTNAME +# define __C89_NAMELESSSTRUCTNAME1 +# define __C89_NAMELESSSTRUCTNAME2 +# define __C89_NAMELESSSTRUCTNAME3 +# define __C89_NAMELESSSTRUCTNAME4 +# define __C89_NAMELESSSTRUCTNAME5 +# define __C89_NAMELESSUNIONNAME +# define __C89_NAMELESSUNIONNAME1 +# define __C89_NAMELESSUNIONNAME2 +# define __C89_NAMELESSUNIONNAME3 +# define __C89_NAMELESSUNIONNAME4 +# define __C89_NAMELESSUNIONNAME5 +# define __C89_NAMELESSUNIONNAME6 +# define __C89_NAMELESSUNIONNAME7 +# define __C89_NAMELESSUNIONNAME8 +#else +# define __C89_NAMELESS +# define __C89_NAMELESSSTRUCTNAME DUMMYSTRUCTNAME +# define __C89_NAMELESSSTRUCTNAME1 DUMMYSTRUCTNAME1 +# define __C89_NAMELESSSTRUCTNAME2 DUMMYSTRUCTNAME2 +# define __C89_NAMELESSSTRUCTNAME3 DUMMYSTRUCTNAME3 +# define __C89_NAMELESSSTRUCTNAME4 DUMMYSTRUCTNAME4 +# define __C89_NAMELESSSTRUCTNAME5 DUMMYSTRUCTNAME5 +# define __C89_NAMELESSUNIONNAME DUMMYUNIONNAME +# define __C89_NAMELESSUNIONNAME1 DUMMYUNIONNAME1 +# define __C89_NAMELESSUNIONNAME2 DUMMYUNIONNAME2 +# define __C89_NAMELESSUNIONNAME3 DUMMYUNIONNAME3 +# define __C89_NAMELESSUNIONNAME4 DUMMYUNIONNAME4 +# define __C89_NAMELESSUNIONNAME5 DUMMYUNIONNAME5 +# define __C89_NAMELESSUNIONNAME6 DUMMYUNIONNAME6 +# define __C89_NAMELESSUNIONNAME7 DUMMYUNIONNAME7 +# define __C89_NAMELESSUNIONNAME8 DUMMYUNIONNAME8 +#endif + +# define DECLSPEC_HIDDEN + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef RC_INVOKED + +/*#ifdef _WINE*/ +#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))) + #define __WINE_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) +#else + #define __WINE_ALLOC_SIZE(x) +#endif +/*#endif*/ + + +/* FIXME for __WIN64 */ +#ifndef __ptr64 + #define __ptr64 +#endif +typedef void* __ptr64 PVOID64; + + +#endif /* RC_INVOKED */ + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4201) +#pragma warning(disable:4214) +#pragma warning(disable:4820) +#endif + +#define ACE_OBJECT_TYPE_PRESENT 0x00000001 +#define ACE_INHERITED_OBJECT_TYPE_PRESENT 0x00000002 + +#ifdef __cplusplus +#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \ +extern "C++" { \ + inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a)|((int)b)); } \ + inline ENUMTYPE operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \ + inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a)&((int)b)); } \ + inline ENUMTYPE operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \ + inline ENUMTYPE operator ~ (ENUMTYPE a) { return (ENUMTYPE)(~((int)a)); } \ + inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a)^((int)b)); } \ + inline ENUMTYPE operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \ +} +#else +#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) /* */ +#endif + +/* also in ddk/ntifs.h */ +#define COMPRESSION_FORMAT_NONE (0x0000) +#define COMPRESSION_FORMAT_DEFAULT (0x0001) +#define COMPRESSION_FORMAT_LZNT1 (0x0002) +#define COMPRESSION_ENGINE_STANDARD (0x0000) +#define COMPRESSION_ENGINE_MAXIMUM (0x0100) +#define COMPRESSION_ENGINE_HIBER (0x0200) +#define ACCESS_ALLOWED_ACE_TYPE (0x0) +#define ACCESS_DENIED_ACE_TYPE (0x1) +#define SYSTEM_AUDIT_ACE_TYPE (0x2) +#define SYSTEM_ALARM_ACE_TYPE (0x3) +/*end ntifs.h */ +#define OBJECT_INHERIT_ACE 1 +#define CONTAINER_INHERIT_ACE 2 +#define NO_PROPAGATE_INHERIT_ACE 4 +#define INHERIT_ONLY_ACE 8 +#define INHERITED_ACE 16 +#define VALID_INHERIT_FLAGS 0x1F +#define SUCCESSFUL_ACCESS_ACE_FLAG 64 +#define FAILED_ACCESS_ACE_FLAG 128 +#define DELETE 0x00010000L +#define READ_CONTROL 0x20000L +#define WRITE_DAC 0x40000L +#define WRITE_OWNER 0x80000L +#define SYNCHRONIZE 0x100000L +#define STANDARD_RIGHTS_REQUIRED 0xF0000 +#define STANDARD_RIGHTS_READ 0x20000 +#define STANDARD_RIGHTS_WRITE 0x20000 +#define STANDARD_RIGHTS_EXECUTE 0x20000 +#define STANDARD_RIGHTS_ALL 0x1F0000 +#define SPECIFIC_RIGHTS_ALL 0xFFFF +#define ACCESS_SYSTEM_SECURITY 0x1000000 + +#define REG_STANDARD_FORMAT 1 +#define REG_LATEST_FORMAT 2 +#define REG_NO_COMPRESSION 4 + +#ifndef WIN32_NO_STATUS + +#define STATUS_WAIT_0 ((DWORD)0x00000000) +#define STATUS_ABANDONED_WAIT_0 ((DWORD)0x00000080) +#define STATUS_USER_APC ((DWORD)0x000000C0) +#define STATUS_TIMEOUT ((DWORD)0x00000102) +#define STATUS_PENDING ((DWORD)0x00000103) +#define STATUS_SEGMENT_NOTIFICATION ((DWORD)0x40000005) +#define STATUS_GUARD_PAGE_VIOLATION ((DWORD)0x80000001) +#define STATUS_DATATYPE_MISALIGNMENT ((DWORD)0x80000002) +#define STATUS_BREAKPOINT ((DWORD)0x80000003) +#define STATUS_SINGLE_STEP ((DWORD)0x80000004) +#define STATUS_ACCESS_VIOLATION ((DWORD)0xC0000005) +#define STATUS_IN_PAGE_ERROR ((DWORD)0xC0000006) +#define STATUS_INVALID_HANDLE ((DWORD)0xC0000008) +#define STATUS_NO_MEMORY ((DWORD)0xC0000017) +#define STATUS_ILLEGAL_INSTRUCTION ((DWORD)0xC000001D) +#define STATUS_NONCONTINUABLE_EXCEPTION ((DWORD)0xC0000025) +#define STATUS_INVALID_DISPOSITION ((DWORD)0xC0000026) +#define STATUS_ARRAY_BOUNDS_EXCEEDED ((DWORD)0xC000008C) +#define STATUS_FLOAT_DENORMAL_OPERAND ((DWORD)0xC000008D) +#define STATUS_FLOAT_DIVIDE_BY_ZERO ((DWORD)0xC000008E) +#define STATUS_FLOAT_INEXACT_RESULT ((DWORD)0xC000008F) +#define STATUS_FLOAT_INVALID_OPERATION ((DWORD)0xC0000090) +#define STATUS_FLOAT_OVERFLOW ((DWORD)0xC0000091) +#define STATUS_FLOAT_STACK_CHECK ((DWORD)0xC0000092) +#define STATUS_FLOAT_UNDERFLOW ((DWORD)0xC0000093) +#define STATUS_INTEGER_DIVIDE_BY_ZERO ((DWORD)0xC0000094) +#define STATUS_INTEGER_OVERFLOW ((DWORD)0xC0000095) +#define STATUS_PRIVILEGED_INSTRUCTION ((DWORD)0xC0000096) +#define STATUS_STACK_OVERFLOW ((DWORD)0xC00000FD) +#define STATUS_CONTROL_C_EXIT ((DWORD)0xC000013A) +#define STATUS_FLOAT_MULTIPLE_FAULTS ((DWORD)0xC00002B4) +#define STATUS_FLOAT_MULTIPLE_TRAPS ((DWORD)0xC00002B5) +#define STATUS_REG_NAT_CONSUMPTION ((DWORD)0xC00002C9) +#define STATUS_SXS_EARLY_DEACTIVATION ((DWORD)0xC015000F) +#define STATUS_SXS_INVALID_DEACTIVATION ((DWORD)0xC0150010) + +#define DBG_EXCEPTION_HANDLED ((DWORD)0x00010001) +#define DBG_CONTINUE ((DWORD)0x00010002) +#define DBG_TERMINATE_THREAD ((DWORD)0x40010003) +#define DBG_TERMINATE_PROCESS ((DWORD)0x40010004) +#define DBG_CONTROL_C ((DWORD)0x40010005) +#define DBG_CONTROL_BREAK ((DWORD)0x40010008) +#define DBG_COMMAND_EXCEPTION ((DWORD)0x40010009) +#define DBG_EXCEPTION_NOT_HANDLED ((DWORD)0x80010001) + +#endif /* WIN32_NO_STATUS */ + +#define MAXIMUM_ALLOWED 0x2000000 +#define GENERIC_READ 0x80000000 +#define GENERIC_WRITE 0x40000000 +#define GENERIC_EXECUTE 0x20000000 +#define GENERIC_ALL 0x10000000 + +#define INVALID_FILE_ATTRIBUTES ((DWORD)-1) + +/* Also in ddk/winddk.h */ +#define FILE_LIST_DIRECTORY 0x00000001 +#define FILE_READ_DATA 0x00000001 +#define FILE_ADD_FILE 0x00000002 +#define FILE_WRITE_DATA 0x00000002 +#define FILE_ADD_SUBDIRECTORY 0x00000004 +#define FILE_APPEND_DATA 0x00000004 +#define FILE_CREATE_PIPE_INSTANCE 0x00000004 +#define FILE_READ_EA 0x00000008 +#define FILE_READ_PROPERTIES 0x00000008 +#define FILE_WRITE_EA 0x00000010 +#define FILE_WRITE_PROPERTIES 0x00000010 +#define FILE_EXECUTE 0x00000020 +#define FILE_TRAVERSE 0x00000020 +#define FILE_DELETE_CHILD 0x00000040 +#define FILE_READ_ATTRIBUTES 0x00000080 +#define FILE_WRITE_ATTRIBUTES 0x00000100 + +#define FILE_SHARE_READ 0x00000001 +#define FILE_SHARE_WRITE 0x00000002 +#define FILE_SHARE_DELETE 0x00000004 +#define FILE_SHARE_VALID_FLAGS 0x00000007 + +#define FILE_ATTRIBUTE_READONLY 0x00000001 +#define FILE_ATTRIBUTE_HIDDEN 0x00000002 +#define FILE_ATTRIBUTE_SYSTEM 0x00000004 +#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 +#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 +#define FILE_ATTRIBUTE_DEVICE 0x00000040 +#define FILE_ATTRIBUTE_NORMAL 0x00000080 +#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 +#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 +#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 +#define FILE_ATTRIBUTE_COMPRESSED 0x00000800 +#define FILE_ATTRIBUTE_OFFLINE 0x00001000 +#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 +#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000 +#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7 +#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7 + +#define FILE_COPY_STRUCTURED_STORAGE 0x00000041 +#define FILE_STRUCTURED_STORAGE 0x00000441 + +#define FILE_VALID_OPTION_FLAGS 0x00ffffff +#define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032 +#define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032 +#define FILE_VALID_SET_FLAGS 0x00000036 + +#define FILE_DIRECTORY_FILE 0x00000001 +#define FILE_WRITE_THROUGH 0x00000002 +#define FILE_SEQUENTIAL_ONLY 0x00000004 +#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008 +#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010 +#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020 +#define FILE_NON_DIRECTORY_FILE 0x00000040 +#define FILE_CREATE_TREE_CONNECTION 0x00000080 +#define FILE_COMPLETE_IF_OPLOCKED 0x00000100 +#define FILE_NO_EA_KNOWLEDGE 0x00000200 +#define FILE_OPEN_REMOTE_INSTANCE 0x00000400 +#define FILE_RANDOM_ACCESS 0x00000800 +#define FILE_DELETE_ON_CLOSE 0x00001000 +#define FILE_OPEN_BY_FILE_ID 0x00002000 +#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000 +#define FILE_NO_COMPRESSION 0x00008000 +#define FILE_RESERVE_OPFILTER 0x00100000 +#define FILE_OPEN_REPARSE_POINT 0x00200000 +#define FILE_OPEN_NO_RECALL 0x00400000 +#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 + +#define FILE_ALL_ACCESS \ + (STANDARD_RIGHTS_REQUIRED | \ + SYNCHRONIZE | \ + 0x1FF) + +#define FILE_GENERIC_EXECUTE \ + (STANDARD_RIGHTS_EXECUTE | \ + FILE_READ_ATTRIBUTES | \ + FILE_EXECUTE | \ + SYNCHRONIZE) + +#define FILE_GENERIC_READ \ + (STANDARD_RIGHTS_READ | \ + FILE_READ_DATA | \ + FILE_READ_ATTRIBUTES | \ + FILE_READ_EA | \ + SYNCHRONIZE) + +#define FILE_GENERIC_WRITE \ + (STANDARD_RIGHTS_WRITE | \ + FILE_WRITE_DATA | \ + FILE_WRITE_ATTRIBUTES | \ + FILE_WRITE_EA | \ + FILE_APPEND_DATA | \ + SYNCHRONIZE) +/* end winddk.h */ +/* also in ddk/ntifs.h */ +#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001 +#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002 +#define FILE_NOTIFY_CHANGE_NAME 0x00000003 +#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004 +#define FILE_NOTIFY_CHANGE_SIZE 0x00000008 +#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010 +#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020 +#define FILE_NOTIFY_CHANGE_CREATION 0x00000040 +#define FILE_NOTIFY_CHANGE_EA 0x00000080 +#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100 +#define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200 +#define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400 +#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800 +#define FILE_NOTIFY_VALID_MASK 0x00000fff + +#define FILE_CASE_SENSITIVE_SEARCH 0x00000001 +#define FILE_CASE_PRESERVED_NAMES 0x00000002 +#define FILE_UNICODE_ON_DISK 0x00000004 +#define FILE_PERSISTENT_ACLS 0x00000008 +#define FILE_FILE_COMPRESSION 0x00000010 +#define FILE_VOLUME_QUOTAS 0x00000020 +#define FILE_SUPPORTS_SPARSE_FILES 0x00000040 +#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080 +#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100 +#define FS_LFN_APIS 0x00004000 +#define FILE_VOLUME_IS_COMPRESSED 0x00008000 +#define FILE_SUPPORTS_OBJECT_IDS 0x00010000 +#define FILE_SUPPORTS_ENCRYPTION 0x00020000 +#define FILE_NAMED_STREAMS 0x00040000 + +#define IO_COMPLETION_QUERY_STATE 0x0001 +#define IO_COMPLETION_MODIFY_STATE 0x0002 +#define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3) +/* end ntifs.h */ + +/* also in ddk/winddk.h */ +#define DUPLICATE_CLOSE_SOURCE 0x00000001 +#define DUPLICATE_SAME_ACCESS 0x00000002 +/* end winddk.k */ + +#define MAILSLOT_NO_MESSAGE ((DWORD)-1) +#define MAILSLOT_WAIT_FOREVER ((DWORD)-1) +#define PROCESS_TERMINATE 1 +#define PROCESS_CREATE_THREAD 2 +#define PROCESS_SET_SESSIONID 4 +#define PROCESS_VM_OPERATION 8 +#define PROCESS_VM_READ 16 +#define PROCESS_VM_WRITE 32 +#define PROCESS_CREATE_PROCESS 128 +#define PROCESS_SET_QUOTA 256 +#define PROCESS_SET_INFORMATION 512 +#define PROCESS_QUERY_INFORMATION 1024 +#define PROCESS_SUSPEND_RESUME 2048 +#define PROCESS_QUERY_LIMITED_INFORMATION 0x1000 +#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xFFF) +#define PROCESS_DUP_HANDLE 64 +#define THREAD_TERMINATE 1 +#define THREAD_SUSPEND_RESUME 2 +#define THREAD_GET_CONTEXT 8 +#define THREAD_SET_CONTEXT 16 +#define THREAD_SET_INFORMATION 32 +#define THREAD_QUERY_INFORMATION 64 +#define THREAD_SET_THREAD_TOKEN 128 +#define THREAD_IMPERSONATE 256 +#define THREAD_DIRECT_IMPERSONATION 0x200 +#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF) +#define MUTANT_QUERY_STATE 0x0001 +#define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE) +#define TIMER_QUERY_STATE 0x0001 +#define TIMER_MODIFY_STATE 0x0002 +#define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|TIMER_QUERY_STATE|TIMER_MODIFY_STATE) +#define THREAD_BASE_PRIORITY_LOWRT 15 +#define THREAD_BASE_PRIORITY_MAX 2 +#define THREAD_BASE_PRIORITY_MIN (-2) +#define THREAD_BASE_PRIORITY_IDLE (-15) +/* + * To prevent gcc compiler warnings, bracket these defines when initialising + * a SID_IDENTIFIER_AUTHORITY, eg. + * SID_IDENTIFIER_AUTHORITY aNullSidAuthority = {SECURITY_NULL_SID_AUTHORITY}; + */ +#define SID_MAX_SUB_AUTHORITIES 15 + +/* security entities */ +#define SECURITY_NULL_RID (0x00000000L) +#define SECURITY_WORLD_RID (0x00000000L) +#define SECURITY_LOCAL_RID (0X00000000L) + +#define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0} + +/* S-1-1 */ +#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1} + +/* S-1-2 */ +#define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2} + +/* S-1-3 */ +#define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3} +#define SECURITY_CREATOR_OWNER_RID (0x00000000L) +#define SECURITY_CREATOR_GROUP_RID (0x00000001L) +#define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L) +#define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L) + +/* S-1-4 */ +#define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4} + +/* S-1-5 */ +#define SECURITY_NT_AUTHORITY {0,0,0,0,0,5} +#define SECURITY_DIALUP_RID 0x00000001L +#define SECURITY_NETWORK_RID 0x00000002L +#define SECURITY_BATCH_RID 0x00000003L +#define SECURITY_INTERACTIVE_RID 0x00000004L +#define SECURITY_LOGON_IDS_RID 0x00000005L +#define SECURITY_SERVICE_RID 0x00000006L +#define SECURITY_ANONYMOUS_LOGON_RID 0x00000007L +#define SECURITY_PROXY_RID 0x00000008L +#define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x00000009L +#define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID +#define SECURITY_PRINCIPAL_SELF_RID 0x0000000AL +#define SECURITY_AUTHENTICATED_USER_RID 0x0000000BL +#define SECURITY_RESTRICTED_CODE_RID 0x0000000CL +#define SECURITY_TERMINAL_SERVER_RID 0x0000000DL +#define SECURITY_REMOTE_LOGON_RID 0x0000000EL +#define SECURITY_THIS_ORGANIZATION_RID 0x0000000FL +#define SECURITY_LOCAL_SYSTEM_RID 0x00000012L +#define SECURITY_LOCAL_SERVICE_RID 0x00000013L +#define SECURITY_NETWORK_SERVICE_RID 0x00000014L +#define SECURITY_NT_NON_UNIQUE 0x00000015L +#define SECURITY_BUILTIN_DOMAIN_RID 0x00000020L + +#define SECURITY_PACKAGE_BASE_RID 0x00000040L +#define SECURITY_PACKAGE_NTLM_RID 0x0000000AL +#define SECURITY_PACKAGE_SCHANNEL_RID 0x0000000EL +#define SECURITY_PACKAGE_DIGEST_RID 0x00000015L +#define SECURITY_OTHER_ORGANIZATION_RID 0x000003E8L + +#define SECURITY_LOGON_IDS_RID_COUNT 0x3 +#define SID_REVISION 1 + +#define FOREST_USER_RID_MAX 0x000001F3L +#define DOMAIN_USER_RID_ADMIN 0x000001F4L +#define DOMAIN_USER_RID_GUEST 0x000001F5L +#define DOMAIN_USER_RID_KRBTGT 0x000001F6L +#define DOMAIN_USER_RID_MAX 0x000003E7L + +#define DOMAIN_GROUP_RID_ADMINS 0x00000200L +#define DOMAIN_GROUP_RID_USERS 0x00000201L +#define DOMAIN_GROUP_RID_GUESTS 0x00000202L +#define DOMAIN_GROUP_RID_COMPUTERS 0x00000203L +#define DOMAIN_GROUP_RID_CONTROLLERS 0x00000204L +#define DOMAIN_GROUP_RID_CERT_ADMINS 0x00000205L +#define DOMAIN_GROUP_RID_SCHEMA_ADMINS 0x00000206L +#define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS 0x00000207L +#define DOMAIN_GROUP_RID_POLICY_ADMINS 0x00000208L + +#define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16} +#define SECURITY_MANDATORY_UNTRUSTED_RID 0x00000000L +#define SECURITY_MANDATORY_LOW_RID 0x00001000L +#define SECURITY_MANDATORY_MEDIUM_RID 0x00002000L +#define SECURITY_MANDATORY_HIGH_RID 0x00003000L +#define SECURITY_MANDATORY_SYSTEM_RID 0x00004000L +#define SECURITY_MANDATORY_PROTECTED_PROCESS_RID 0x00005000L + +#define DOMAIN_ALIAS_RID_ADMINS 0x00000220L +#define DOMAIN_ALIAS_RID_USERS 0x00000221L +#define DOMAIN_ALIAS_RID_GUESTS 0x00000222L +#define DOMAIN_ALIAS_RID_POWER_USERS 0x00000223L + +#define DOMAIN_ALIAS_RID_ACCOUNT_OPS 0x00000224L +#define DOMAIN_ALIAS_RID_SYSTEM_OPS 0x00000225L +#define DOMAIN_ALIAS_RID_PRINT_OPS 0x00000226L +#define DOMAIN_ALIAS_RID_BACKUP_OPS 0x00000227L + +#define DOMAIN_ALIAS_RID_REPLICATOR 0x00000228L +#define DOMAIN_ALIAS_RID_RAS_SERVERS 0x00000229L +#define DOMAIN_ALIAS_RID_PREW2KCOMPACCESS 0x0000022AL +#define DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS 0x0000022BL +#define DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS 0x0000022CL +#define DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS 0x0000022DL + +#define DOMAIN_ALIAS_RID_MONITORING_USERS 0x0000022EL +#define DOMAIN_ALIAS_RID_LOGGING_USERS 0x0000022FL +#define DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS 0x00000230L +#define DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS 0x00000231L +#define DOMAIN_ALIAS_RID_DCOM_USERS 0x00000232L + +#define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16} + +typedef enum { + WinNullSid = 0, + WinWorldSid = 1, + WinLocalSid = 2, + WinCreatorOwnerSid = 3, + WinCreatorGroupSid = 4, + WinCreatorOwnerServerSid = 5, + WinCreatorGroupServerSid = 6, + WinNtAuthoritySid = 7, + WinDialupSid = 8, + WinNetworkSid = 9, + WinBatchSid = 10, + WinInteractiveSid = 11, + WinServiceSid = 12, + WinAnonymousSid = 13, + WinProxySid = 14, + WinEnterpriseControllersSid = 15, + WinSelfSid = 16, + WinAuthenticatedUserSid = 17, + WinRestrictedCodeSid = 18, + WinTerminalServerSid = 19, + WinRemoteLogonIdSid = 20, + WinLogonIdsSid = 21, + WinLocalSystemSid = 22, + WinLocalServiceSid = 23, + WinNetworkServiceSid = 24, + WinBuiltinDomainSid = 25, + WinBuiltinAdministratorsSid = 26, + WinBuiltinUsersSid = 27, + WinBuiltinGuestsSid = 28, + WinBuiltinPowerUsersSid = 29, + WinBuiltinAccountOperatorsSid = 30, + WinBuiltinSystemOperatorsSid = 31, + WinBuiltinPrintOperatorsSid = 32, + WinBuiltinBackupOperatorsSid = 33, + WinBuiltinReplicatorSid = 34, + WinBuiltinPreWindows2000CompatibleAccessSid = 35, + WinBuiltinRemoteDesktopUsersSid = 36, + WinBuiltinNetworkConfigurationOperatorsSid = 37, + WinAccountAdministratorSid = 38, + WinAccountGuestSid = 39, + WinAccountKrbtgtSid = 40, + WinAccountDomainAdminsSid = 41, + WinAccountDomainUsersSid = 42, + WinAccountDomainGuestsSid = 43, + WinAccountComputersSid = 44, + WinAccountControllersSid = 45, + WinAccountCertAdminsSid = 46, + WinAccountSchemaAdminsSid = 47, + WinAccountEnterpriseAdminsSid = 48, + WinAccountPolicyAdminsSid = 49, + WinAccountRasAndIasServersSid = 50, + WinNTLMAuthenticationSid = 51, + WinDigestAuthenticationSid = 52, + WinSChannelAuthenticationSid = 53, + WinThisOrganizationSid = 54, + WinOtherOrganizationSid = 55, + WinBuiltinIncomingForestTrustBuildersSid = 56, + WinBuiltinPerfMonitoringUsersSid = 57, + WinBuiltinPerfLoggingUsersSid = 58, + WinBuiltinAuthorizationAccessSid = 59, + WinBuiltinTerminalServerLicenseServersSid = 60, + WinBuiltinDCOMUsersSid = 61, + WinBuiltinIUsersSid = 62, + WinIUserSid = 63, + WinBuiltinCryptoOperatorsSid = 64, + WinUntrustedLabelSid = 65, + WinLowLabelSid = 66, + WinMediumLabelSid = 67, + WinHighLabelSid = 68, + WinSystemLabelSid = 69, + WinWriteRestrictedCodeSid = 70, + WinCreatorOwnerRightsSid = 71, + WinCacheablePrincipalsGroupSid = 72, + WinNonCacheablePrincipalsGroupSid = 73, + WinEnterpriseReadonlyControllersSid = 74, + WinAccountReadonlyControllersSid = 75, + WinBuiltinEventLogReadersGroup = 76, + WinNewEnterpriseReadonlyControllersSid = 77, + WinBuiltinCertSvcDComAccessGroup = 78, + WinMediumPlusLabelSid = 79, + WinLocalLogonSid = 80, + WinConsoleLogonSid = 81, + WinThisOrganizationCertificateSid = 82, +} WELL_KNOWN_SID_TYPE; + +#define SE_CREATE_TOKEN_NAME TEXT("SeCreateTokenPrivilege") +#define SE_ASSIGNPRIMARYTOKEN_NAME TEXT("SeAssignPrimaryTokenPrivilege") +#define SE_LOCK_MEMORY_NAME TEXT("SeLockMemoryPrivilege") +#define SE_INCREASE_QUOTA_NAME TEXT("SeIncreaseQuotaPrivilege") +#define SE_UNSOLICITED_INPUT_NAME TEXT("SeUnsolicitedInputPrivilege") +#define SE_MACHINE_ACCOUNT_NAME TEXT("SeMachineAccountPrivilege") +#define SE_TCB_NAME TEXT("SeTcbPrivilege") +#define SE_SECURITY_NAME TEXT("SeSecurityPrivilege") +#define SE_TAKE_OWNERSHIP_NAME TEXT("SeTakeOwnershipPrivilege") +#define SE_LOAD_DRIVER_NAME TEXT("SeLoadDriverPrivilege") +#define SE_SYSTEM_PROFILE_NAME TEXT("SeSystemProfilePrivilege") +#define SE_SYSTEMTIME_NAME TEXT("SeSystemtimePrivilege") +#define SE_PROF_SINGLE_PROCESS_NAME TEXT("SeProfileSingleProcessPrivilege") +#define SE_INC_BASE_PRIORITY_NAME TEXT("SeIncreaseBasePriorityPrivilege") +#define SE_CREATE_PAGEFILE_NAME TEXT("SeCreatePagefilePrivilege") +#define SE_CREATE_PERMANENT_NAME TEXT("SeCreatePermanentPrivilege") +#define SE_BACKUP_NAME TEXT("SeBackupPrivilege") +#define SE_RESTORE_NAME TEXT("SeRestorePrivilege") +#define SE_SHUTDOWN_NAME TEXT("SeShutdownPrivilege") +#define SE_DEBUG_NAME TEXT("SeDebugPrivilege") +#define SE_AUDIT_NAME TEXT("SeAuditPrivilege") +#define SE_SYSTEM_ENVIRONMENT_NAME TEXT("SeSystemEnvironmentPrivilege") +#define SE_CHANGE_NOTIFY_NAME TEXT("SeChangeNotifyPrivilege") +#define SE_REMOTE_SHUTDOWN_NAME TEXT("SeRemoteShutdownPrivilege") +#define SE_UNDOCK_NAME TEXT("SeUndockPrivilege") +#define SE_SYNC_AGENT_NAME TEXT("SeSyncAgentPrivilege") +#define SE_ENABLE_DELEGATION_NAME TEXT("SeEnableDelegationPrivilege") +#define SE_MANAGE_VOLUME_NAME TEXT("SeManageVolumePrivilege") +#define SE_IMPERSONATE_NAME TEXT("SeImpersonatePrivilege") +#define SE_CREATE_GLOBAL_NAME TEXT("SeCreateGlobalPrivilege") + +#define SE_GROUP_MANDATORY 0x00000001 +#define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002 +#define SE_GROUP_ENABLED 0x00000004 +#define SE_GROUP_OWNER 0x00000008 +#define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010 +#define SE_GROUP_INTEGRITY 0x00000020 +#define SE_GROUP_INTEGRITY_ENABLED 0x00000040 +#define SE_GROUP_LOGON_ID 0xC0000000 +#define SE_GROUP_RESOURCE 0x20000000 +#define SE_GROUP_VALID_ATTRIBUTES 0xE000007F + +/* FIXME: non-standard */ +#define LANG_ESPERANTO 0x8f +#define LANG_WALON 0x90 +#define LANG_CORNISH 0x92 + +/* FIXME: not present in the official headers */ +#define LANG_MALAGASY 0x8d +#define LANG_GAELIC 0x94 +#define LANG_SAAMI 0x3b +#define LANG_SUTU 0x30 +#define LANG_TSONGA 0x31 +#define LANG_VENDA 0x33 +#define LANG_MANX_GAELIC 0x94 +#define SUBLANG_PORTUGUESE_PORTUGAL 0x02 + #define ACL_REVISION 2 #define ACL_REVISION_DS 4 #define ACL_REVISION1 1 @@ -1473,16 +1678,6 @@ #define ACL_REVISION4 4 #define MIN_ACL_REVISION 2 #define MAX_ACL_REVISION 4 -#define MINCHAR 0x80 -#define MAXCHAR 0x7f -#define MINSHORT 0x8000 -#define MAXSHORT 0x7fff -#define MINLONG 0x80000000 -#define MAXLONG 0x7fffffff -#define MAXBYTE 0xff -#define MAXWORD 0xffff -#define MAXDWORD 0xffffffff -#define MAXLONGLONG (((LONGLONG)0x7fffffff << 32) | 0xffffffff) #define PROCESSOR_INTEL_386 386 #define PROCESSOR_INTEL_486 486 #define PROCESSOR_INTEL_PENTIUM 586 @@ -1637,63 +1832,6 @@ #define MESSAGE_RESOURCE_UNICODE 1 #define RTL_CRITSECT_TYPE 0 #define RTL_RESOURCE_TYPE 1 - -#define RTL_FIELD_TYPE(type, field) (((type*)0)->field) -#define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8) -#define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field))) - -/* Also in winddk.h */ -#if !defined(__GNUC__) -#define FIELD_OFFSET(t,f) ((LONG)(LONG_PTR)&(((t*) 0)->f)) -#else -#define FIELD_OFFSET(t,f) ((LONG)__builtin_offsetof(t,f)) -#endif -#ifndef CONTAINING_RECORD -#define CONTAINING_RECORD(address, type, field) \ - ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field)))) -#endif - -#define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field)) -#define RTL_SIZEOF_THROUGH_FIELD(type, field) \ - (FIELD_OFFSET(type, field) + RTL_FIELD_SIZE(type, field)) -#define RTL_CONTAINS_FIELD(Struct, Size, Field) \ - ((((PCHAR) (&(Struct)->Field)) + sizeof((Struct)->Field)) <= (((PCHAR) (Struct)) + (Size))) -#define RTL_NUMBER_OF_V1(A) (sizeof(A)/sizeof((A)[0])) - -#if defined(__cplusplus) && \ - !defined(MIDL_PASS) && \ - !defined(RC_INVOKED) && \ - !defined(_PREFAST_) && \ - (_MSC_FULL_VER >= 13009466) && \ - !defined(SORTPP_PASS) -#define RTL_NUMBER_OF_V2(A) (sizeof(*RtlpNumberOf(A))) -#else -#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A) -#endif - -#ifdef ENABLE_RTL_NUMBER_OF_V2 -#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V2(A) -#else -#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A) -#endif -#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A) -#define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A) - -#define RTL_FIELD_TYPE(type, field) (((type*)0)->field) -#define RTL_NUMBER_OF_FIELD(type, field) (RTL_NUMBER_OF(RTL_FIELD_TYPE(type, field))) -#define RTL_PADDING_BETWEEN_FIELDS(T, F1, F2) \ - ((FIELD_OFFSET(T, F2) > FIELD_OFFSET(T, F1)) \ - ? (FIELD_OFFSET(T, F2) - FIELD_OFFSET(T, F1) - RTL_FIELD_SIZE(T, F1)) \ - : (FIELD_OFFSET(T, F1) - FIELD_OFFSET(T, F2) - RTL_FIELD_SIZE(T, F2))) - -#if defined(__cplusplus) -#define RTL_CONST_CAST(type) const_cast<type> -#else -#define RTL_CONST_CAST(type) (type) -#endif - -#define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8) -#define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field))) /* end winddk.h */ #define IMAGE_SIZEOF_FILE_HEADER 20 @@ -2220,30 +2358,14 @@ #define VER_AND 6 #define VER_OR 7 #endif -#define VER_SERVER_NT 0x80000000 -#define VER_WORKSTATION_NT 0x40000000 + #define VER_PLATFORM_WIN32s 0 #define VER_PLATFORM_WIN32_WINDOWS 1 #define VER_PLATFORM_WIN32_NT 2 #define VER_NT_WORKSTATION 1 #define VER_NT_DOMAIN_CONTROLLER 2 #define VER_NT_SERVER 3 -#define VER_SUITE_SMALLBUSINESS 1 -#define VER_SUITE_ENTERPRISE 2 -#define VER_SUITE_BACKOFFICE 4 -#define VER_SUITE_COMMUNICATIONS 8 -#define VER_SUITE_TERMINAL 16 -#define VER_SUITE_SMALLBUSINESS_RESTRICTED 32 -#define VER_SUITE_EMBEDDEDNT 64 -#define VER_SUITE_DATACENTER 128 -#define VER_SUITE_SINGLEUSERTS 256 -#define VER_SUITE_PERSONAL 512 -#define VER_SUITE_BLADE 1024 -#define VER_SUITE_EMBEDDED_RESTRICTED 2048 -#define VER_SUITE_SECURITY_APPLIANCE 4096 -#define VER_SUITE_STORAGE_SERVER 8192 -#define VER_SUITE_COMPUTE_SERVER 16384 -#define VER_SUITE_WH_SERVER 32768 + #define WT_EXECUTEDEFAULT 0x00000000 #define WT_EXECUTEINIOTHREAD 0x00000001 #define WT_EXECUTEINUITHREAD 0x00000002 @@ -2503,18 +2625,6 @@ DWORD AclBytesFree; } ACL_SIZE_INFORMATION, *PACL_SIZE_INFORMATION; -typedef -_IRQL_requires_same_ -_Function_class_(EXCEPTION_ROUTINE) -EXCEPTION_DISPOSITION -NTAPI -EXCEPTION_ROUTINE( - _Inout_ struct _EXCEPTION_RECORD *ExceptionRecord, - _In_ PVOID EstablisherFrame, - _Inout_ struct _CONTEXT *ContextRecord, - _In_ PVOID DispatcherContext); - -typedef EXCEPTION_ROUTINE *PEXCEPTION_ROUTINE; #ifndef _LDT_ENTRY_DEFINED #define _LDT_ENTRY_DEFINED @@ -3420,38 +3530,6 @@ PCONTEXT ContextRecord; } EXCEPTION_POINTERS,*PEXCEPTION_POINTERS, *LPEXCEPTION_POINTERS; -#ifdef _M_PPC -#define LARGE_INTEGER_ORDER(x) x HighPart; DWORD LowPart; -#else -#define LARGE_INTEGER_ORDER(x) DWORD LowPart; x HighPart; -#endif - -typedef union _LARGE_INTEGER { -#if ! defined(NONAMELESSUNION) || defined(__cplusplus) - _ANONYMOUS_STRUCT struct { - LARGE_INTEGER_ORDER(LONG) - }; -#endif /* NONAMELESSUNION */ - struct { - LARGE_INTEGER_ORDER(LONG) - } u; - LONGLONG QuadPart; -} LARGE_INTEGER, *PLARGE_INTEGER; -typedef union _ULARGE_INTEGER { -#if ! defined(NONAMELESSUNION) || defined(__cplusplus) - _ANONYMOUS_STRUCT struct { - LARGE_INTEGER_ORDER(DWORD) - }; -#endif /* NONAMELESSUNION */ - struct { - LARGE_INTEGER_ORDER(DWORD) - } u; - ULONGLONG QuadPart; -} ULARGE_INTEGER, *PULARGE_INTEGER; -typedef struct _LUID { - LARGE_INTEGER_ORDER(LONG) -} LUID, *PLUID; - #include <pshpack4.h> typedef struct _LUID_AND_ATTRIBUTES { @@ -3816,25 +3894,6 @@ MESSAGE_RESOURCE_BLOCK Blocks[1]; } MESSAGE_RESOURCE_DATA,*PMESSAGE_RESOURCE_DATA; -typedef struct _LIST_ENTRY { - struct _LIST_ENTRY *Flink; - struct _LIST_ENTRY *Blink; -} LIST_ENTRY, *PLIST_ENTRY, *RESTRICTED_POINTER PRLIST_ENTRY; - -typedef struct _LIST_ENTRY32 { - DWORD Flink; - DWORD Blink; -} LIST_ENTRY32,*PLIST_ENTRY32; - -typedef struct _LIST_ENTRY64 { - ULONGLONG Flink; - ULONGLONG Blink; -} LIST_ENTRY64,*PLIST_ENTRY64; - -typedef struct _SINGLE_LIST_ENTRY { - struct _SINGLE_LIST_ENTRY *Next; -} SINGLE_LIST_ENTRY,*PSINGLE_LIST_ENTRY; - // // Slist Header // @@ -4038,18 +4097,6 @@ (NTAPI *PVECTORED_EXCEPTION_HANDLER)( struct _EXCEPTION_POINTERS *ExceptionInfo ); - -typedef struct _PROCESSOR_NUMBER { - WORD Group; - BYTE Number; - BYTE Reserved; -} PROCESSOR_NUMBER, *PPROCESSOR_NUMBER; - -typedef struct _GROUP_AFFINITY { - KAFFINITY Mask; - WORD Group; - WORD Reserved[3]; -} GROUP_AFFINITY, *PGROUP_AFFINITY; typedef struct _EVENTLOGRECORD { DWORD Length;
10 years
1
0
0
0
[tfaber] 64008: [NTOS:CC] - Consistently use LONGLONG for file offsets
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Aug 31 12:56:36 2014 New Revision: 64008 URL:
http://svn.reactos.org/svn/reactos?rev=64008&view=rev
Log: [NTOS:CC] - Consistently use LONGLONG for file offsets Modified: trunk/reactos/ntoskrnl/cc/copy.c trunk/reactos/ntoskrnl/cc/view.c trunk/reactos/ntoskrnl/include/internal/cc.h trunk/reactos/ntoskrnl/mm/section.c Modified: trunk/reactos/ntoskrnl/cc/copy.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/copy.c?rev=640…
============================================================================== --- trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cc/copy.c [iso-8859-1] Sun Aug 31 12:56:36 2014 @@ -200,7 +200,7 @@ _In_ PFILE_OBJECT FileObject, _In_ LONGLONG FileOffset, _Inout_ PVOID Buffer, - _In_ ULONG Length, + _In_ LONGLONG Length, _In_ CC_COPY_OPERATION Operation, _In_ BOOLEAN Wait, _Out_ PIO_STATUS_BLOCK IoStatus) @@ -467,7 +467,7 @@ { NTSTATUS Status; LARGE_INTEGER WriteOffset; - ULONG Length; + LONGLONG Length; ULONG CurrentLength; PMDL Mdl; ULONG i; @@ -478,7 +478,7 @@ "Wait %u)\n", FileObject, StartOffset->QuadPart, EndOffset->QuadPart, Wait); - Length = EndOffset->u.LowPart - StartOffset->u.LowPart; + Length = EndOffset->QuadPart - StartOffset->QuadPart; WriteOffset.QuadPart = StartOffset->QuadPart; if (FileObject->SectionObjectPointer->SharedCacheMap == NULL) @@ -489,9 +489,9 @@ while (Length > 0) { - if (Length + WriteOffset.u.LowPart % PAGE_SIZE > MAX_ZERO_LENGTH) - { - CurrentLength = MAX_ZERO_LENGTH - WriteOffset.u.LowPart % PAGE_SIZE; + if (Length + WriteOffset.QuadPart % PAGE_SIZE > MAX_ZERO_LENGTH) + { + CurrentLength = MAX_ZERO_LENGTH - WriteOffset.QuadPart % PAGE_SIZE; } else { Modified: trunk/reactos/ntoskrnl/cc/view.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=640…
============================================================================== --- trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cc/view.c [iso-8859-1] Sun Aug 31 12:56:36 2014 @@ -434,7 +434,7 @@ NTAPI CcRosLookupVacb ( PROS_SHARED_CACHE_MAP SharedCacheMap, - ULONG FileOffset) + LONGLONG FileOffset) { PLIST_ENTRY current_entry; PROS_VACB current; @@ -442,7 +442,7 @@ ASSERT(SharedCacheMap); - DPRINT("CcRosLookupVacb(SharedCacheMap 0x%p, FileOffset %lu)\n", + DPRINT("CcRosLookupVacb(SharedCacheMap 0x%p, FileOffset %I64u)\n", SharedCacheMap, FileOffset); KeAcquireGuardedMutex(&ViewLock); @@ -483,14 +483,14 @@ NTAPI CcRosMarkDirtyVacb ( PROS_SHARED_CACHE_MAP SharedCacheMap, - ULONG FileOffset) + LONGLONG FileOffset) { PROS_VACB Vacb; KIRQL oldIrql; ASSERT(SharedCacheMap); - DPRINT("CcRosMarkDirtyVacb(SharedCacheMap 0x%p, FileOffset %lu)\n", + DPRINT("CcRosMarkDirtyVacb(SharedCacheMap 0x%p, FileOffset %I64u)\n", SharedCacheMap, FileOffset); Vacb = CcRosLookupVacb(SharedCacheMap, FileOffset); @@ -529,7 +529,7 @@ NTAPI CcRosUnmapVacb ( PROS_SHARED_CACHE_MAP SharedCacheMap, - ULONG FileOffset, + LONGLONG FileOffset, BOOLEAN NowDirty) { PROS_VACB Vacb; @@ -538,7 +538,7 @@ ASSERT(SharedCacheMap); - DPRINT("CcRosUnmapVacb(SharedCacheMap 0x%p, FileOffset %lu, NowDirty %u)\n", + DPRINT("CcRosUnmapVacb(SharedCacheMap 0x%p, FileOffset %I64u, NowDirty %u)\n", SharedCacheMap, FileOffset, NowDirty); Vacb = CcRosLookupVacb(SharedCacheMap, FileOffset); @@ -582,7 +582,7 @@ NTSTATUS CcRosCreateVacb ( PROS_SHARED_CACHE_MAP SharedCacheMap, - ULONG FileOffset, + LONGLONG FileOffset, PROS_VACB *Vacb) { PROS_VACB current; @@ -595,7 +595,7 @@ DPRINT("CcRosCreateVacb()\n"); - if (FileOffset >= SharedCacheMap->FileSize.u.LowPart) + if (FileOffset >= SharedCacheMap->FileSize.QuadPart) { *Vacb = NULL; return STATUS_INVALID_PARAMETER; @@ -729,8 +729,8 @@ NTAPI CcRosGetVacb ( PROS_SHARED_CACHE_MAP SharedCacheMap, - ULONG FileOffset, - PULONGLONG BaseOffset, + LONGLONG FileOffset, + PLONGLONG BaseOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, PROS_VACB *Vacb) @@ -781,7 +781,7 @@ NTAPI CcRosRequestVacb ( PROS_SHARED_CACHE_MAP SharedCacheMap, - ULONG FileOffset, + LONGLONG FileOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, PROS_VACB *Vacb) @@ -789,13 +789,13 @@ * FUNCTION: Request a page mapping for a shared cache map */ { - ULONGLONG BaseOffset; + LONGLONG BaseOffset; ASSERT(SharedCacheMap); if (FileOffset % VACB_MAPPING_GRANULARITY != 0) { - DPRINT1("Bad fileoffset %x should be multiple of %x", + DPRINT1("Bad fileoffset %I64x should be multiple of %x", FileOffset, VACB_MAPPING_GRANULARITY); KeBugCheck(CACHE_MANAGER); } @@ -896,7 +896,7 @@ while (RemainingLength > 0) { - current = CcRosLookupVacb(SharedCacheMap, Offset.u.LowPart); + current = CcRosLookupVacb(SharedCacheMap, Offset.QuadPart); if (current != NULL) { if (current->Dirty) Modified: trunk/reactos/ntoskrnl/include/internal/cc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
============================================================================== --- trunk/reactos/ntoskrnl/include/internal/cc.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/include/internal/cc.h [iso-8859-1] Sun Aug 31 12:56:36 2014 @@ -184,8 +184,8 @@ NTAPI CcRosGetVacb( PROS_SHARED_CACHE_MAP SharedCacheMap, - ULONG FileOffset, - PULONGLONG BaseOffset, + LONGLONG FileOffset, + PLONGLONG BaseOffset, PVOID *BaseAddress, PBOOLEAN UptoDate, PROS_VACB *Vacb @@ -211,7 +211,7 @@ NTAPI CcRosUnmapVacb( PROS_SHARED_CACHE_MAP SharedCacheMap, - ULONG FileOffset, + LONGLONG FileOffset, BOOLEAN NowDirty ); @@ -219,7 +219,7 @@ NTAPI CcRosLookupVacb( PROS_SHARED_CACHE_MAP SharedCacheMap, - ULONG FileOffset + LONGLONG FileOffset ); VOID @@ -230,7 +230,7 @@ NTAPI CcRosMarkDirtyVacb( PROS_SHARED_CACHE_MAP SharedCacheMap, - ULONG FileOffset + LONGLONG FileOffset ); NTSTATUS @@ -267,7 +267,7 @@ NTAPI CcRosRequestVacb( PROS_SHARED_CACHE_MAP SharedCacheMap, - ULONG FileOffset, + LONGLONG FileOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, PROS_VACB *Vacb @@ -295,10 +295,10 @@ FORCEINLINE BOOLEAN DoRangesIntersect( - _In_ ULONGLONG Offset1, - _In_ ULONG Length1, - _In_ ULONGLONG Offset2, - _In_ ULONG Length2) + _In_ LONGLONG Offset1, + _In_ LONGLONG Length1, + _In_ LONGLONG Offset2, + _In_ LONGLONG Length2) { if (Offset1 + Length1 <= Offset2) return FALSE; @@ -310,9 +310,9 @@ FORCEINLINE BOOLEAN IsPointInRange( - _In_ ULONGLONG Offset1, - _In_ ULONG Length1, - _In_ ULONGLONG Point) + _In_ LONGLONG Offset1, + _In_ LONGLONG Length1, + _In_ LONGLONG Point) { return DoRangesIntersect(Offset1, Length1, Point, 1); } 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 Aug 31 12:56:36 2014 @@ -928,7 +928,7 @@ SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; IsDirectMapped = TRUE; #ifndef NEWCC - Status = CcRosUnmapVacb(SharedCacheMap, FileOffset.LowPart, Dirty); + Status = CcRosUnmapVacb(SharedCacheMap, FileOffset.QuadPart, Dirty); #else Status = STATUS_SUCCESS; #endif @@ -1017,7 +1017,7 @@ } BOOLEAN MiIsPageFromCache(PMEMORY_AREA MemoryArea, - ULONG SegOffset) + LONGLONG SegOffset) { #ifndef NEWCC if (!(MemoryArea->Data.SectionData.Segment->Image.Characteristics & IMAGE_SCN_MEM_SHARED)) @@ -1025,7 +1025,7 @@ PROS_SHARED_CACHE_MAP SharedCacheMap; PROS_VACB Vacb; SharedCacheMap = MemoryArea->Data.SectionData.Section->FileObject->SectionObjectPointer->SharedCacheMap; - Vacb = CcRosLookupVacb(SharedCacheMap, (ULONG)(SegOffset + MemoryArea->Data.SectionData.Segment->Image.FileOffset)); + Vacb = CcRosLookupVacb(SharedCacheMap, SegOffset + MemoryArea->Data.SectionData.Segment->Image.FileOffset); if (Vacb) { CcRosReleaseVacb(SharedCacheMap, Vacb, Vacb->Valid, FALSE, TRUE); @@ -1063,7 +1063,7 @@ NTSTATUS NTAPI MiReadPage(PMEMORY_AREA MemoryArea, - ULONG_PTR SegOffset, + LONGLONG SegOffset, PPFN_NUMBER Page) /* * FUNCTION: Read a page for a section backed memory area. @@ -1073,21 +1073,21 @@ * Page - Variable that receives a page contains the read data. */ { - ULONGLONG BaseOffset; - ULONGLONG FileOffset; + LONGLONG BaseOffset; + LONGLONG FileOffset; PVOID BaseAddress; BOOLEAN UptoDate; PROS_VACB Vacb; PFILE_OBJECT FileObject; NTSTATUS Status; - ULONG_PTR RawLength; + LONGLONG RawLength; PROS_SHARED_CACHE_MAP SharedCacheMap; BOOLEAN IsImageSection; - ULONG_PTR Length; + LONGLONG Length; FileObject = MemoryArea->Data.SectionData.Section->FileObject; SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; - RawLength = (ULONG_PTR)(MemoryArea->Data.SectionData.Segment->RawLength.QuadPart); + RawLength = MemoryArea->Data.SectionData.Segment->RawLength.QuadPart; FileOffset = SegOffset + MemoryArea->Data.SectionData.Segment->Image.FileOffset; IsImageSection = MemoryArea->Data.SectionData.Section->AllocationAttributes & SEC_IMAGE ? TRUE : FALSE; @@ -1111,7 +1111,7 @@ * alignment less than the file system block size. */ Status = CcRosGetVacb(SharedCacheMap, - (ULONG)FileOffset, + FileOffset, &BaseOffset, &BaseAddress, &UptoDate, @@ -1150,7 +1150,7 @@ PEPROCESS Process; KIRQL Irql; PVOID PageAddr; - ULONG_PTR VacbOffset; + LONGLONG VacbOffset; /* * Allocate a page, this is rather complicated by the possibility @@ -1164,7 +1164,7 @@ return(Status); } Status = CcRosGetVacb(SharedCacheMap, - (ULONG)FileOffset, + FileOffset, &BaseOffset, &BaseAddress, &UptoDate, @@ -1189,7 +1189,7 @@ Process = PsGetCurrentProcess(); PageAddr = MiMapPageInHyperSpace(Process, *Page, &Irql); - VacbOffset = (ULONG_PTR)(BaseOffset + VACB_MAPPING_GRANULARITY - FileOffset); + VacbOffset = BaseOffset + VACB_MAPPING_GRANULARITY - FileOffset; Length = RawLength - SegOffset; if (Length <= VacbOffset && Length <= PAGE_SIZE) { @@ -1205,7 +1205,7 @@ MiUnmapPageInHyperSpace(Process, PageAddr, Irql); CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE); Status = CcRosGetVacb(SharedCacheMap, - (ULONG)(FileOffset + VacbOffset), + FileOffset + VacbOffset, &BaseOffset, &BaseAddress, &UptoDate, @@ -1246,7 +1246,7 @@ NTSTATUS NTAPI MiReadPage(PMEMORY_AREA MemoryArea, - ULONG_PTR SegOffset, + LONGLONG SegOffset, PPFN_NUMBER Page) /* * FUNCTION: Read a page for a section backed memory area. @@ -1514,7 +1514,7 @@ } else { - Status = MiReadPage(MemoryArea, (ULONG_PTR)Offset.QuadPart, &Page); + Status = MiReadPage(MemoryArea, Offset.QuadPart, &Page); if (!NT_SUCCESS(Status)) { DPRINT1("MiReadPage failed (Status %x)\n", Status); @@ -1981,7 +1981,7 @@ */ if (DirectMapped && !Context.Private) { - if(!MiIsPageFromCache(MemoryArea, Context.Offset.LowPart)) + if(!MiIsPageFromCache(MemoryArea, Context.Offset.QuadPart)) { DPRINT1("Direct mapped non private page is not associated with the cache.\n"); KeBugCheck(MEMORY_MANAGEMENT); @@ -2073,7 +2073,7 @@ KeBugCheckEx(MEMORY_MANAGEMENT, STATUS_UNSUCCESSFUL, SwapEntry, (ULONG_PTR)Process, (ULONG_PTR)Address); } #ifndef NEWCC - Status = CcRosUnmapVacb(SharedCacheMap, (ULONG)FileOffset, FALSE); + Status = CcRosUnmapVacb(SharedCacheMap, FileOffset, FALSE); #else Status = STATUS_SUCCESS; #endif @@ -2373,7 +2373,7 @@ ASSERT(SwapEntry == 0); //SOffset.QuadPart = Offset.QuadPart + Segment->Image.FileOffset; #ifndef NEWCC - CcRosMarkDirtyVacb(SharedCacheMap, Offset.LowPart); + CcRosMarkDirtyVacb(SharedCacheMap, Offset.QuadPart); #endif MmLockSectionSegment(Segment); MmSetPageEntrySectionSegment(Segment, &Offset, PageEntry); @@ -4027,7 +4027,7 @@ FileObject = MemoryArea->Data.SectionData.Section->FileObject; SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; #ifndef NEWCC - CcRosMarkDirtyVacb(SharedCacheMap, (ULONG)(Offset.QuadPart + Segment->Image.FileOffset)); + CcRosMarkDirtyVacb(SharedCacheMap, Offset.QuadPart + Segment->Image.FileOffset); #endif ASSERT(SwapEntry == 0); }
10 years
1
0
0
0
← Newer
1
2
3
4
...
23
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
Results per page:
10
25
50
100
200