ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2005
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
814 discussions
Start a n
N
ew thread
[hpoussin] 15550: Silent debug message
by hpoussin@svn.reactos.com
Silent debug message Modified: trunk/reactos/subsys/win32k/objects/dc.c _____ Modified: trunk/reactos/subsys/win32k/objects/dc.c --- trunk/reactos/subsys/win32k/objects/dc.c 2005-05-27 20:07:48 UTC (rev 15549) +++ trunk/reactos/subsys/win32k/objects/dc.c 2005-05-27 20:35:59 UTC (rev 15550) @@ -2298,8 +2298,8 @@ INT Size, OldSize; ULONG DisplayNumber = 0; /* only default display supported */ - DPRINT1("DevMode->dmSize = %d\n", pDevMode->dmSize); - DPRINT1("DevMode->dmExtraSize = %d\n", pDevMode->dmDriverExtra); + DPRINT("DevMode->dmSize = %d\n", pDevMode->dmSize); + DPRINT("DevMode->dmExtraSize = %d\n", pDevMode->dmDriverExtra); if (pDevMode->dmSize != SIZEOF_DEVMODEW_300 && pDevMode->dmSize != SIZEOF_DEVMODEW_400 && pDevMode->dmSize != SIZEOF_DEVMODEW_500)
19 years, 7 months
1
0
0
0
[greatlrd] 15549: Implement NtGdiGetSystemPaletteUse and NtGdiSetSystemPaletteUse
by greatlrd@svn.reactos.com
Implement NtGdiGetSystemPaletteUse and NtGdiSetSystemPaletteUse this code have been taken from wine Modified: trunk/reactos/subsys/win32k/objects/color.c Modified: trunk/reactos/w32api/include/wingdi.h _____ Modified: trunk/reactos/subsys/win32k/objects/color.c --- trunk/reactos/subsys/win32k/objects/color.c 2005-05-27 19:43:07 UTC (rev 15548) +++ trunk/reactos/subsys/win32k/objects/color.c 2005-05-27 20:07:48 UTC (rev 15549) @@ -31,6 +31,9 @@ #endif //static HPALETTE hLastRealizedPalette = 0; // UnrealizeObject() needs it + +static UINT SystemPaletteUse = SYSPAL_STATIC; /* currently not considered */ + const PALETTEENTRY COLOR_sysPalTemplate[NB_RESERVED_COLORS] = { // first 10 entries in the system palette @@ -286,9 +289,8 @@ } UINT STDCALL NtGdiGetSystemPaletteUse(HDC hDC) -{ - DPRINT1("NtGdiGetSystemPaletteUse is unimplemented\n"); - return 0; +{ + return SystemPaletteUse; } /*! @@ -520,8 +522,27 @@ UINT STDCALL NtGdiSetSystemPaletteUse(HDC hDC, UINT Usage) { - UNIMPLEMENTED; - return 0; + UINT old = SystemPaletteUse; + + /* Device doesn't support colour palettes */ + if (!(NtGdiGetDeviceCaps(hDC, RASTERCAPS) & RC_PALETTE)) { + return SYSPAL_ERROR; + } + + switch (Usage) + { + case SYSPAL_NOSTATIC: + case SYSPAL_NOSTATIC256: + case SYSPAL_STATIC: + SystemPaletteUse = Usage; + break; + + default: + old=SYSPAL_ERROR; + break; + } + + return old; } BOOL STDCALL _____ Modified: trunk/reactos/w32api/include/wingdi.h --- trunk/reactos/w32api/include/wingdi.h 2005-05-27 19:43:07 UTC (rev 15548) +++ trunk/reactos/w32api/include/wingdi.h 2005-05-27 20:07:48 UTC (rev 15549) @@ -8,6 +8,12 @@ extern "C" { #endif +/* Get/SetSystemPaletteUse() values */ +#define SYSPAL_ERROR 0 +#define SYSPAL_STATIC 1 +#define SYSPAL_NOSTATIC 2 +#define SYSPAL_NOSTATIC256 3 + #define WINGDIAPI #define BI_RGB 0 #define BI_RLE8 1
19 years, 7 months
1
0
0
0
[hpoussin] 15548: Don't free heap for string that we don't own
by hpoussin@svn.reactos.com
Don't free heap for string that we don't own Modified: trunk/reactos/lib/user32/misc/display.c _____ Modified: trunk/reactos/lib/user32/misc/display.c --- trunk/reactos/lib/user32/misc/display.c 2005-05-27 19:29:24 UTC (rev 15547) +++ trunk/reactos/lib/user32/misc/display.c 2005-05-27 19:43:07 UTC (rev 15548) @@ -255,8 +255,6 @@ rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, lpDevMode, dwFlags ); - RtlFreeUnicodeString ( &DeviceName ); - return rc; }
19 years, 7 months
1
0
0
0
[chorns] 15547: Merge 15329:15546 from trunk
by chorns@svn.reactos.com
Merge 15329:15546 from trunk Modified: branches/xmlbuildsystem/reactos/apps/utils/ps/ps.c Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/arch/i386/hardware. c Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/arch/i386/i386disk. c Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/disk/partition.c Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/freeldr.c Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/mm/mm.c Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/reactos/reactos.c Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/reactos/setupldr.c Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/ui/ui.c Modified: branches/xmlbuildsystem/reactos/bootdata/hivesys.inf Modified: branches/xmlbuildsystem/reactos/bootdata/packages/reactos.dff Modified: branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/acpisys.c Modified: branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/fdo.c Modified: branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/include/acpisys.h Modified: branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/osl.c Modified: branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/pdo.c Modified: branches/xmlbuildsystem/reactos/drivers/bus/pci/pci.c Modified: branches/xmlbuildsystem/reactos/drivers/bus/pci/pdo.c Modified: branches/xmlbuildsystem/reactos/drivers/dd/serial/legacy.c Modified: branches/xmlbuildsystem/reactos/drivers/dd/serial/pnp.c Modified: branches/xmlbuildsystem/reactos/drivers/dd/serial/serial.h Modified: branches/xmlbuildsystem/reactos/drivers/fs/np/create.c Modified: branches/xmlbuildsystem/reactos/drivers/input/i8042prt/i8042prt.h Modified: branches/xmlbuildsystem/reactos/drivers/input/i8042prt/keyboard.c Modified: branches/xmlbuildsystem/reactos/drivers/input/i8042prt/mouse.c Modified: branches/xmlbuildsystem/reactos/drivers/net/afd/afd/info.c Modified: branches/xmlbuildsystem/reactos/drivers/net/ndis/include/miniport.h Modified: branches/xmlbuildsystem/reactos/drivers/net/ndis/include/ndissys.h Modified: branches/xmlbuildsystem/reactos/drivers/net/ndis/ndis/miniport.c Modified: branches/xmlbuildsystem/reactos/drivers/net/ndis/ndis/protocol.c Modified: branches/xmlbuildsystem/reactos/drivers/net/tcpip/tcpip/main.c Modified: branches/xmlbuildsystem/reactos/drivers/storage/cdrom/cdrom.c Modified: branches/xmlbuildsystem/reactos/drivers/storage/disk/disk.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/Makefile Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/Makefile Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/buffer_simple. c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/config.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/hcd-pci.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/hcd.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/hcd.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/hub.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/hub.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/makefile Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/makefile.crom Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/message.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/urb.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/usb-debug.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/usb.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/usb.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/usbcore.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/usbcore.def Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/core/usbcore.rc Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/makefile Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/makefile.crom Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/ohci-dbg.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/ohci-hcd.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/ohci-hub.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/ohci-mem.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/ohci-pci.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/ohci-q.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/ohci.def Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/ohci.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/ohci.rc Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/ohci_config.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/ohci_main.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/host/ohci_main.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/linux/asm/bitops.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/linux/bitops.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/linux/boot.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/linux/consts.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/linux/cromwell_type s.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/linux/errno.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/linux/linux_wrapper .h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/linux/list.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/linux/pci_hal.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/linux/pci_ids.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/linux/usb.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/linux/usb_ch9.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/sys/BootUSB.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/sys/Makefile Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/sys/linuxwrapper.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/sys/risefall.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/sys/ros_wrapper.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/sys/usbkey.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/sys/usbwrapper.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/sys/xpad.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/sys/xremote.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/uhci/makefile Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/uhci/uhci-hcd.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/uhci/uhci.def Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/uhci/uhci.rc Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/uhci/uhci_config.h Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/uhci/uhci_main.c Modified: branches/xmlbuildsystem/reactos/drivers/usb/cromwell/usb_wrapper.h Modified: branches/xmlbuildsystem/reactos/drivers/video/displays/framebuf/screen.c Modified: branches/xmlbuildsystem/reactos/drivers/video/miniport/vbe/vbemp.c Modified: branches/xmlbuildsystem/reactos/drivers/video/miniport/vbe/vbemp.h Modified: branches/xmlbuildsystem/reactos/hal/halx86/mp/mpconfig.c Modified: branches/xmlbuildsystem/reactos/include/ddk/obfuncs.h Modified: branches/xmlbuildsystem/reactos/include/debug.h [truncated at 100 lines; 279 more skipped] Property changes on: branches/xmlbuildsystem/reactos/apps/utils ___________________________________________________________________ Name: svn:ignore + _____ Modified: branches/xmlbuildsystem/reactos/apps/utils/ps/ps.c --- branches/xmlbuildsystem/reactos/apps/utils/ps/ps.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/apps/utils/ps/ps.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -1,4 +1,4 @@ -/* $Id$ +/* * * ReactOS ps - process list console viewer * @@ -26,7 +26,68 @@ /* NOTE: W32API ddk/ntapi.h header has wrong definition of SYSTEM_PROCESSES. */ #include <ntos/types.h> +typedef struct _SYSTEM_THREADS + { + LARGE_INTEGER KernelTime; + LARGE_INTEGER UserTime; + LARGE_INTEGER CreateTime; + ULONG WaitTime; + PVOID StartAddress; + CLIENT_ID ClientId; + KPRIORITY Priority; + LONG BasePriority; + ULONG ContextSwitches; + ULONG ThreadState; + ULONG WaitReason; + } SYSTEM_THREADS, *PSYSTEM_THREADS; + + typedef struct _SYSTEM_PROCESSES + { + ULONG NextEntryOffset; + ULONG NumberOfThreads; + LARGE_INTEGER SpareLi1; + LARGE_INTEGER SpareLi2; + LARGE_INTEGER SpareLi3; + LARGE_INTEGER CreateTime; + LARGE_INTEGER UserTime; + LARGE_INTEGER KernelTime; + UNICODE_STRING ImageName; + KPRIORITY BasePriority; + HANDLE UniqueProcessId; + HANDLE InheritedFromUniqueProcessId; + ULONG HandleCount; + ULONG SessionId; + ULONG PageDirectoryFrame; + /* + * This part corresponds to VM_COUNTERS_EX. + * NOTE: *NOT* THE SAME AS VM_COUNTERS! + */ + ULONG PeakVirtualSize; + ULONG VirtualSize; + ULONG PageFaultCount; + ULONG PeakWorkingSetSize; + ULONG WorkingSetSize; + ULONG QuotaPeakPagedPoolUsage; + ULONG QuotaPagedPoolUsage; + ULONG QuotaPeakNonPagedPoolUsage; + ULONG QuotaNonPagedPoolUsage; + ULONG PagefileUsage; + ULONG PeakPagefileUsage; + ULONG PrivateUsage; + + /* This part corresponds to IO_COUNTERS */ + LARGE_INTEGER ReadOperationCount; + LARGE_INTEGER WriteOperationCount; + LARGE_INTEGER OtherOperationCount; + LARGE_INTEGER ReadTransferCount; + LARGE_INTEGER WriteTransferCount; + LARGE_INTEGER OtherTransferCount; + + SYSTEM_THREADS Threads [1]; + } SYSTEM_PROCESSES, *PSYSTEM_PROCESSES; + + // x00000000 00000000 000:00:00 000:00:00 () static char* title = "P PID PPID KTime UTime NAME\n"; static char* title1 = "t TID KTime UTime State WaitResson\n"; @@ -36,7 +97,7 @@ struct status { DWORD state; char desc[10]; -} thread_stat[8 + 1] = { +} thread_stat[8 + 1] = { {0, "Init "}, {1, "Ready "}, {2, "Running "}, @@ -50,39 +111,45 @@ struct waitres { DWORD state; - char desc[11]; -} waitreason[28 + 1] = { - {0, "Executive "}, - {1, "FreePage "}, - {2, "PageIn "}, - {3, "PoolAlloc "}, - {4, "DelayExec "}, - {5, "Suspended "}, - {6, "UserReq "}, - {7, "WrExecutive"}, - {8, "WrFreePage "}, - {9, "WrPageIn "}, - {10,"WrPoolAlloc"}, - {11,"WrDelayExec"}, - {12,"WrSuspended"}, - {13,"WrUserReq "}, - {14,"WrEventPair"}, - {15,"WrQueue "}, - {16,"WrLpcRec "}, - {17,"WrLpcReply "}, - {18,"WrVirtualMm"}, - {19,"WrPageOut "}, - {20,"WrRendez "}, - {21,"Spare1 "}, - {22,"Spare2 "}, - {23,"Spare3 "}, - {24,"Spare4 "}, - {25,"Spare5 "}, - {26,"Spare6 "}, - {27,"WrKernel "}, - {-1," ? "} + char desc[17]; +} waitreason[35 + 1] = { + {0, "Executive "}, + {1, "FreePage "}, + {2, "PageIn "}, + {3, "PoolAllocation "}, + {4, "DelayExecution "}, + {5, "Suspended "}, + {6, "UserRequest "}, + {7, "WrExecutive "}, + {8, "WrFreePage "}, + {9, "WrPageIn "}, + {10,"WrPoolAllocation "}, + {11,"WrDelayExecution "}, + {12,"WrSuspended "}, + {13,"WrUserRequest "}, + {14,"WrEventPair "}, + {15,"WrQueue "}, + {16,"WrLpcReceive "}, + {17,"WrLpcReply "}, + {18,"WrVirtualMemory "}, + {19,"WrPageOut "}, + {20,"WrRendezvous "}, + {21,"Spare2 "}, + {22,"WrGuardedMutex "}, + {23,"Spare4 "}, + {24,"Spare5 "}, + {25,"Spare6 "}, + {26,"WrKernel "}, + {27,"WrResource "}, + {28,"WrPushLock "}, + {29,"WrMutex "}, + {30,"WrQuantumEnd "}, + {31,"WrDispatchInt "}, + {32,"WrPreempted "}, + {33,"WrYieldExecution "}, + {34,"MaximumWaitReason"}, + {-1," ? "} }; - BOOL CALLBACK EnumThreadProc(HWND hwnd, LPARAM lp) { @@ -90,9 +157,9 @@ LONG style; HANDLE stdout = GetStdHandle(STD_OUTPUT_HANDLE); char buf[256]; - + GetWindowText(hwnd, (LPTSTR)lp, 30); - + if(hwnd != 0) { style = GetWindowLong(hwnd, GWL_STYLE); @@ -110,13 +177,13 @@ DWORD r; ANSI_STRING astring; HANDLE stdout = GetStdHandle(STD_OUTPUT_HANDLE); - PSYSTEM_PROCESS_INFORMATION SystemProcesses = NULL; - PSYSTEM_PROCESS_INFORMATION CurrentProcess; + PSYSTEM_PROCESSES SystemProcesses = NULL; + PSYSTEM_PROCESSES CurrentProcess; ULONG BufferSize, ReturnSize; NTSTATUS Status; char buf[256]; char buf1[256]; - + WriteFile(stdout, title, lstrlen(title), &r, NULL); WriteFile(stdout, title1, lstrlen(title1), &r, NULL); WriteFile(stdout, title2, lstrlen(title2), &r, NULL); @@ -153,7 +220,7 @@ hour = (ptime.QuadPart / (10000000LL * 3600LL)); minute = (ptime.QuadPart / (10000000LL * 60LL)) % 60LL; seconds = (ptime.QuadPart / 10000000LL) % 60LL; - + ptime.QuadPart = CurrentProcess->UserTime.QuadPart; hour1 = (ptime.QuadPart / (10000000LL * 3600LL)); minute1 = (ptime.QuadPart / (10000000LL * 60LL)) % 60LL; @@ -166,7 +233,7 @@ hour, minute, seconds, hour1, minute1, seconds1, astring.Buffer); WriteFile(stdout, buf, lstrlen(buf), &r, NULL); - + RtlFreeAnsiString(&astring); for (ti = 0; ti < CurrentProcess->NumberOfThreads; ti++) @@ -175,37 +242,37 @@ struct waitres *waitt; char szWindowName[30] = {" "}; - ptime = CurrentProcess->TH[ti].KernelTime; + ptime = CurrentProcess->Threads[ti].KernelTime; thour = (ptime.QuadPart / (10000000LL * 3600LL)); tmin = (ptime.QuadPart / (10000000LL * 60LL)) % 60LL; tsec = (ptime.QuadPart / 10000000LL) % 60LL; - ptime = CurrentProcess->TH[ti].UserTime; + ptime = CurrentProcess->Threads[ti].UserTime; thour1 = (ptime.QuadPart / (10000000LL * 3600LL)); tmin1 = (ptime.QuadPart / (10000000LL * 60LL)) % 60LL; tsec1 = (ptime.QuadPart / 10000000LL) % 60LL; statt = thread_stat; - while (statt->state != CurrentProcess->TH[ti].ThreadState && statt->state >= 0) + while (statt->state != CurrentProcess->Threads[ti].ThreadState && statt->state >= 0) statt++; waitt = waitreason; - while (waitt->state != CurrentProcess->TH[ti].WaitReason && waitt->state >= 0) + while (waitt->state != CurrentProcess->Threads[ti].WaitReason && waitt->state >= 0) waitt++; - wsprintf (buf1, + wsprintf (buf1, "t% %8d %3d:%02d:%02d %3d:%02d:%02d %s %s\n", - CurrentProcess->TH[ti].ClientId.UniqueThread, + CurrentProcess->Threads[ti].ClientId.UniqueThread, thour, tmin, tsec, thour1, tmin1, tsec1, statt->desc , waitt->desc); WriteFile(stdout, buf1, lstrlen(buf1), &r, NULL); - EnumThreadWindows((DWORD)CurrentProcess->TH[ti].ClientId.UniqueThread, + EnumThreadWindows((DWORD)CurrentProcess->Threads[ti].ClientId.UniqueThre ad, (ENUMWINDOWSPROC) EnumThreadProc, (LPARAM)(LPTSTR) szWindowName ); } - CurrentProcess = (PSYSTEM_PROCESS_INFORMATION)((ULONG_PTR)CurrentProcess + + CurrentProcess = (PSYSTEM_PROCESSES)((ULONG_PTR)CurrentProcess + CurrentProcess->NextEntryOffset); - } + } return (0); } _____ Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/arch/i386/hardware. c --- branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/arch/i386/hardware. c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/arch/i386/hardware. c 2005-05-27 19:29:24 UTC (rev 15547) @@ -1715,7 +1715,7 @@ /* Set 'Identifier' value */ strcpy(Buffer, "PCAT_ENHANCED"); - Error = RegSetValue(ControllerKey, + Error = RegSetValue(PeripheralKey, "Identifier", REG_SZ, Buffer, _____ Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/arch/i386/i386disk. c --- branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/arch/i386/i386disk. c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/arch/i386/i386disk. c 2005-05-27 19:29:24 UTC (rev 15547) @@ -206,9 +206,27 @@ // Partition requested was zero which means the boot partition if (! DiskGetActivePartitionEntry(i386BootDrive, &PartitionTableEntry)) { + /* Try partition-less disk */ + *StartSector = 0; + *SectorCount = 0; + } + /* Check for valid partition */ + else if (PartitionTableEntry.SystemIndicator == PARTITION_ENTRY_UNUSED) + { return FALSE; } + else + { + *StartSector = PartitionTableEntry.SectorCountBeforePartition; + *SectorCount = PartitionTableEntry.PartitionSectorCount; + } } + else if (0xff == i386BootPartition) + { + /* Partition-less disk */ + *StartSector = 0; + *SectorCount = 0; + } else { // Get requested partition @@ -216,25 +234,26 @@ { return FALSE; } + /* Check for valid partition */ + else if (PartitionTableEntry.SystemIndicator == PARTITION_ENTRY_UNUSED) + { + return FALSE; + } + else + { + *StartSector = PartitionTableEntry.SectorCountBeforePartition; + *SectorCount = PartitionTableEntry.PartitionSectorCount; + } } - // Check for valid partition - if (PartitionTableEntry.SystemIndicator == PARTITION_ENTRY_UNUSED) - { - return FALSE; - } - // Try to recognize the file system - if (!FsRecognizeVolume(i386BootDrive, PartitionTableEntry.SectorCountBeforePartition, &VolumeType)) + if (!FsRecognizeVolume(i386BootDrive, *StartSector, &VolumeType)) { return FALSE; } *DriveNumber = i386BootDrive; - *StartSector = PartitionTableEntry.SectorCountBeforePartition; - *SectorCount = PartitionTableEntry.PartitionSectorCount; - //switch (PartitionTableEntry.SystemIndicator) switch (VolumeType) { case PARTITION_FAT_12: _____ Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/disk/partition.c --- branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/disk/partition.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/disk/partition.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -63,12 +63,12 @@ // Make sure there was only one bootable partition if (BootablePartitionCount == 0) { - DiskError("No bootable (active) partitions found.", 0); + DbgPrint((DPRINT_DISK, "No bootable (active) partitions found.\n")); return FALSE; } else if (BootablePartitionCount != 1) { - DiskError("Too many bootable (active) partitions found.", 0); + DbgPrint((DPRINT_DISK, "Too many bootable (active) partitions found.\n")); return FALSE; } _____ Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/freeldr.c --- branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/freeldr.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/freeldr.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -35,7 +35,7 @@ DebugInit(); - DbgPrint((DPRINT_WARNING, "BootMain() called. BootDrive = 0x%x BootPartition = %d\n", BootDrive, BootPartition)); + DbgPrint((DPRINT_WARNING, "BootMain() called.\n")); if (!MmInitializeMemoryManager()) { _____ Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/mm/mm.c --- branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/mm/mm.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/mm/mm.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -36,10 +36,30 @@ VOID MemAllocTest(VOID); #endif // DEBUG +/* + * Hack alert + * Normally, we allocate whole pages. This is ofcourse wastefull for small + * allocations (a few bytes). So, for small allocations (smaller than a page) + * we sub-allocate. When the first small allocation is done, a page is + * requested. We keep a pointer to that page in SubAllocationPage. The alloc + * is satisfied by returning a pointer to the beginning of the page. We also + * keep track of how many bytes are still available in the page in SubAllocationRest. + * When the next small request comes in, we try to allocate it just after the + * memory previously allocated. If it won't fit, we allocate a new page and + * the whole process starts again. + * Note that suballocations are done back-to-back, there's no bookkeeping at all. + * That also means that we cannot really free suballocations. So, when a free is + * done and it is determined that this might be a free of a sub-allocation, we + * just no-op the free. + * Perhaps we should use the heap routines from ntdll here. + */ +static PVOID SubAllocationPage = NULL; +static unsigned SubAllocationRest = 0; + PVOID MmAllocateMemory(ULONG MemorySize) { - ULONG PagesNeeded; - ULONG FirstFreePageFromEnd; + ULONG PagesNeeded; + ULONG FirstFreePageFromEnd; PVOID MemPointer; if (MemorySize == 0) @@ -49,6 +69,14 @@ return NULL; } + MemorySize = ROUND_UP(MemorySize, 4); + if (MemorySize <= SubAllocationRest) + { + MemPointer = SubAllocationPage + MM_PAGE_SIZE - SubAllocationRest; + SubAllocationRest -= MemorySize; + return MemPointer; + } + // Find out how many blocks it will take to // satisfy this allocation PagesNeeded = ROUND_UP(MemorySize, MM_PAGE_SIZE) / MM_PAGE_SIZE; @@ -76,6 +104,13 @@ FreePagesInLookupTable -= PagesNeeded; MemPointer = (PVOID)(FirstFreePageFromEnd * MM_PAGE_SIZE); + if (MemorySize < MM_PAGE_SIZE) + { + SubAllocationPage = MemPointer; + SubAllocationRest = MM_PAGE_SIZE - MemorySize; + } + + #ifdef DEBUG IncrementAllocationCount(); DbgPrint((DPRINT_MEMORY, "Allocated %d bytes (%d pages) of memory starting at page %d. AllocCount: %d\n", MemorySize, PagesNeeded, FirstFreePageFromEnd, AllocationCount)); @@ -235,6 +270,13 @@ #endif + /* If this allocation is only a single page, it could be a sub-allocated page. + * Just don't free it */ + if (1 == PageCount) + { + return; + } + // Loop through our array and mark all the // blocks as free for (Idx=PageNumber; Idx<(PageNumber + PageCount); Idx++) _____ Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/reactos/reactos.c --- branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/reactos/reactos.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/reactos/reactos.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -756,6 +756,16 @@ if (!FrLdrLoadDriver(szHalName, 10)) return; +#if 0 + /* Load bootvid */ + strcpy(value, "INBV.DLL"); + strcpy(szHalName, szBootPath); + strcat(szHalName, "SYSTEM32\\"); + strcat(szHalName, value); + + if (!FrLdrLoadDriver(szHalName, 10)) + return; +#endif /* * Load the System hive from disk */ _____ Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/reactos/setupldr.c --- branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/reactos/setupldr.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/reactos/setupldr.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -34,7 +34,7 @@ #include "registry.h" -//#define USE_UI +#define USE_UI static BOOL @@ -88,7 +88,7 @@ * Update the status bar with the current file */ #ifdef USE_UI - sprintf(szBuffer, "Reading %s", szShortName); + sprintf(szBuffer, "Setup is loading files (%s)", szShortName); UiDrawStatusText(szBuffer); #else printf("Reading %s\n", szShortName); @@ -155,7 +155,7 @@ * Update the status bar with the current file */ #ifdef USE_UI - sprintf(szBuffer, "Reading %s", szShortName); + sprintf(szBuffer, "Setup is loading files (%s)", szShortName); UiDrawStatusText(szBuffer); #else printf("Reading %s\n", szShortName); @@ -220,7 +220,7 @@ * Update the status bar with the current file */ #ifdef USE_UI - sprintf(szBuffer, "Reading %s", szShortName); + sprintf(szBuffer, "Setup is loading files (%s)", szShortName); UiDrawStatusText(szBuffer); #else printf("Reading %s\n", szShortName); @@ -232,6 +232,7 @@ return(TRUE); } +BOOL SetupUiInitialize(VOID); VOID RunLoader(VOID) { @@ -294,7 +295,7 @@ #endif #ifdef USE_UI - UiInitialize(); + SetupUiInitialize(); UiDrawStatusText(""); #endif _____ Modified: branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/ui/ui.c --- branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/ui/ui.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/boot/freeldr/freeldr/ui/ui.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -27,6 +27,7 @@ #include <inifile.h> #include <version.h> #include <video.h> +#include <reactos/buildno.h> ULONG UiScreenWidth = 80; // Screen Width ULONG UiScreenHeight = 25; // Screen Height @@ -197,7 +198,40 @@ UserInterfaceUp = TRUE; DbgPrint((DPRINT_UI, "UiInitialize() returning TRUE.\n")); + return TRUE; +} +BOOL SetupUiInitialize(VOID) +{ + + CHAR DisplayModeText[260]; + ULONG Depth; + + + DisplayModeText[0] = '\0'; + + + UiDisplayMode = MachVideoSetDisplayMode(DisplayModeText, TRUE); + MachVideoGetDisplaySize(&UiScreenWidth, &UiScreenHeight, &Depth); + + TuiInitialize(); + + // Draw the backdrop and fade it in if special effects are enabled + TuiFillArea(0, + 0, + UiScreenWidth - 1, + UiScreenHeight - 2, + 0, + ATTR(UiBackdropFgColor, UiBackdropBgColor)); + + UiStatusBarBgColor = 7; + UserInterfaceUp = TRUE; + + TuiDrawText(4, 1, "ReactOS " KERNEL_VERSION_STR " Setup", ATTR(COLOR_GRAY, UiBackdropBgColor)); + TuiDrawText(3, 2, "\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xC D\xCD\xCD\xCD\xCD\xCD\xCD", ATTR(COLOR_GRAY, UiBackdropBgColor)); + + DbgPrint((DPRINT_UI, "UiInitialize() returning TRUE.\n")); + return TRUE; } _____ Modified: branches/xmlbuildsystem/reactos/bootdata/hivesys.inf --- branches/xmlbuildsystem/reactos/bootdata/hivesys.inf 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/bootdata/hivesys.inf 2005-05-27 19:29:24 UTC (rev 15547) @@ -46,6 +46,9 @@ HKLM,"SYSTEM\CurrentControlSet\Control\ComputerName",,0x00000012 HKLM,"SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName","Compu terName",0x00000002,"COMPUTERNAME" +; Device classes key +HKLM,"SYSTEM\CurrentControlSet\Control\DeviceClasses",,0x00000012 + ; Hardware profile settings HKLM,"SYSTEM\CurrentControlSet\Control\IDConfigDB",,0x00000012 HKLM,"SYSTEM\CurrentControlSet\Control\IDConfigDB","CurrentConfig",0x000 10001,0x00000000 @@ -529,7 +532,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\DebugOut","ErrorControl",0x00010 001,0x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\DebugOut","Group",0x00000000,"De bug" HKLM,"SYSTEM\CurrentControlSet\Services\DebugOut","ImagePath",0x00020000 ,"system32\drivers\debugout.sys" -HKLM,"SYSTEM\CurrentControlSet\Services\DebugOut","Start",0x00010001,0x 00000001 +HKLM,"SYSTEM\CurrentControlSet\Services\DebugOut","Start",0x00010001,0x 00000004 HKLM,"SYSTEM\CurrentControlSet\Services\DebugOut","Type",0x00010001,0x00 000001 ; Disk class driver @@ -675,7 +678,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Ne2000","ErrorControl",0x0001000 1,0x00000001 HKLM,"SYSTEM\CurrentControlSet\Services\Ne2000","Group",0x00000000,"NDIS " HKLM,"SYSTEM\CurrentControlSet\Services\Ne2000","ImagePath",0x00020000," system32\drivers\ne2000.sys" -HKLM,"SYSTEM\CurrentControlSet\Services\Ne2000","Start",0x00010001,0x00 000004 +HKLM,"SYSTEM\CurrentControlSet\Services\Ne2000","Start",0x00010001,0x00 000003 HKLM,"SYSTEM\CurrentControlSet\Services\Ne2000","Type",0x00010001,0x0000 0001 HKLM,"SYSTEM\CurrentControlSet\Services\Ne2000","Route",0x00000000,"Ne20 001" @@ -687,8 +690,8 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08 002BE10318}\0001\Linkage","Export",0x00000000,"\Device\Ne20001" HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08 002BE10318}\0001\Linkage","RootDevice",0x00000000,"Ne20001" HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08 002BE10318}\0001\Linkage","UpperBind",0x00000000,"Tcpip" -HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-0 8002BE10318}\0001","Port",0x00000000,"280" -HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-0 8002BE10318}\0001","Irq",0x00000000,"9" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-0 8002BE10318}\0001","Port",0x00000000,"c100" +HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-0 8002BE10318}\0001","Irq",0x00000000,"B" HKLM,"SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08 002BE10318}\0001","NetworkAddress",0x00000000,"001122334455" HKLM,"SYSTEM\CurrentControlSet\Services\Ne20001\Parameters\Tcpip","Defau ltGateway",0x00010000,"0.0.0.0" HKLM,"SYSTEM\CurrentControlSet\Services\Ne20001\Parameters\Tcpip","IPAdd ress",0x00010000,"0.0.0.0" @@ -926,6 +929,12 @@ HKLM,"SYSTEM\CurrentControlSet\Services\VBE","Type",0x00010001,0x0000000 1 HKLM,"SYSTEM\CurrentControlSet\Services\VBE\Device0","InstalledDisplayDr ivers",0x00010000,"framebuf" +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","Default Settings.VRefresh",0x00010001,1 +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","Default Settings.BitsPerPel",0x00010001,8 +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","Default Settings.XResolution",0x00010001,640 +HKLM,"SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Services\VBE\Device0","Default Settings.YResolution",0x00010001,480 + + ; VGA miniport driver HKLM,"SYSTEM\CurrentControlSet\Services\Vga","ErrorControl",0x00010001,0 x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\Vga","Group",0x00000000,"Video Save" @@ -934,6 +943,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\Vga","Type",0x00010001,0x0000000 1 HKLM,"SYSTEM\CurrentControlSet\Services\Vga\Device0","InstalledDisplayDr ivers",0x00010000,"vgaddi" + ; VMware SVGA driver HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga","ErrorControl",0x00010 001,0x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\vmx_svga","Group",0x00000000,"Vi deo" _____ Modified: branches/xmlbuildsystem/reactos/bootdata/packages/reactos.dff --- branches/xmlbuildsystem/reactos/bootdata/packages/reactos.dff 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/bootdata/packages/reactos.dff 2005-05-27 19:29:24 UTC (rev 15547) @@ -16,7 +16,7 @@ 1 = system32 2 = system32\drivers 3 = media\fonts -4 = . +4 = 5 = system32\drivers\etc 6 = inf _____ Modified: branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/acpisys.c --- branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/acpisys.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/acpisys.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -162,7 +162,7 @@ IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) { - DbgPrint("Advanced Configuration and Power Interface Bus Driver\n"); + DPRINT("Advanced Configuration and Power Interface Bus Driver\n"); DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = (PDRIVER_DISPATCH) ACPIDispatchDeviceControl; DriverObject->MajorFunction[IRP_MJ_PNP] = (PDRIVER_DISPATCH) ACPIPnpControl; _____ Modified: branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/fdo.c --- branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/fdo.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/fdo.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -119,12 +119,16 @@ static BOOLEAN AcpiCreateResourceList(PCM_RESOURCE_LIST* pResourceList, PULONG ResourceListSize, + PIO_RESOURCE_REQUIREMENTS_LIST* pRequirementsList, + PULONG RequirementsListSize, RESOURCE* resources) { BOOLEAN Done; ULONG NumberOfResources = 0; PCM_RESOURCE_LIST ResourceList; + PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList; PCM_PARTIAL_RESOURCE_DESCRIPTOR ResourceDescriptor; + PIO_RESOURCE_DESCRIPTOR RequirementDescriptor; RESOURCE* resource; ULONG i; KIRQL Dirql; @@ -176,6 +180,24 @@ ResourceList->List[0].PartialResourceList.Count = NumberOfResources; ResourceDescriptor = ResourceList->List[0].PartialResourceList.PartialDescriptors; + *RequirementsListSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST) + sizeof(IO_RESOURCE_DESCRIPTOR) * (NumberOfResources - 1); + RequirementsList = (PIO_RESOURCE_REQUIREMENTS_LIST)ExAllocatePool(PagedPool, *RequirementsListSize); + *pRequirementsList = RequirementsList; + if (!RequirementsList) + { + ExFreePool(ResourceList); + return FALSE; + } + RequirementsList->ListSize = *RequirementsListSize; + RequirementsList->InterfaceType = ResourceList->List[0].InterfaceType; + RequirementsList->BusNumber = ResourceList->List[0].BusNumber; + RequirementsList->SlotNumber = 0; /* Not used by WDM drivers */ + RequirementsList->AlternativeLists = 1; + RequirementsList->List[0].Version = 1; + RequirementsList->List[0].Revision = 1; + RequirementsList->List[0].Count = NumberOfResources; + RequirementDescriptor = RequirementsList->List[0].Descriptors; + /* Fill resources list structure */ Done = FALSE; resource = resources; @@ -199,7 +221,16 @@ &Dirql, &ResourceDescriptor->u.Interrupt.Affinity); ResourceDescriptor->u.Interrupt.Level = (ULONG)Dirql; + + RequirementDescriptor->Option = 0; /* Required */ + RequirementDescriptor->Type = ResourceDescriptor->Type; + RequirementDescriptor->ShareDisposition = ResourceDescriptor->ShareDisposition; + RequirementDescriptor->Flags = ResourceDescriptor->Flags; + RequirementDescriptor->u.Interrupt.MinimumVector = RequirementDescriptor->u.Interrupt.MaximumVector + = irq_data->interrupts[i]; + ResourceDescriptor++; + RequirementDescriptor++; } break; } @@ -225,7 +256,16 @@ case TRANSFER_8_16: ResourceDescriptor->Flags |= CM_RESOURCE_DMA_8_AND_16; break; } ResourceDescriptor->u.Dma.Channel = dma_data->channels[i]; + + RequirementDescriptor->Option = 0; /* Required */ + RequirementDescriptor->Type = ResourceDescriptor->Type; + RequirementDescriptor->ShareDisposition = ResourceDescriptor->ShareDisposition; + RequirementDescriptor->Flags = ResourceDescriptor->Flags; + RequirementDescriptor->u.Dma.MinimumChannel = RequirementDescriptor->u.Dma.MaximumChannel + = ResourceDescriptor->u.Dma.Channel; + ResourceDescriptor++; + RequirementDescriptor++; } break; } @@ -242,7 +282,18 @@ ResourceDescriptor->u.Port.Start.u.HighPart = 0; ResourceDescriptor->u.Port.Start.u.LowPart = io_data->min_base_address; ResourceDescriptor->u.Port.Length = io_data->range_length; + + RequirementDescriptor->Option = 0; /* Required */ + RequirementDescriptor->Type = ResourceDescriptor->Type; + RequirementDescriptor->ShareDisposition = ResourceDescriptor->ShareDisposition; + RequirementDescriptor->Flags = ResourceDescriptor->Flags; + RequirementDescriptor->u.Port.Length = ResourceDescriptor->u.Port.Length; + RequirementDescriptor->u.Port.Alignment = 1; /* Start address is specified, so it doesn't matter */ + RequirementDescriptor->u.Port.MinimumAddress = RequirementDescriptor->u.Port.MaximumAddress + = ResourceDescriptor->u.Port.Start; + ResourceDescriptor++; + RequirementDescriptor++; break; } case end_tag: @@ -366,6 +417,8 @@ } if (!AcpiCreateResourceList(&PdoDeviceExtension->ResourceList, &PdoDeviceExtension->ResourceListSize, + &PdoDeviceExtension->ResourceRequirementsList, + &PdoDeviceExtension->ResourceRequirementsListSize, (RESOURCE*)Buffer.pointer)) { ASSERT(FALSE); @@ -573,7 +626,9 @@ } } +#ifndef NDEBUG ACPIPrintInfo(DeviceExtension); +#endif /* Initialize ACPI bus manager */ AcpiStatus = bm_initialize(); _____ Modified: branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/include/acpisys.h --- branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/include/acpisys.h 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/include/acpisys.h 2005-05-27 19:29:24 UTC (rev 15547) @@ -50,6 +50,9 @@ // Resource list PCM_RESOURCE_LIST ResourceList; ULONG ResourceListSize; + // Requirement list + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList; + ULONG ResourceRequirementsListSize; } PDO_DEVICE_EXTENSION, *PPDO_DEVICE_EXTENSION; _____ Modified: branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/osl.c --- branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/osl.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/osl.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -98,7 +98,7 @@ static char Buffer[512]; LONG Size = vsprintf(Buffer, fmt, args); - DbgPrint("%s", Buffer); + DPRINT("%s", Buffer); return Size; } _____ Modified: branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/pdo.c --- branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/pdo.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/drivers/bus/acpi/ospm/pdo.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -108,6 +108,35 @@ static NTSTATUS +PdoQueryResourceRequirements( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + PIO_STACK_LOCATION IrpSp) +{ + PPDO_DEVICE_EXTENSION DeviceExtension; + PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirementsList; + + DeviceExtension = (PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + + if (DeviceExtension->ResourceRequirementsListSize == 0) + { + return Irp->IoStatus.Status; + } + + ResourceRequirementsList = ExAllocatePool(PagedPool, DeviceExtension->ResourceRequirementsListSize); + if (!ResourceRequirementsList) + { + Irp->IoStatus.Information = 0; + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlCopyMemory(ResourceRequirementsList, DeviceExtension->ResourceRequirementsList, DeviceExtension->ResourceRequirementsListSize); + Irp->IoStatus.Information = (ULONG_PTR)ResourceRequirementsList; + return STATUS_SUCCESS; +} + + +static NTSTATUS PdoQueryResources( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, @@ -227,6 +256,9 @@ break; case IRP_MN_QUERY_RESOURCE_REQUIREMENTS: + Status = PdoQueryResourceRequirements(DeviceObject, + Irp, + IrpSp); break; case IRP_MN_QUERY_RESOURCES: _____ Modified: branches/xmlbuildsystem/reactos/drivers/bus/pci/pci.c --- branches/xmlbuildsystem/reactos/drivers/bus/pci/pci.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/drivers/bus/pci/pci.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -172,7 +172,7 @@ IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath) { - DbgPrint("Peripheral Component Interconnect Bus Driver\n"); + DPRINT("Peripheral Component Interconnect Bus Driver\n"); DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = PciDispatchDeviceControl; DriverObject->MajorFunction[IRP_MJ_PNP] = PciPnpControl; _____ Modified: branches/xmlbuildsystem/reactos/drivers/bus/pci/pdo.c --- branches/xmlbuildsystem/reactos/drivers/bus/pci/pdo.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/drivers/bus/pci/pdo.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -409,6 +409,8 @@ ResourceList->ListSize = ListSize; ResourceList->InterfaceType = PCIBus; + ResourceList->BusNumber = DeviceExtension->BusNumber, + ResourceList->SlotNumber = DeviceExtension->SlotNumber.u.AsULONG, ResourceList->AlternativeLists = 1; ResourceList->List[0].Version = 1; @@ -433,7 +435,7 @@ if (Length == 0) { DPRINT("Unused address register\n"); - break; + continue; } /* Set preferred descriptor */ @@ -497,6 +499,7 @@ if (PciConfig.u.type0.InterruptPin != 0) { + Descriptor->Option = 0; /* Required */ Descriptor->Type = CmResourceTypeInterrupt; Descriptor->ShareDisposition = CmResourceShareShared; Descriptor->Flags = CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE; @@ -522,7 +525,7 @@ if (Length == 0) { DPRINT("Unused address register\n"); - break; + continue; } /* Set preferred descriptor */ @@ -722,7 +725,7 @@ if (Length == 0) { DPRINT("Unused address register\n"); - break; + continue; } if (Flags & PCI_ADDRESS_IO_SPACE) @@ -776,7 +779,7 @@ if (Length == 0) { DPRINT("Unused address register\n"); - break; + continue; } if (Flags & PCI_ADDRESS_IO_SPACE) _____ Modified: branches/xmlbuildsystem/reactos/drivers/dd/serial/legacy.c --- branches/xmlbuildsystem/reactos/drivers/dd/serial/legacy.c 2005-05-27 18:26:14 UTC (rev 15546) +++ branches/xmlbuildsystem/reactos/drivers/dd/serial/legacy.c 2005-05-27 19:29:24 UTC (rev 15547) @@ -83,12 +83,13 @@ { ULONG ResourceListSize; PCM_RESOURCE_LIST ResourceList; + PCM_RESOURCE_LIST ResourceListTranslated; PCM_PARTIAL_RESOURCE_DESCRIPTOR ResourceDescriptor; + PCM_PARTIAL_RESOURCE_DESCRIPTOR ResourceDescriptorTranslated; BOOLEAN ConflictDetected; UART_TYPE UartType; PDEVICE_OBJECT Pdo = NULL; PDEVICE_OBJECT Fdo; - KIRQL Dirql; NTSTATUS Status; /* Create resource list */ @@ -96,29 +97,60 @@ ResourceList = (PCM_RESOURCE_LIST)ExAllocatePoolWithTag(PagedPool, ResourceListSize, SERIAL_TAG); if (!ResourceList) return STATUS_INSUFFICIENT_RESOURCES; - ResourceList->Count = 1; - ResourceList->List[0].InterfaceType = InterfaceTypeUndefined; - ResourceList->List[0].BusNumber = -1; /* unknown */ - ResourceList->List[0].PartialResourceList.Version = 1; - ResourceList->List[0].PartialResourceList.Revision = 1; - ResourceList->List[0].PartialResourceList.Count = 2; + ResourceListTranslated = (PCM_RESOURCE_LIST)ExAllocatePoolWithTag(PagedPool, ResourceListSize, SERIAL_TAG); + if (!ResourceListTranslated) + { + ExFreePoolWithTag(ResourceList, SERIAL_TAG); + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Resource header */ + ResourceList->Count = ResourceListTranslated->Count + = 1; + ResourceList->List[0].InterfaceType = ResourceListTranslated->List[0].InterfaceType + = InterfaceTypeUndefined; + ResourceList->List[0].BusNumber = ResourceListTranslated->List[0].BusNumber + = -1; /* unknown */ + ResourceList->List[0].PartialResourceList.Version = ResourceListTranslated->List[0].PartialResourceList.Version + = 1; + ResourceList->List[0].PartialResourceList.Revision = ResourceListTranslated->List[0].PartialResourceList.Revision + = 1; + ResourceList->List[0].PartialResourceList.Count = ResourceListTranslated->List[0].PartialResourceList.Count + = 2; + + /* I/O port */ ResourceDescriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[0]; - ResourceDescriptor->Type = CmResourceTypePort; - ResourceDescriptor->ShareDisposition = CmResourceShareDriverExclusive; - ResourceDescriptor->Flags = CM_RESOURCE_PORT_IO; - ResourceDescriptor->u.Port.Start.u.HighPart = 0; [truncated at 1000 lines; 72315 more skipped]
19 years, 7 months
1
0
0
0
[greatlrd] 15546: Thx casper to notice a ID was mistagen by translate
by greatlrd@svn.reactos.com
Thx casper to notice a ID was mistagen by translate Modified: trunk/reactos/lib/shdocvw/Sv.rc _____ Modified: trunk/reactos/lib/shdocvw/Sv.rc --- trunk/reactos/lib/shdocvw/Sv.rc 2005-05-27 16:28:10 UTC (rev 15545) +++ trunk/reactos/lib/shdocvw/Sv.rc 2005-05-27 18:26:14 UTC (rev 15546) @@ -25,7 +25,7 @@ { CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12 LTEXT "", 104, 10, 30, 200, 10, SS_CENTER - PUSHBUTTON "Avbryt", IDAvbryt, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP + PUSHBUTTON "Avbryt", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP } STRINGTABLE
19 years, 7 months
1
0
0
0
[hbirr] 15545: Dereference the event if the queue is freed in IntDereferenceMessageQueue.
by hbirr@svn.reactos.com
Dereference the event if the queue is freed in IntDereferenceMessageQueue. Modified: trunk/reactos/subsys/win32k/include/msgqueue.h _____ Modified: trunk/reactos/subsys/win32k/include/msgqueue.h --- trunk/reactos/subsys/win32k/include/msgqueue.h 2005-05-27 14:33:41 UTC (rev 15544) +++ trunk/reactos/subsys/win32k/include/msgqueue.h 2005-05-27 16:28:10 UTC (rev 15545) @@ -239,6 +239,8 @@ if(InterlockedDecrement(&(MsgQueue)->References) == 0) \ { \ DPRINT("Free message queue 0x%x\n", (MsgQueue)); \ + if ((MsgQueue)->NewMessages != NULL) \ + ObDereferenceObject((MsgQueue)->NewMessages); \ if ((MsgQueue)->NewMessagesHandle != NULL) \ ZwClose((MsgQueue)->NewMessagesHandle); \ ExFreePool((MsgQueue)); \
19 years, 7 months
1
0
0
0
[chorns] 15544: Copy rpoolmgr.h from trunk
by chorns@svn.reactos.com
Copy rpoolmgr.h from trunk Added: branches/xmlbuildsystem/reactos/ntoskrnl/mm/rpoolmgr.h _____ Copied: branches/xmlbuildsystem/reactos/ntoskrnl/mm/rpoolmgr.h (from rev 15541, trunk/reactos/ntoskrnl/mm/rpoolmgr.h)
19 years, 7 months
1
0
0
0
[chorns] 15543: Delete
by chorns@svn.reactos.com
Delete Deleted: branches/xmlbuildsystem/reactos/ntoskrnl/mm/RPoolMgr.h _____ Deleted: branches/xmlbuildsystem/reactos/ntoskrnl/mm/RPoolMgr.h --- branches/xmlbuildsystem/reactos/ntoskrnl/mm/RPoolMgr.h 2005-05-27 14:22:06 UTC (rev 15542) +++ branches/xmlbuildsystem/reactos/ntoskrnl/mm/RPoolMgr.h 2005-05-27 14:32:40 UTC (rev 15543) @@ -1,1047 +0,0 @@ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/RPoolMgr.h - * PURPOSE: A semi-generic reuseable Pool implementation - * PROGRAMMER: Royce Mitchell III - * UPDATE HISTORY: - */ - -#ifndef RPOOLMGR_H -#define RPOOLMGR_H - -typedef unsigned long rulong; - -#define R_IS_POOL_PTR(pool,ptr) (void*)(ptr) >= pool->UserBase && (ULONG_PTR)(ptr) < ((ULONG_PTR)pool->UserBase + pool->UserSize) -#define R_ASSERT_PTR(pool,ptr) ASSERT( R_IS_POOL_PTR(pool,ptr) ) -#define R_ASSERT_SIZE(pool,sz) ASSERT( sz > (sizeof(R_USED)+2*R_RZ) && sz >= sizeof(R_FREE) && sz < pool->UserSize ) - -#ifndef R_ROUND_UP -#define R_ROUND_UP(x,s) ((PVOID)(((ULONG_PTR)(x)+(s)-1) & ~((ULONG_PTR)(s)-1))) -#endif//R_ROUND_UP - -#ifndef R_ROUND_DOWN -#define R_ROUND_DOWN(x,s) ((PVOID)(((ULONG_PTR)(x)) & ~((ULONG_PTR)(s)-1))) -#endif//R_ROUND_DOWN - -#ifndef R_QUEMIN -// R_QUEMIN is the minimum number of entries to keep in a que -#define R_QUEMIN 0 -#endif//R_QUEMIN - -#ifndef R_QUECOUNT -// 16, 32, 64, 128, 256, 512 -#define R_QUECOUNT 6 -#endif//R_QUECOUNT - -#ifndef R_RZ -// R_RZ is the redzone size -#define R_RZ 4 -#endif//R_RZ - -#ifndef R_RZ_LOVALUE -#define R_RZ_LOVALUE 0x87 -#endif//R_RZ_LOVALUE - -#ifndef R_RZ_HIVALUE -#define R_RZ_HIVALUE 0xA5 -#endif//R_RZ_HIVALUE - -#ifndef R_STACK -// R_STACK is the number of stack entries to store in blocks for debug purposes -#define R_STACK 3 -#endif//R_STACK - -#ifndef R_TAG -// R_TAG do we keep track of tags on a per-memory block basis? -#define R_TAG 0 -#endif//R_TAG - -#ifdef R_MAGIC -# ifndef R_FREE_MAGIC -# define R_FREE_MAGIC (rulong)(('F'<<0) + ('r'<<8) + ('E'<<16) + ('e'<<24)) -# endif//R_FREE_MAGIC -# ifndef R_USED_MAGIC -# define R_USED_MAGIC (rulong)(('u'<<0) + ('S'<<8) + ('e'<<16) + ('D'<<24)) -# endif//R_USED_MAGIC -#endif//R_MAGIC - -// **IMPORTANT NOTE** Magic, PrevSize, Size and Status must be at same offset -// in both the R_FREE and R_USED structures - -typedef struct _R_FREE -{ -#ifdef R_MAGIC - rulong FreeMagic; -#endif//R_MAGIC - rulong PrevSize : 30; - rulong Status : 2; - rulong Size; -#if R_STACK - ULONG_PTR LastOwnerStack[R_STACK]; -#endif//R_STACK - struct _R_FREE* NextFree; - struct _R_FREE* PrevFree; -} -R_FREE, *PR_FREE; - -typedef struct _R_USED -{ -#ifdef R_MAGIC - rulong UsedMagic; -#endif//R_MAGIC - rulong PrevSize : 30; - rulong Status : 2; - rulong Size; -#if R_STACK - ULONG_PTR LastOwnerStack[R_STACK]; -#endif//R_STACK - struct _R_USED* NextUsed; -#if R_RZ - rulong UserSize; // how many bytes the user actually asked for... -#endif//R_RZ - rulong Tag; -} -R_USED, *PR_USED; - -typedef struct _R_QUE -{ - rulong Count; - PR_USED First, Last; -} -R_QUE, *PR_QUE; - -typedef struct _R_POOL -{ - void* PoolBase; - rulong PoolSize; - void* UserBase; - rulong UserSize; - rulong Alignments[3]; - PR_FREE FirstFree, LastFree; - R_QUE Que[R_QUECOUNT][3]; - R_MUTEX Mutex; -} -R_POOL, *PR_POOL; - -#if !R_STACK -#define RiPrintLastOwner(Block) -#else -static void -RiPrintLastOwner ( PR_USED Block ) -{ - int i; - for ( i = 0; i < R_STACK; i++ ) - { - if ( Block->LastOwnerStack[i] != 0xDEADBEEF ) - { - R_DEBUG(" "); - if (!R_PRINT_ADDRESS ((PVOID)Block->LastOwnerStack[i]) ) - { - R_DEBUG("<%X>", Block->LastOwnerStack[i] ); - } - } - } -} -#endif//R_STACK - -static int -RQueWhich ( rulong size ) -{ - rulong que, quesize; - for ( que=0, quesize=16; que < R_QUECOUNT; que++, quesize<<=1 ) - { - if ( quesize >= size ) - { - return que; - } - } - return -1; -} - -static void -RQueInit ( PR_QUE que ) -{ - que->Count = 0; - que->First = NULL; - que->Last = NULL; -} - -static void -RQueAdd ( PR_QUE que, PR_USED Item ) -{ - ASSERT(Item); - Item->Status = 2; - Item->NextUsed = NULL; - ++que->Count; - if ( !que->Last ) - { - que->First = que->Last = Item; - return; - } - ASSERT(!que->Last->NextUsed); - que->Last->NextUsed = Item; - que->Last = Item; -} - -static PR_USED -RQueRemove ( PR_QUE que ) -{ - PR_USED Item; -#if R_QUEMIN - if ( que->count < R_QUEMIN ) - return NULL; -#endif - if ( !que->First ) - return NULL; - Item = que->First; - que->First = Item->NextUsed; - if ( !--que->Count ) - { - ASSERT ( !que->First ); - que->Last = NULL; - } - Item->Status = 0; - return Item; -} - -static void -RPoolAddFree ( PR_POOL pool, PR_FREE Item ) -{ - ASSERT(pool); - ASSERT(Item); - if ( !pool->FirstFree ) - { - pool->FirstFree = pool->LastFree = Item; - Item->NextFree = NULL; - } - else - { - pool->FirstFree->PrevFree = Item; - Item->NextFree = pool->FirstFree; - pool->FirstFree = Item; - } - Item->PrevFree = NULL; -} - -static void -RPoolRemoveFree ( PR_POOL pool, PR_FREE Item ) -{ - ASSERT(pool); - ASSERT(Item); - if ( Item->NextFree ) - Item->NextFree->PrevFree = Item->PrevFree; - else - { - ASSERT ( pool->LastFree == Item ); - pool->LastFree = Item->PrevFree; - } - if ( Item->PrevFree ) - Item->PrevFree->NextFree = Item->NextFree; - else - { - ASSERT ( pool->FirstFree == Item ); - pool->FirstFree = Item->NextFree; - } -#ifdef DBG - Item->NextFree = Item->PrevFree = (PR_FREE)(ULONG_PTR)0xDEADBEEF; -#endif//DBG -} - -static void -RFreeFillStack ( PR_FREE free ) -{ - int i; - ULONG stack[R_EXTRA_STACK_UP+3]; // need to skip 3 known levels of stack trace - memset ( stack, 0xCD, sizeof(stack) ); - R_GET_STACK_FRAMES ( stack, R_EXTRA_STACK_UP+3 ); - for ( i = 0; i < R_EXTRA_STACK_UP; i++ ) - free->LastOwnerStack[i] = stack[i+3]; -} - -static void -RUsedFillStack ( PR_USED used ) -{ - int i; - ULONG stack[R_EXTRA_STACK_UP+2]; // need to skip 2 known levels of stack trace - memset ( stack, 0xCD, sizeof(stack) ); - R_GET_STACK_FRAMES ( stack, R_EXTRA_STACK_UP+2 ); - for ( i = 0; i < R_EXTRA_STACK_UP; i++ ) - used->LastOwnerStack[i] = stack[i+2]; -} - -static PR_FREE -RFreeInit ( void* memory ) -{ - PR_FREE block = (PR_FREE)memory; -#if R_FREEMAGIC - block->FreeMagic = R_FREE_MAGIC; -#endif//R_FREEMAGIC - block->Status = 0; - RFreeFillStack ( block ); -#ifdef DBG - block->PrevFree = block->NextFree = (PR_FREE)(ULONG_PTR)0xDEADBEEF; -#endif//DBG - return block; -} - -PR_POOL -RPoolInit ( void* PoolBase, rulong PoolSize, int align1, int align2, int align3 ) -{ - int align, que; - PR_POOL pool = (PR_POOL)PoolBase; - - pool->PoolBase = PoolBase; - pool->PoolSize = PoolSize; - pool->UserBase = (char*)pool->PoolBase + sizeof(R_POOL); - pool->UserSize = PoolSize - sizeof(R_POOL); - pool->Alignments[0] = align1; - pool->Alignments[1] = align2; - pool->Alignments[2] = align3; - pool->FirstFree = pool->LastFree = NULL; - - RPoolAddFree ( pool, - RFreeInit ( pool->UserBase )); - - pool->FirstFree->PrevSize = 0; - pool->FirstFree->Size = pool->UserSize; - - for ( que = 0; que < R_QUECOUNT; que++ ) - { - for ( align = 0; align < 3; align++ ) - { - RQueInit ( &pool->Que[que][align] ); - } - } - return pool; -} - -static const char* -RFormatTag ( rulong Tag, char* buf ) -{ - int i; - *(rulong*)&buf[0] = Tag; - buf[4] = 0; - for ( i = 0; i < 4; i++ ) - { - if ( !buf[i] ) - buf[i] = ' '; - } - return buf; -} - -#if !R_RZ -#define RUsedRedZoneCheck(pUsed,Addr,file,line) -#else//R_RZ -static void -RiBadBlock ( PR_USED pUsed, char* Addr, const char* violation, const char* file, int line, int printzone ) -{ - char tag[5]; - int i; - - R_DEBUG("%s(%i): %s detected for paged pool address 0x%x\n", - file, line, violation, Addr ); - -#ifdef R_MAGIC - R_DEBUG ( "UsedMagic 0x%x, ", pUsed->UsedMagic ); -#endif//R_MAGIC - R_DEBUG ( "Tag %s(%X), Size %i, UserSize %i", - RFormatTag(pUsed->Tag,tag), - pUsed->Tag, - pUsed->Size, - pUsed->UserSize ); - - if ( printzone ) - { - unsigned char* HiZone = (unsigned char*)Addr + pUsed->UserSize; - unsigned char* LoZone = (unsigned char*)Addr - R_RZ; // this is to simplify indexing below... - R_DEBUG ( ", LoZone " ); - for ( i = 0; i < R_RZ; i++ ) - R_DEBUG ( "%02x", LoZone[i] ); - R_DEBUG ( ", HiZone " ); - for ( i = 0; i < R_RZ; i++ ) - R_DEBUG ( "%02x", HiZone[i] ); - } - R_DEBUG ( "\n" ); - - R_DEBUG ( "First few Stack Frames:" ); - RiPrintLastOwner ( pUsed ); - R_DEBUG ( "\n" ); - - R_DEBUG ( "Contents of Block:\n" ); - for ( i = 0; i < 8*16 && i < pUsed->UserSize; i += 16 ) - { - int j; - R_DEBUG ( "%04X ", i ); - for ( j = 0; j < 16; j++ ) - { - if ( i+j < pUsed->UserSize ) - { - R_DEBUG ( "%02X ", (unsigned)(unsigned char)Addr[i+j] ); - } - else - { - R_DEBUG ( " " ); - } - } - R_DEBUG(" "); - for ( j = 0; j < 16; j++ ) - { - if ( i+j < pUsed->UserSize ) - { - char c = Addr[i+j]; - if ( c < 0x20 || c > 0x7E ) - c = '.'; - R_DEBUG ( "%c", c ); - } - else - { - R_DEBUG ( " " ); - } - } - R_DEBUG("\n"); - } - R_PANIC(); -} -static void -RUsedRedZoneCheck ( PR_POOL pool, PR_USED pUsed, char* Addr, const char* file, int line ) -{ - int i; - unsigned char *LoZone, *HiZone; - int bLow = 1; - int bHigh = 1; - - ASSERT ( Addr >= (char*)pool->UserBase && Addr < ((char*)pool->UserBase + pool->UserSize - 16) ); -#ifdef R_MAGIC - if ( pUsed->UsedMagic == MM_PPOOL_FREEMAGIC ) - { - pUsed->UserSize = 0; // just to keep from confusion, MmpBadBlock() doesn't return... - RiBadBlock ( pUsed, Addr, "double-free", file, line, 0 ); - } - if ( pUsed->UsedMagic != MM_PPOOL_USEDMAGIC ) - { - RiBadBlock ( pUsed, Addr, "bad magic", file, line, 0 ); - } -#endif//R_MAGIC - switch ( pUsed->Status ) - { - case 0: // freed into main pool - case 2: // in ques - RiBadBlock ( pUsed, Addr, "double-free", file, line, 0 ); - // no need for break here - RiBadBlock doesn't return - case 1: // allocated - this is okay - break; - default: - RiBadBlock ( pUsed, Addr, "corrupt status", file, line, 0 ); - } - if ( pUsed->Status != 1 ) - { - RiBadBlock ( pUsed, Addr, "double-free", file, line, 0 ); - } - if ( pUsed->Size > pool->PoolSize || pUsed->Size == 0 ) - { - RiBadBlock ( pUsed, Addr, "invalid size", file, line, 0 ); - } - if ( pUsed->UserSize > pool->PoolSize || pUsed->UserSize == 0 ) - { - RiBadBlock ( pUsed, Addr, "invalid user size", file, line, 0 ); - } - HiZone = (unsigned char*)Addr + pUsed->UserSize; - LoZone = (unsigned char*)Addr - R_RZ; // this is to simplify indexing below... - for ( i = 0; i < R_RZ && bLow && bHigh; i++ ) - { - bLow = bLow && ( LoZone[i] == R_RZ_LOVALUE ); - bHigh = bHigh && ( HiZone[i] == R_RZ_HIVALUE ); - } - if ( !bLow || !bHigh ) - { - const char* violation = "High and Low-side redzone overwrite"; - if ( bHigh ) // high is okay, so it was just low failed - violation = "Low-side redzone overwrite"; - else if ( bLow ) // low side is okay, so it was just high failed - violation = "High-side redzone overwrite"; - RiBadBlock ( pUsed, Addr, violation, file, line, 1 ); - } -} -#endif//R_RZ - -PR_FREE -RPreviousBlock ( PR_FREE Block ) -{ - if ( Block->PrevSize > 0 ) - return (PR_FREE)( (char*)Block - Block->PrevSize ); - return NULL; -} - -PR_FREE -RNextBlock ( PR_POOL pool, PR_FREE Block ) -{ - PR_FREE NextBlock = (PR_FREE)( (char*)Block + Block->Size ); - if ( (char*)NextBlock >= (char*)pool->UserBase + pool->UserSize ) - NextBlock = NULL; - return NextBlock; -} - -inline static void* -RHdrToBody ( void* blk ) -/* - * FUNCTION: Translate a block header address to the corresponding block - * address (internal) - */ -{ - return ( (void *) ((char*)blk + sizeof(R_USED) + R_RZ) ); -} - -inline static PR_USED -RBodyToHdr ( void* addr ) -{ - return (PR_USED) - ( ((char*)addr) - sizeof(R_USED) - R_RZ ); -} - -static int -RiInFreeChain ( PR_POOL pool, PR_FREE Block ) -{ - PR_FREE Free; - Free = pool->FirstFree; - if ( Free == Block ) - return 1; - while ( Free != Block ) - { - Free = Free->NextFree; - if ( !Free ) - return 0; - } - return 1; -} - -static void -RPoolRedZoneCheck ( PR_POOL pool, const char* file, int line ) -{ - { - PR_USED Block = (PR_USED)pool->UserBase; - PR_USED NextBlock; - - for ( ;; ) - { - switch ( Block->Status ) - { - case 0: // block is in chain - ASSERT ( RiInFreeChain ( pool, (PR_FREE)Block ) ); - break; - case 1: // block is allocated - RUsedRedZoneCheck ( pool, Block, RHdrToBody(Block), file, line ); - break; - case 2: // block is in que - // nothing to verify here yet - break; - default: - ASSERT ( !"invalid status in memory block found in pool!" ); - } - NextBlock = (PR_USED)RNextBlock(pool,(PR_FREE)Block); - if ( !NextBlock ) - break; - ASSERT ( NextBlock->PrevSize == Block->Size ); - Block = NextBlock; - } - } - { - // now let's step through the list of free pointers and verify - // each one can be found by size-jumping... - PR_FREE Free = (PR_FREE)pool->FirstFree; - while ( Free ) - { - PR_FREE NextFree = (PR_FREE)pool->UserBase; - if ( Free != NextFree ) - { - while ( NextFree != Free ) - { - NextFree = RNextBlock ( pool, NextFree ); - ASSERT(NextFree); - } - } - Free = Free->NextFree; - } - } -} - -static void -RSetSize ( PR_POOL pool, PR_FREE Block, rulong NewSize, PR_FREE NextBlock ) -{ - R_ASSERT_PTR(pool,Block); - ASSERT ( NewSize < pool->UserSize ); - ASSERT ( NewSize >= sizeof(R_FREE) ); - Block->Size = NewSize; - if ( !NextBlock ) - NextBlock = RNextBlock ( pool, Block ); - if ( NextBlock ) - NextBlock->PrevSize = NewSize; -} - -static PR_FREE -RFreeSplit ( PR_POOL pool, PR_FREE Block, rulong NewSize ) -{ - PR_FREE NewBlock = (PR_FREE)((char*)Block + NewSize); - RSetSize ( pool, NewBlock, Block->Size - NewSize, NULL ); - RSetSize ( pool, Block, NewSize, NewBlock ); - RFreeInit ( NewBlock ); - RPoolAddFree ( pool, NewBlock ); - return NewBlock; -} - -static void -RFreeMerge ( PR_POOL pool, PR_FREE First, PR_FREE Second ) -{ - ASSERT ( RPreviousBlock(Second) == First ); - ASSERT ( First->Size == Second->PrevSize ); - RPoolRemoveFree ( pool, Second ); - RSetSize ( pool, First, First->Size + Second->Size, NULL ); -} - -static void -RPoolReclaim ( PR_POOL pool, PR_FREE FreeBlock ) -{ - PR_FREE NextBlock, PreviousBlock; - - RFreeInit ( FreeBlock ); - RPoolAddFree ( pool, FreeBlock ); - - // TODO FIXME - don't merge and always insert freed blocks at the end for debugging purposes... - - /* - * If the next block is immediately adjacent to the newly freed one then - * merge them. - * PLEASE DO NOT WIPE OUT 'MAGIC' OR 'LASTOWNER' DATA FOR MERGED FREE BLOCKS - */ - NextBlock = RNextBlock ( pool, FreeBlock ); - if ( NextBlock != NULL && !NextBlock->Status ) - { - RFreeMerge ( pool, FreeBlock, NextBlock ); - } - - /* - * If the previous block is adjacent to the newly freed one then - * merge them. - * PLEASE DO NOT WIPE OUT 'MAGIC' OR 'LASTOWNER' DATA FOR MERGED FREE BLOCKS - */ - PreviousBlock = RPreviousBlock ( FreeBlock ); - if ( PreviousBlock != NULL && !PreviousBlock->Status ) - { - RFreeMerge ( pool, PreviousBlock, FreeBlock ); - } -} - -static void -RiUsedInit ( PR_USED Block, rulong Tag ) -{ - Block->Status = 1; - RUsedFillStack ( Block ); -#if R_MAGIC - Block->UsedMagic = R_USED_MAGIC; -#endif//R_MAGIC - //ASSERT_SIZE ( Block->Size ); - - // now add the block to the used block list -#ifdef DBG - Block->NextUsed = (PR_USED)(ULONG_PTR)0xDEADBEEF; -#endif//R_USED_LIST - - Block->Tag = Tag; -} - -#if !R_RZ -#define RiUsedInitRedZone(Block,UserSize) -#else//R_RZ -static void -RiUsedInitRedZone ( PR_USED Block, rulong UserSize ) -{ - // write out buffer-overrun detection bytes - char* Addr = (char*)RHdrToBody(Block); - Block->UserSize = UserSize; - memset ( Addr - R_RZ, R_RZ_LOVALUE, R_RZ ); - memset ( Addr + Block->UserSize, R_RZ_HIVALUE, R_RZ ); -#ifdef DBG - memset ( Addr, 0xCD, UserSize ); -#endif//DBG -} -#endif//R_RZ - -static void* -RPoolAlloc ( PR_POOL pool, rulong NumberOfBytes, rulong Tag, rulong align ) -{ - PR_USED NewBlock; - PR_FREE BestBlock, - NextBlock, - PreviousBlock, - BestPreviousBlock, - CurrentBlock; - void* BestAlignedAddr; - int que, - queBytes = NumberOfBytes; - rulong BlockSize, - Alignment; - int que_reclaimed = 0; - - ASSERT ( pool ); - ASSERT ( align < 3 ); - - R_ACQUIRE_MUTEX(pool); - - if ( !NumberOfBytes ) - { - R_DEBUG("0 bytes requested - initiating pool verification\n"); - RPoolRedZoneCheck ( pool, __FILE__, __LINE__ ); - R_RELEASE_MUTEX(pool); - return NULL; - } - if ( NumberOfBytes > pool->PoolSize ) - { - if ( R_IS_POOL_PTR(pool,NumberOfBytes) ) - { - R_DEBUG("red zone verification requested for block 0x%X\n", NumberOfBytes ); - RUsedRedZoneCheck(pool,RBodyToHdr((void*)NumberOfBytes), (char*)NumberOfBytes, __FILE__, __LINE__ ); - R_RELEASE_MUTEX(pool); - return NULL; - } - R_DEBUG("Invalid allocation request: %i bytes\n", NumberOfBytes ); - R_RELEASE_MUTEX(pool); - return NULL; - } - - que = RQueWhich ( NumberOfBytes ); - if ( que >= 0 ) - { - if ( (NewBlock = RQueRemove ( &pool->Que[que][align] )) ) - { - R_RELEASE_MUTEX(pool); - RiUsedInit ( NewBlock, Tag ); - RiUsedInitRedZone ( NewBlock, NumberOfBytes ); - return RHdrToBody(NewBlock); - } - queBytes = 16 << que; - } - - /* - * Calculate the total number of bytes we will need. - */ - BlockSize = queBytes + sizeof(R_USED) + 2*R_RZ; - if (BlockSize < sizeof(R_FREE)) - { - /* At least we need the size of the free block header. */ - BlockSize = sizeof(R_FREE); - } - -try_again: - /* - * Find the best-fitting block. - */ - BestBlock = NULL; - Alignment = pool->Alignments[align]; - PreviousBlock = NULL; - BestPreviousBlock = NULL, - CurrentBlock = pool->FirstFree; - BestAlignedAddr = NULL; - - while ( CurrentBlock != NULL ) - { - PVOID Addr = RHdrToBody(CurrentBlock); - PVOID CurrentBlockEnd = (char*)CurrentBlock + CurrentBlock->Size; - /* calculate last size-aligned address available within this block */ - PVOID AlignedAddr = R_ROUND_DOWN((char*)CurrentBlockEnd-queBytes-R_RZ, Alignment); - ASSERT ( (char*)AlignedAddr+queBytes+R_RZ <= (char*)CurrentBlockEnd ); - - /* special case, this address is already size-aligned, and the right size */ - if ( Addr == AlignedAddr ) - { - BestAlignedAddr = AlignedAddr; - BestPreviousBlock = PreviousBlock; - BestBlock = CurrentBlock; - break; - } - // if we carve out a size-aligned block... is it still past the end of this - // block's free header? - else if ( (char*)RBodyToHdr(AlignedAddr) - >= (char*)CurrentBlock+sizeof(R_FREE) ) - { - /* - * there's enough room to allocate our size-aligned memory out - * of this block, see if it's a better choice than any previous - * finds - */ - if ( BestBlock == NULL - || BestBlock->Size > CurrentBlock->Size ) - { - BestAlignedAddr = AlignedAddr; - BestPreviousBlock = PreviousBlock; - BestBlock = CurrentBlock; - } - } - - PreviousBlock = CurrentBlock; - CurrentBlock = CurrentBlock->NextFree; - } - - /* - * We didn't find anything suitable at all. - */ - if (BestBlock == NULL) - { - if ( !que_reclaimed ) - { - // reclaim que - int i, j; - for ( i = 0; i < R_QUECOUNT; i++ ) - { - for ( j = 0; j < 3; j++ ) - { - while ( (BestBlock = (PR_FREE)RQueRemove ( &pool->Que[i][j] )) ) - { - RPoolReclaim ( pool, BestBlock ); - } - } - } - - que_reclaimed = 1; - goto try_again; - } - DPRINT1("Trying to allocate %lu bytes from paged pool - nothing suitable found, returning NULL\n", - queBytes ); - R_RELEASE_MUTEX(pool); - return NULL; - } - /* - * we found a best block. If Addr isn't already aligned, we've pre-qualified that - * there's room at the beginning of the block for a free block... - */ - { - void* Addr = RHdrToBody(BestBlock); - if ( BestAlignedAddr != Addr ) - { - PR_FREE NewFreeBlock = RFreeSplit ( - pool, - BestBlock, - (char*)RBodyToHdr(BestAlignedAddr) - (char*)BestBlock ); - ASSERT ( BestAlignedAddr > Addr ); - - //DPRINT ( "breaking off preceding bytes into their own block...\n" ); - /*DPRINT ( "NewFreeBlock 0x%x Size %lu (Old Block's new size %lu) NextFree 0x%x\n", - NewFreeBlock, NewFreeBlock->Size, BestBlock->Size, BestBlock->NextFree );*/ - - /* we want the following code to use our size-aligned block */ - BestPreviousBlock = BestBlock; - BestBlock = NewFreeBlock; - - //VerifyPagedPool(); - } - } - /* - * Is there enough space to create a second block from the unused portion. - */ - if ( (BestBlock->Size - BlockSize) > sizeof(R_FREE) ) - { - /*DPRINT("BestBlock 0x%x Size 0x%x BlockSize 0x%x NewSize 0x%x\n", - BestBlock, BestBlock->Size, BlockSize, NewSize );*/ - - /* - * Create the new free block. - */ - NextBlock = RFreeSplit ( pool, BestBlock, BlockSize ); - //ASSERT_SIZE ( NextBlock->Size ); - } - /* - * Remove the selected block from the list of free blocks. - */ - //DPRINT ( "Removing selected block from free block list\n" ); - RPoolRemoveFree ( pool, BestBlock ); - /* - * Create the new used block header. - */ - NewBlock = (PR_USED)BestBlock; - RiUsedInit ( NewBlock, Tag ); - - R_RELEASE_MUTEX(pool); - - /* RtlZeroMemory(RHdrToBody(NewBlock), NumberOfBytes);*/ - - RiUsedInitRedZone ( NewBlock, NumberOfBytes ); - - return RHdrToBody(NewBlock); -} - -static void -RPoolFree ( PR_POOL pool, void* Addr ) -{ - PR_USED UsedBlock; - rulong UsedSize; - PR_FREE FreeBlock; - rulong UserSize; - int que; - - ASSERT(pool); - if ( !Addr ) - { - R_DEBUG("Attempt to free NULL ptr, initiating Red Zone Check\n" ); - R_ACQUIRE_MUTEX(pool); - RPoolRedZoneCheck ( pool, __FILE__, __LINE__ ); - R_RELEASE_MUTEX(pool); - return; - } - R_ASSERT_PTR(pool,Addr); - - UsedBlock = RBodyToHdr(Addr); - UsedSize = UsedBlock->Size; - FreeBlock = (PR_FREE)UsedBlock; -#if R_RZ - UserSize = UsedBlock->UserSize; -#else - UserSize = UsedSize - sizeof(R_USED) - 2*R_RZ; -#endif//R_RZ - - RUsedRedZoneCheck ( pool, UsedBlock, Addr, __FILE__, __LINE__ ); - -#if R_RZ - memset ( Addr, 0xCD, UsedBlock->UserSize ); -#endif - - que = RQueWhich ( UserSize ); - if ( que >= 0 ) - { - int queBytes = 16 << que; - ASSERT( queBytes >= UserSize ); - if ( que >= 0 ) - { - int align = 0; - if ( R_ROUND_UP(Addr,pool->Alignments[2]) == Addr ) - align = 2; - else if ( R_ROUND_UP(Addr,pool->Alignments[1]) == Addr ) - align = 1; - R_ACQUIRE_MUTEX(pool); - RQueAdd ( &pool->Que[que][align], UsedBlock ); - R_RELEASE_MUTEX(pool); - return; - } - } - - R_ACQUIRE_MUTEX(pool); - RPoolReclaim ( pool, FreeBlock ); - R_RELEASE_MUTEX(pool); -} - -static void -RPoolDumpByTag ( PR_POOL pool, rulong Tag ) -{ - PR_USED Block = (PR_USED)pool->UserBase; - PR_USED NextBlock; - int count = 0; - char tag[5]; - - // TODO FIXME - should we validate params or ASSERT_IRQL? - R_DEBUG ( "PagedPool Dump by tag '%s'\n", RFormatTag(Tag,tag) ); - R_DEBUG ( " -BLOCK-- --SIZE--\n" ); - - R_ACQUIRE_MUTEX(pool); - for ( ;; ) - { - if ( Block->Status == 1 && Block->Tag == Tag ) - { - R_DEBUG ( " %08X %08X\n", Block, Block->Size ); - ++count; - } - NextBlock = (PR_USED)RNextBlock(pool,(PR_FREE)Block); - if ( !NextBlock ) - break; - ASSERT ( NextBlock->PrevSize == Block->Size ); - Block = NextBlock; - } - R_RELEASE_MUTEX(pool); - - R_DEBUG ( "Entries found for tag '%s': %i\n", tag, count ); -} - -rulong -RPoolQueryTag ( void* Addr ) -{ - PR_USED Block = RBodyToHdr(Addr); - // TODO FIXME - should we validate params? -#if R_MAGIC - if ( Block->UsedMagic != R_USED_MAGIC ) - return 0xDEADBEEF; -#endif//R_MAGIC - if ( Block->Status != 1 ) - return 0xDEADBEEF; - return Block->Tag; -} - -void -RPoolStats ( PR_POOL pool ) -{ - int free=0, used=0, qued=0; - PR_USED Block = (PR_USED)pool->UserBase; - - R_ACQUIRE_MUTEX(pool); - while ( Block ) - { - switch ( Block->Status ) - { - case 0: - ++free; - break; - case 1: - ++used; - break; - case 2: - ++qued; - break; [truncated at 1000 lines; 52 more skipped]
19 years, 7 months
1
0
0
0
[greatlrd] 15542: fix memmory coruption in EnumDisplaySettingsExA
by greatlrd@svn.reactos.com
fix memmory coruption in EnumDisplaySettingsExA do not alloc memmory with heap. Modified: trunk/reactos/lib/user32/misc/display.c _____ Modified: trunk/reactos/lib/user32/misc/display.c --- trunk/reactos/lib/user32/misc/display.c 2005-05-27 00:32:24 UTC (rev 15541) +++ trunk/reactos/lib/user32/misc/display.c 2005-05-27 14:22:06 UTC (rev 15542) @@ -200,33 +200,25 @@ { BOOL rc; UNICODE_STRING DeviceName; - LPDEVMODEW lpDevModeW; + DEVMODEW lpDevModeW; - lpDevModeW = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(DEVMODEW) + lpDevMode->dmDriverExtra); - if ( lpDevModeW == NULL ) - { - SetLastError ( ERROR_OUTOFMEMORY ); - return FALSE; - } - if ( !RtlCreateUnicodeStringFromAsciiz ( &DeviceName, (PCSZ)lpszDeviceName ) ) { SetLastError ( ERROR_OUTOFMEMORY ); return FALSE; } - lpDevModeW->dmSize = sizeof(DEVMODEW); - lpDevModeW->dmDriverExtra = 0; - - rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, lpDevModeW, + memset(&lpDevModeW,0,sizeof(DEVMODEW)); + lpDevModeW.dmSize = sizeof(DEVMODEW); + + rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, &lpDevModeW, dwFlags ); - RosRtlDevModeW2A ( lpDevMode, lpDevModeW ); + RosRtlDevModeW2A ( lpDevMode, &lpDevModeW ); RtlFreeUnicodeString ( &DeviceName ); - HeapFree ( GetProcessHeap(), 0, lpDevModeW ); + return rc; }
19 years, 7 months
1
0
0
0
[greatlrd] 15541: fix stupied Ret uninitialized in IntChangeDisplaySettings for DGB=0 build
by greatlrd@svn.reactos.com
fix stupied Ret uninitialized in IntChangeDisplaySettings for DGB=0 build Modified: trunk/reactos/subsys/win32k/objects/dc.c _____ Modified: trunk/reactos/subsys/win32k/objects/dc.c --- trunk/reactos/subsys/win32k/objects/dc.c 2005-05-26 23:20:25 UTC (rev 15540) +++ trunk/reactos/subsys/win32k/objects/dc.c 2005-05-27 00:32:24 UTC (rev 15541) @@ -2506,8 +2506,8 @@ BOOLEAN NoReset = FALSE; BOOLEAN Reset = FALSE; BOOLEAN SetPrimary = FALSE; - LONG Ret; - NTSTATUS Status; + LONG Ret=0; + NTSTATUS Status ; DPRINT1("display flag : %x\n",dwflags);
19 years, 7 months
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
82
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Results per page:
10
25
50
100
200