ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
September 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
22 participants
582 discussions
Start a n
N
ew thread
[gvg] 17701: Shut up some debug messages
by gvg@svn.reactos.com
Shut up some debug messages Modified: trunk/reactos/ntoskrnl/ob/wait.c Modified: trunk/reactos/services/umpnpmgr/umpnpmgr.c _____ Modified: trunk/reactos/ntoskrnl/ob/wait.c --- trunk/reactos/ntoskrnl/ob/wait.c 2005-09-06 17:33:56 UTC (rev 17700) +++ trunk/reactos/ntoskrnl/ob/wait.c 2005-09-06 18:07:46 UTC (rev 17701) @@ -243,7 +243,7 @@ if (LockInUse) KeLeaveCriticalRegion(); /* Return status */ - DPRINT1("Returning: %x\n", Status); + DPRINT("Returning: %x\n", Status); return Status; } _____ Modified: trunk/reactos/services/umpnpmgr/umpnpmgr.c --- trunk/reactos/services/umpnpmgr/umpnpmgr.c 2005-09-06 17:33:56 UTC (rev 17700) +++ trunk/reactos/services/umpnpmgr/umpnpmgr.c 2005-09-06 18:07:46 UTC (rev 17701) @@ -776,7 +776,7 @@ DPRINT("Received PnP Event\n"); if (UuidEqual(&PnpEvent->EventGuid, (UUID*)&GUID_DEVICE_ARRIVAL, &RpcStatus)) { - DPRINT1("Device arrival event: %S\n", PnpEvent->TargetDevice.DeviceIds); + DPRINT("Device arrival event: %S\n", PnpEvent->TargetDevice.DeviceIds); } else {
19 years, 3 months
1
0
0
0
[ion] 17700: - Use DDK macros to speed up size calculations on single-byte codepages.
by ion@svn.reactos.com
- Use DDK macros to speed up size calculations on single-byte codepages. Modified: trunk/reactos/include/ndk/rtlfuncs.h Modified: trunk/reactos/lib/rtl/unicode.c Modified: trunk/reactos/w32api/include/ddk/winddk.h _____ Modified: trunk/reactos/include/ndk/rtlfuncs.h --- trunk/reactos/include/ndk/rtlfuncs.h 2005-09-06 15:57:42 UTC (rev 17699) +++ trunk/reactos/include/ndk/rtlfuncs.h 2005-09-06 17:33:56 UTC (rev 17700) @@ -764,13 +764,19 @@ /* * Unicode->Ansi String Functions */ -/* FIXME: Use macro */ -#undef RtlUnicodeStringToAnsiSize NTSYSAPI ULONG NTAPI -RtlUnicodeStringToAnsiSize(IN PUNICODE_STRING UnicodeString); +RtlxUnicodeStringToAnsiSize(IN PCUNICODE_STRING UnicodeString); +#ifdef NTOS_MODE_USER +#define RtlUnicodeStringToAnsiSize(STRING) ( \ + NLS_MB_CODE_PAGE_TAG ? \ + RtlxUnicodeStringToAnsiSize(STRING) : \ + ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \ +) +#endif + NTSYSAPI NTSTATUS NTAPI @@ -821,13 +827,22 @@ ULONG UnicodeSize ); -/* FIXME: Use macro */ -#undef RtlUnicodeStringToOemSize NTSYSAPI ULONG NTAPI -RtlUnicodeStringToOemSize(IN PUNICODE_STRING UnicodeString); +RtlxUnicodeStringToOemSize(IN PCUNICODE_STRING UnicodeString); +#ifdef NTOS_MODE_USER +#define RtlUnicodeStringToOemSize(STRING) ( \ + NLS_MB_OEM_CODE_PAGE_TAG ? \ + RtlxUnicodeStringToOemSize(STRING) : \ + ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \ +) +#define RtlUnicodeStringToCountedOemSize(STRING) ( \ + (ULONG)(RtlUnicodeStringToOemSize(STRING) - sizeof(UNICODE_NULL)) \ +) +#endif + NTSYSAPI NTSTATUS NTAPI @@ -873,16 +888,25 @@ ULONG UnicodeSize ); -/* - * OEM to Unicode Functions - */ -/* FIXME: Use macro */ -#undef RtlOemStringToUnicodeSize NTSYSAPI ULONG NTAPI -RtlOemStringToUnicodeSize(POEM_STRING AnsiString); +RtlxOemStringToUnicodeSize(IN PCOEM_STRING OemString); +/* + * OEM to Unicode Functions + */ +#ifdef NTOS_MODE_USER +#define RtlOemStringToUnicodeSize(STRING) ( \ + NLS_MB_OEM_CODE_PAGE_TAG ? \ + RtlxOemStringToUnicodeSize(STRING) : \ + ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \ +) +#define RtlOemStringToCountedUnicodeSize(STRING) ( \ + (ULONG)(RtlOemStringToUnicodeSize(STRING) - sizeof(UNICODE_NULL)) \ +) +#endif + NTSYSAPI NTSTATUS NTAPI @@ -915,14 +939,13 @@ BOOLEAN AllocateDestinationString ); -/* FIXME: Use macro */ -#undef RtlAnsiStringToUnicodeSize -NTSYSAPI -ULONG -NTAPI -RtlAnsiStringToUnicodeSize( - PANSI_STRING AnsiString -); +#ifdef NTOS_MODE_USER +#define RtlAnsiStringToUnicodeSize(STRING) ( \ + NLS_MB_CODE_PAGE_TAG ? \ + RtlxAnsiStringToUnicodeSize(STRING) : \ + ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \ +) +#endif NTSYSAPI BOOLEAN _____ Modified: trunk/reactos/lib/rtl/unicode.c --- trunk/reactos/lib/rtl/unicode.c 2005-09-06 15:57:42 UTC (rev 17699) +++ trunk/reactos/lib/rtl/unicode.c 2005-09-06 17:33:56 UTC (rev 17700) @@ -66,7 +66,7 @@ */ ULONG STDCALL -RtlxAnsiStringToUnicodeSize(IN PANSI_STRING AnsiString) +RtlxAnsiStringToUnicodeSize(IN PCANSI_STRING AnsiString) { ULONG Size; @@ -884,7 +884,7 @@ ULONG STDCALL RtlxUnicodeStringToOemSize( - IN PUNICODE_STRING UnicodeString) + IN PCUNICODE_STRING UnicodeString) { ULONG Size; @@ -1830,7 +1830,7 @@ */ ULONG STDCALL -RtlxOemStringToUnicodeSize(IN POEM_STRING OemString) +RtlxOemStringToUnicodeSize(IN PCOEM_STRING OemString) { ULONG Size; @@ -1894,7 +1894,7 @@ ULONG STDCALL RtlxUnicodeStringToAnsiSize( - IN PUNICODE_STRING UnicodeString) + IN PCUNICODE_STRING UnicodeString) { ULONG Size; @@ -2256,49 +2256,8 @@ DestinationString->Length = SourceString->Length; } - /* * @implemented - */ -ULONG STDCALL -RtlAnsiStringToUnicodeSize(IN PANSI_STRING AnsiString) -{ - return RtlxAnsiStringToUnicodeSize(AnsiString); -} - - -/* - * @implemented - */ -ULONG STDCALL -RtlOemStringToUnicodeSize(IN POEM_STRING OemString) -{ - return RtlxOemStringToUnicodeSize(OemString); -} - - - -/* - * @implemented - */ -ULONG STDCALL -RtlUnicodeStringToAnsiSize(IN PUNICODE_STRING UnicodeString) -{ - return RtlxUnicodeStringToAnsiSize(UnicodeString); -} - - -/* - * @implemented - */ -ULONG STDCALL -RtlUnicodeStringToOemSize(IN PUNICODE_STRING UnicodeString) -{ - return RtlxUnicodeStringToOemSize(UnicodeString); -} - -/* - * @implemented * * NOTES * See RtlpDuplicateUnicodeString _____ Modified: trunk/reactos/w32api/include/ddk/winddk.h --- trunk/reactos/w32api/include/ddk/winddk.h 2005-09-06 15:57:42 UTC (rev 17699) +++ trunk/reactos/w32api/include/ddk/winddk.h 2005-09-06 17:33:56 UTC (rev 17700) @@ -5099,9 +5099,15 @@ NTOSAPI ULONG DDKAPI -RtlAnsiStringToUnicodeSize( - IN PANSI_STRING AnsiString); +RtlxAnsiStringToUnicodeSize( + IN PCANSI_STRING AnsiString); +#define RtlAnsiStringToUnicodeSize(STRING) ( \ + NLS_MB_CODE_PAGE_TAG ? \ + RtlxAnsiStringToUnicodeSize(STRING) : \ + ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \ +) + NTOSAPI NTSTATUS DDKAPI @@ -5720,11 +5726,11 @@ RtlUlonglongByteSwap( IN ULONGLONG Source); -NTOSAPI -ULONG -DDKAPI -RtlUnicodeStringToAnsiSize( - IN PUNICODE_STRING UnicodeString); +#define RtlUnicodeStringToAnsiSize(STRING) ( \ + NLS_MB_CODE_PAGE_TAG ? \ + RtlxUnicodeStringToAnsiSize(STRING) : \ + ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \ +) NTOSAPI NTSTATUS
19 years, 3 months
1
0
0
0
[ion] 17699: - Remove deprecated zwtypes.h and spread out the types in the NT subsystems where they should go.
by ion@svn.reactos.com
- Remove deprecated zwtypes.h and spread out the types in the NT subsystems where they should go. Modified: trunk/reactos/include/ndk/cmtypes.h Modified: trunk/reactos/include/ndk/extypes.h Modified: trunk/reactos/include/ndk/iotypes.h Modified: trunk/reactos/include/ndk/ldrfuncs.h Modified: trunk/reactos/include/ndk/lpctypes.h Modified: trunk/reactos/include/ndk/mmtypes.h Modified: trunk/reactos/include/ndk/ntndk.h Modified: trunk/reactos/include/ndk/obtypes.h Modified: trunk/reactos/include/ndk/potypes.h Modified: trunk/reactos/include/ndk/pstypes.h Deleted: trunk/reactos/include/ndk/zwtypes.h _____ Modified: trunk/reactos/include/ndk/cmtypes.h --- trunk/reactos/include/ndk/cmtypes.h 2005-09-06 14:19:03 UTC (rev 17698) +++ trunk/reactos/include/ndk/cmtypes.h 2005-09-06 15:57:42 UTC (rev 17699) @@ -11,11 +11,24 @@ #define _CMTYPES_H /* DEPENDENCIES **************************************************************/ +#include <cfg.h> +#include "iotypes.h" /* EXPORTED DATA *************************************************************/ /* CONSTANTS *****************************************************************/ +#define MAX_BUS_NAME 24 +/* PLUGPLAY_CONTROL_RELATED_DEVICE_DATA.Relation values */ +#define PNP_GET_PARENT_DEVICE 1 +#define PNP_GET_CHILD_DEVICE 2 +#define PNP_GET_SIBLING_DEVICE 3 + +/* PLUGPLAY_CONTROL_STATUS_DATA.Operation values */ +#define PNP_GET_DEVICE_STATUS 0 +#define PNP_SET_DEVICE_STATUS 1 +#define PNP_CLEAR_DEVICE_STATUS 2 + /* ENUMERATIONS **************************************************************/ #ifdef NTOS_MODE_USER @@ -44,9 +57,46 @@ KeyUserFlagsInformation, MaxKeySetInfoClass } KEY_SET_INFORMATION_CLASS; +#endif +typedef enum _PLUGPLAY_CONTROL_CLASS +{ + PlugPlayControlUserResponse = 0x07, + PlugPlayControlProperty = 0x0A, + PlugPlayControlGetRelatedDevice = 0x0C, + PlugPlayControlDeviceStatus = 0x0E, + PlugPlayControlGetDeviceDepth +} PLUGPLAY_CONTROL_CLASS; + +typedef enum _PLUGPLAY_BUS_CLASS +{ + SystemBus, + PlugPlayVirtualBus, + MaxPlugPlayBusClass +} PLUGPLAY_BUS_CLASS, *PPLUGPLAY_BUS_CLASS; + +typedef enum _PLUGPLAY_VIRTUAL_BUS_TYPE +{ + Root, + MaxPlugPlayVirtualBusType +} PLUGPLAY_VIRTUAL_BUS_TYPE, *PPLUGPLAY_VIRTUAL_BUS_TYPE; + +typedef enum _PLUGPLAY_EVENT_CATEGORY +{ + HardwareProfileChangeEvent, + TargetDeviceChangeEvent, + DeviceClassChangeEvent, + CustomDeviceEvent, + DeviceInstallEvent, + DeviceArrivalEvent, + PowerEvent, + VetoEvent, + BlockedDriverEvent, + MaxPlugEventCategory +} PLUGPLAY_EVENT_CATEGORY; /* TYPES *********************************************************************/ +#ifdef NTOS_MODE_USER typedef struct _KEY_WRITE_TIME_INFORMATION { LARGE_INTEGER LastWriteTime; @@ -125,5 +175,105 @@ } KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION; #endif + +typedef struct _PLUGPLAY_EVENT_BLOCK +{ + GUID EventGuid; + PLUGPLAY_EVENT_CATEGORY EventCategory; + PULONG Result; + ULONG Flags; + ULONG TotalSize; + PVOID DeviceObject; + union + { + struct + { + GUID ClassGuid; + WCHAR SymbolicLinkName[ANYSIZE_ARRAY]; + } DeviceClass; + struct + { + WCHAR DeviceIds[ANYSIZE_ARRAY]; + } TargetDevice; + struct + { + WCHAR DeviceId[ANYSIZE_ARRAY]; + } InstallDevice; + struct + { + PVOID NotificationStructure; + WCHAR DeviceIds[ANYSIZE_ARRAY]; + } CustomNotification; + struct + { + PVOID Notification; + } ProfileNotification; + struct + { + ULONG NotificationCode; + ULONG NotificationData; + } PowerNotification; + struct + { + PNP_VETO_TYPE VetoType; + WCHAR DeviceIdVetoNameBuffer[ANYSIZE_ARRAY]; + } VetoNotification; + struct + { + GUID BlockedDriverGuid; + } BlockedDriverNotification; + }; +} PLUGPLAY_EVENT_BLOCK, *PPLUGPLAY_EVENT_BLOCK; + +/* Class 0x0A */ +typedef struct _PLUGPLAY_CONTROL_PROPERTY_DATA +{ + UNICODE_STRING DeviceInstance; + ULONG Property; + PVOID Buffer; + ULONG BufferSize; +} PLUGPLAY_CONTROL_PROPERTY_DATA, *PPLUGPLAY_CONTROL_PROPERTY_DATA; + +/* Class 0x0C */ +typedef struct _PLUGPLAY_CONTROL_RELATED_DEVICE_DATA +{ + UNICODE_STRING TargetDeviceInstance; + ULONG Relation; /* 1: Parent 2: Child 3: Sibling */ + UNICODE_STRING RelatedDeviceInstance; +} PLUGPLAY_CONTROL_RELATED_DEVICE_DATA, *PPLUGPLAY_CONTROL_RELATED_DEVICE_DATA; + +/* Class 0x0E */ +typedef struct _PLUGPLAY_CONTOL_STATUS_DATA +{ + UNICODE_STRING DeviceInstance; + ULONG Operation; /* 0: Get 1: Set 2: Clear */ + ULONG DeviceStatus; /* DN_ see cfg.h */ + ULONG DeviceProblem; /* CM_PROB_ see cfg.h */ +} PLUGPLAY_CONTROL_STATUS_DATA, *PPLUGPLAY_CONTROL_STATUS_DATA; + +/* Class 0x0F */ +typedef struct _PLUGPLAY_CONTOL_DEPTH_DATA +{ + UNICODE_STRING DeviceInstance; + ULONG Depth; +} PLUGPLAY_CONTROL_DEPTH_DATA, *PPLUGPLAY_CONTROL_DEPTH_DATA; + +typedef struct _PLUGPLAY_BUS_TYPE +{ + PLUGPLAY_BUS_CLASS BusClass; + union + { + INTERFACE_TYPE SystemBusType; + PLUGPLAY_VIRTUAL_BUS_TYPE PlugPlayVirtualBusType; + }; +} PLUGPLAY_BUS_TYPE, *PPLUGPLAY_BUS_TYPE; + +typedef struct _PLUGPLAY_BUS_INSTANCE +{ + PLUGPLAY_BUS_TYPE BusType; + ULONG BusNumber; + WCHAR BusName[MAX_BUS_NAME]; +} PLUGPLAY_BUS_INSTANCE, *PPLUGPLAY_BUS_INSTANCE; + #endif _____ Modified: trunk/reactos/include/ndk/extypes.h --- trunk/reactos/include/ndk/extypes.h 2005-09-06 14:19:03 UTC (rev 17698) +++ trunk/reactos/include/ndk/extypes.h 2005-09-06 15:57:42 UTC (rev 17699) @@ -11,6 +11,15 @@ #define _EXTYPES_H /* DEPENDENCIES **************************************************************/ +#include <cfg.h> +/* FIXME: this needs be implemented in the w32api ddk */ +#ifdef _MSC_VER +#include <ntimage.h> +#endif +#include "cmtypes.h" +#include "ketypes.h" +#include "pstypes.h" +#include "potypes.h" /* EXPORTED DATA *************************************************************/ #ifndef NTOS_MODE_USER @@ -32,6 +41,10 @@ #define CALLBACK_EXECUTE (STANDARD_RIGHTS_EXECUTE|SYNCHRONIZE|0x0001) #define CALLBACK_WRITE (STANDARD_RIGHTS_WRITE|SYNCHRONIZE|0x0001) #define CALLBACK_READ (STANDARD_RIGHTS_READ|SYNCHRONIZE|0x0001) +#define EVENT_READ_ACCESS 1 +#define EVENT_WRITE_ACCESS 2 +#define PORT_ALL_ACCESS 0x1 +#define EVENT_PAIR_ALL_ACCESS 0x1F0000L #ifdef NTOS_MODE_USER #define EVENT_QUERY_STATE 0x0001 #define SEMAPHORE_QUERY_STATE 0x0001 @@ -40,9 +53,127 @@ #define MAXIMUM_HARDERROR_PARAMETERS 4 /* ENUMERATIONS **************************************************************/ +typedef enum _SHUTDOWN_ACTION +{ + ShutdownNoReboot, + ShutdownReboot, + ShutdownPowerOff +} SHUTDOWN_ACTION; +typedef enum _HARDERROR_RESPONSE_OPTION +{ + OptionAbortRetryIgnore, + OptionOk, + OptionOkCancel, + OptionRetryCancel, + OptionYesNo, + OptionYesNoCancel, + OptionShutdownSystem +} HARDERROR_RESPONSE_OPTION, *PHARDERROR_RESPONSE_OPTION; + +typedef enum _HARDERROR_RESPONSE +{ + ResponseReturnToCaller, + ResponseNotHandled, + ResponseAbort, + ResponseCancel, + ResponseIgnore, + ResponseNo, + ResponseOk, + ResponseRetry, + ResponseYes +} HARDERROR_RESPONSE, *PHARDERROR_RESPONSE; + +typedef enum _SYSTEM_INFORMATION_CLASS +{ + SystemBasicInformation, + SystemProcessorInformation, + SystemPerformanceInformation, + SystemTimeOfDayInformation, + SystemPathInformation, /* OBSOLETE: USE KUSER_SHARED_DATA */ + SystemProcessInformation, + SystemCallCountInformation, + SystemDeviceInformation, + SystemProcessorPerformanceInformation, + SystemFlagsInformation, + SystemCallTimeInformation, + SystemModuleInformation, + SystemLocksInformation, + SystemStackTraceInformation, + SystemPagedPoolInformation, + SystemNonPagedPoolInformation, + SystemHandleInformation, + SystemObjectInformation, + SystemPageFileInformation, + SystemVdmInstemulInformation, + SystemVdmBopInformation, + SystemFileCacheInformation, + SystemPoolTagInformation, + SystemInterruptInformation, + SystemDpcBehaviorInformation, + SystemFullMemoryInformation, + SystemLoadGdiDriverInformation, + SystemUnloadGdiDriverInformation, + SystemTimeAdjustmentInformation, + SystemSummaryMemoryInformation, + SystemNextEventIdInformation, + SystemEventIdsInformation, + SystemCrashDumpInformation, + SystemExceptionInformation, + SystemCrashDumpStateInformation, + SystemKernelDebuggerInformation, + SystemContextSwitchInformation, + SystemRegistryQuotaInformation, + SystemExtendServiceTableInformation, + SystemPrioritySeperation, + SystemPlugPlayBusInformation, + SystemDockInformation, + _SystemPowerInformation, /* FIXME */ + SystemProcessorSpeedInformation, + SystemCurrentTimeZoneInformation, + SystemLookasideInformation, + SystemTimeSlipNotification, + SystemSessionCreate, + SystemSessionDetach, + SystemSessionInformation, + SystemRangeStartInformation, + SystemVerifierInformation, + SystemAddVerifier, + SystemSessionProcessesInformation, + SystemInformationClassMax +} SYSTEM_INFORMATION_CLASS; + +typedef enum _MUTANT_INFORMATION_CLASS +{ + MutantBasicInformation +} MUTANT_INFORMATION_CLASS; + +typedef enum _ATOM_INFORMATION_CLASS +{ + AtomBasicInformation, + AtomTableInformation, +} ATOM_INFORMATION_CLASS; + +typedef enum _TIMER_INFORMATION_CLASS +{ + TimerBasicInformation +} TIMER_INFORMATION_CLASS; + +typedef enum _SEMAPHORE_INFORMATION_CLASS +{ + SemaphoreBasicInformation +} SEMAPHORE_INFORMATION_CLASS; + +typedef enum _EVENT_INFORMATION_CLASS +{ + EventBasicInformation +} EVENT_INFORMATION_CLASS; + /* TYPES *********************************************************************/ +typedef USHORT LANGID, *PLANGID; +typedef USHORT RTL_ATOM, *PRTL_ATOM; + #ifndef NTOS_MODE_USER typedef struct _EX_QUEUE_WORKER_INFO { @@ -123,5 +254,703 @@ } HANDLE_TABLE, *PHANDLE_TABLE; #endif + +typedef struct _MUTANT_BASIC_INFORMATION +{ + LONG CurrentCount; + BOOLEAN OwnedByCaller; + BOOLEAN AbandonedState; +} MUTANT_BASIC_INFORMATION, *PMUTANT_BASIC_INFORMATION; + +typedef struct _ATOM_BASIC_INFORMATION +{ + USHORT UsageCount; + USHORT Flags; + USHORT NameLength; + WCHAR Name[1]; +} ATOM_BASIC_INFORMATION, *PATOM_BASIC_INFORMATION; + +typedef struct _ATOM_TABLE_INFORMATION +{ + ULONG NumberOfAtoms; + USHORT Atoms[1]; +} ATOM_TABLE_INFORMATION, *PATOM_TABLE_INFORMATION; + +typedef struct _TIMER_BASIC_INFORMATION +{ + LARGE_INTEGER TimeRemaining; + BOOLEAN SignalState; +} TIMER_BASIC_INFORMATION, *PTIMER_BASIC_INFORMATION; + +typedef struct _SEMAPHORE_BASIC_INFORMATION +{ + LONG CurrentCount; + LONG MaximumCount; +} SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION; + +typedef struct _EVENT_BASIC_INFORMATION +{ + EVENT_TYPE EventType; + LONG EventState; +} EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION; + +/* Class 0 */ +typedef struct _SYSTEM_BASIC_INFORMATION +{ + ULONG Reserved; + ULONG TimerResolution; + ULONG PageSize; + ULONG NumberOfPhysicalPages; + ULONG LowestPhysicalPageNumber; + ULONG HighestPhysicalPageNumber; + ULONG AllocationGranularity; + ULONG MinimumUserModeAddress; + ULONG MaximumUserModeAddress; + KAFFINITY ActiveProcessorsAffinityMask; + CCHAR NumberOfProcessors; +} SYSTEM_BASIC_INFORMATION, *PSYSTEM_BASIC_INFORMATION; + +/* Class 1 */ +typedef struct _SYSTEM_PROCESSOR_INFORMATION +{ + USHORT ProcessorArchitecture; + USHORT ProcessorLevel; + USHORT ProcessorRevision; + USHORT Reserved; + ULONG ProcessorFeatureBits; +} SYSTEM_PROCESSOR_INFORMATION, *PSYSTEM_PROCESSOR_INFORMATION; + +/* Class 2 */ +typedef struct _SYSTEM_PERFORMANCE_INFORMATION +{ + LARGE_INTEGER IdleProcessTime; + LARGE_INTEGER IoReadTransferCount; + LARGE_INTEGER IoWriteTransferCount; + LARGE_INTEGER IoOtherTransferCount; + ULONG IoReadOperationCount; + ULONG IoWriteOperationCount; + ULONG IoOtherOperationCount; + ULONG AvailablePages; + ULONG CommittedPages; + ULONG CommitLimit; + ULONG PeakCommitment; + ULONG PageFaultCount; + ULONG CopyOnWriteCount; + ULONG TransitionCount; + ULONG CacheTransitionCount; + ULONG DemandZeroCount; + ULONG PageReadCount; + ULONG PageReadIoCount; + ULONG CacheReadCount; + ULONG CacheIoCount; + ULONG DirtyPagesWriteCount; + ULONG DirtyWriteIoCount; + ULONG MappedPagesWriteCount; + ULONG MappedWriteIoCount; + ULONG PagedPoolPages; + ULONG NonPagedPoolPages; + ULONG PagedPoolAllocs; + ULONG PagedPoolFrees; + ULONG NonPagedPoolAllocs; + ULONG NonPagedPoolFrees; + ULONG FreeSystemPtes; + ULONG ResidentSystemCodePage; + ULONG TotalSystemDriverPages; + ULONG TotalSystemCodePages; + ULONG NonPagedPoolLookasideHits; + ULONG PagedPoolLookasideHits; + ULONG Spare3Count; + ULONG ResidentSystemCachePage; + ULONG ResidentPagedPoolPage; + ULONG ResidentSystemDriverPage; + ULONG CcFastReadNoWait; + ULONG CcFastReadWait; + ULONG CcFastReadResourceMiss; + ULONG CcFastReadNotPossible; + ULONG CcFastMdlReadNoWait; + ULONG CcFastMdlReadWait; + ULONG CcFastMdlReadResourceMiss; + ULONG CcFastMdlReadNotPossible; + ULONG CcMapDataNoWait; + ULONG CcMapDataWait; + ULONG CcMapDataNoWaitMiss; + ULONG CcMapDataWaitMiss; + ULONG CcPinMappedDataCount; + ULONG CcPinReadNoWait; + ULONG CcPinReadWait; + ULONG CcPinReadNoWaitMiss; + ULONG CcPinReadWaitMiss; + ULONG CcCopyReadNoWait; + ULONG CcCopyReadWait; + ULONG CcCopyReadNoWaitMiss; + ULONG CcCopyReadWaitMiss; + ULONG CcMdlReadNoWait; + ULONG CcMdlReadWait; + ULONG CcMdlReadNoWaitMiss; + ULONG CcMdlReadWaitMiss; + ULONG CcReadAheadIos; + ULONG CcLazyWriteIos; + ULONG CcLazyWritePages; + ULONG CcDataFlushes; + ULONG CcDataPages; + ULONG ContextSwitches; + ULONG FirstLevelTbFills; + ULONG SecondLevelTbFills; + ULONG SystemCalls; +} SYSTEM_PERFORMANCE_INFORMATION, *PSYSTEM_PERFORMANCE_INFORMATION; + +/* Class 3 */ +typedef struct _SYSTEM_TIMEOFDAY_INFORMATION +{ + LARGE_INTEGER BootTime; + LARGE_INTEGER CurrentTime; + LARGE_INTEGER TimeZoneBias; + ULONG TimeZoneId; + ULONG Reserved; +} SYSTEM_TIMEOFDAY_INFORMATION, *PSYSTEM_TIMEOFDAY_INFORMATION; + +/* Class 4 */ +/* This class is obsoleted, please use KUSER_SHARED_DATA instead */ + +/* Class 5 */ +typedef struct _SYSTEM_THREAD_INFORMATION +{ + 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_THREAD_INFORMATION, *PSYSTEM_THREAD_INFORMATION; + +typedef struct _SYSTEM_PROCESS_INFORMATION +{ + 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; + + /* Finally, the array of Threads */ + SYSTEM_THREAD_INFORMATION TH[1]; +} SYSTEM_PROCESS_INFORMATION, *PSYSTEM_PROCESS_INFORMATION; + +/* Class 6 */ +typedef struct _SYSTEM_CALL_COUNT_INFORMATION +{ + ULONG Length; + ULONG NumberOfTables; +} SYSTEM_CALL_COUNT_INFORMATION, *PSYSTEM_CALL_COUNT_INFORMATION; + +/* Class 7 */ +typedef struct _SYSTEM_DEVICE_INFORMATION +{ + ULONG NumberOfDisks; + ULONG NumberOfFloppies; + ULONG NumberOfCdRoms; + ULONG NumberOfTapes; + ULONG NumberOfSerialPorts; + ULONG NumberOfParallelPorts; +} SYSTEM_DEVICE_INFORMATION, *PSYSTEM_DEVICE_INFORMATION; + +/* Class 8 */ +typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION +{ + LARGE_INTEGER IdleTime; + LARGE_INTEGER KernelTime; + LARGE_INTEGER UserTime; + LARGE_INTEGER DpcTime; + LARGE_INTEGER InterruptTime; + ULONG InterruptCount; +} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; + +/* Class 9 */ +typedef struct _SYSTEM_FLAGS_INFORMATION +{ + ULONG Flags; +} SYSTEM_FLAGS_INFORMATION, *PSYSTEM_FLAGS_INFORMATION; + +/* Class 10 */ +typedef struct _SYSTEM_CALL_TIME_INFORMATION +{ + ULONG Length; + ULONG TotalCalls; + LARGE_INTEGER TimeOfCalls[1]; +} SYSTEM_CALL_TIME_INFORMATION, *PSYSTEM_CALL_TIME_INFORMATION; + +/* Class 11 */ +typedef struct _SYSTEM_MODULE_INFORMATION_ENTRY +{ + ULONG Unknown1; + ULONG Unknown2; + PVOID Base; + ULONG Size; + ULONG Flags; + USHORT Index; + USHORT NameLength; + USHORT LoadCount; + USHORT PathLength; + CHAR ImageName[256]; +} SYSTEM_MODULE_INFORMATION_ENTRY, *PSYSTEM_MODULE_INFORMATION_ENTRY; +typedef struct _SYSTEM_MODULE_INFORMATION +{ + ULONG Count; + SYSTEM_MODULE_INFORMATION_ENTRY Module[1]; +} SYSTEM_MODULE_INFORMATION, *PSYSTEM_MODULE_INFORMATION; + +/* Class 12 */ +typedef struct _SYSTEM_RESOURCE_LOCK_ENTRY +{ + ULONG ResourceAddress; + ULONG Always1; + ULONG Unknown; + ULONG ActiveCount; + ULONG ContentionCount; + ULONG Unused[2]; + ULONG NumberOfSharedWaiters; + ULONG NumberOfExclusiveWaiters; +} SYSTEM_RESOURCE_LOCK_ENTRY, *PSYSTEM_RESOURCE_LOCK_ENTRY; + +typedef struct _SYSTEM_RESOURCE_LOCK_INFO +{ + ULONG Count; + SYSTEM_RESOURCE_LOCK_ENTRY Lock[1]; +} SYSTEM_RESOURCE_LOCK_INFO, *PSYSTEM_RESOURCE_LOCK_INFO; + +/* Class 13 */ +typedef struct _SYSTEM_BACKTRACE_INFORMATION_ENTRY +{ + ULONG Dummy; + /* FIXME */ +} SYSTEM_BACKTRACE_INFORMATION_ENTRY, *PSYSTEM_BACKTRACE_INFORMATION_ENTRY; + +typedef struct _SYSTEM_BACKTRACE_INFORMATION +{ + /* FIXME */ + ULONG Unknown[4]; + ULONG Count; + SYSTEM_BACKTRACE_INFORMATION_ENTRY Trace[1]; +} SYSTEM_BACKTRACE_INFORMATION, *PSYSTEM_BACKTRACE_INFORMATION; + +/* Class 14 - 15 */ +typedef struct _SYSTEM_POOL_ENTRY +{ + BOOLEAN Allocated; + BOOLEAN Spare0; + USHORT AllocatorBackTraceIndex; + ULONG Size; + union + { + UCHAR Tag[4]; + ULONG TagUlong; + PVOID ProcessChargedQuota; + }; +} SYSTEM_POOL_ENTRY, *PSYSTEM_POOL_ENTRY; + +typedef struct _SYSTEM_POOL_INFORMATION +{ + ULONG TotalSize; + PVOID FirstEntry; + USHORT EntryOverhead; + BOOLEAN PoolTagPresent; + BOOLEAN Spare0; + ULONG NumberOfEntries; + SYSTEM_POOL_ENTRY Entries[1]; +} SYSTEM_POOL_INFORMATION, *PSYSTEM_POOL_INFORMATION; + +/* Class 16 */ +typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO +{ + USHORT UniqueProcessId; + USHORT CreatorBackTraceIndex; + UCHAR ObjectTypeIndex; + UCHAR HandleAttributes; + USHORT HandleValue; + PVOID Object; + ULONG GrantedAccess; +} SYSTEM_HANDLE_TABLE_ENTRY_INFO, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO; + +typedef struct _SYSTEM_HANDLE_INFORMATION +{ + ULONG NumberOfHandles; + SYSTEM_HANDLE_TABLE_ENTRY_INFO Handles[1]; +} SYSTEM_HANDLE_INFORMATION, *PSYSTEM_HANDLE_INFORMATION; + +/* Class 17 */ +typedef struct _SYSTEM_OBJECTTYPE_INFORMATION +{ + ULONG NextEntryOffset; + ULONG NumberOfObjects; + ULONG NumberOfHandles; + ULONG TypeIndex; + ULONG InvalidAttributes; + GENERIC_MAPPING GenericMapping; + ULONG ValidAccessMask; + ULONG PoolType; + BOOLEAN SecurityRequired; + BOOLEAN WaitableObject; + UNICODE_STRING TypeName; +} SYSTEM_OBJECTTYPE_INFORMATION, *PSYSTEM_OBJECTTYPE_INFORMATION; + +typedef struct _SYSTEM_OBJECT_INFORMATION +{ + ULONG NextEntryOffset; + PVOID Object; + HANDLE CreatorUniqueProcess; + USHORT CreatorBackTraceIndex; + USHORT Flags; + LONG PointerCount; + LONG HandleCount; + ULONG PagedPoolCharge; + ULONG NonPagedPoolCharge; + HANDLE ExclusiveProcessId; + PVOID SecurityDescriptor; + OBJECT_NAME_INFORMATION NameInfo; +} SYSTEM_OBJECT_INFORMATION, *PSYSTEM_OBJECT_INFORMATION; + +/* Class 18 */ +typedef struct _SYSTEM_PAGEFILE_INFORMATION +{ + ULONG NextEntryOffset; + ULONG TotalSize; + ULONG TotalInUse; + ULONG PeakUsage; + UNICODE_STRING PageFileName; +} SYSTEM_PAGEFILE_INFORMATION, *PSYSTEM_PAGEFILE_INFORMATION; + +/* Class 19 */ +typedef struct _SYSTEM_VDM_INSTEMUL_INFO +{ + ULONG SegmentNotPresent; + ULONG VdmOpcode0F; + ULONG OpcodeESPrefix; + ULONG OpcodeCSPrefix; + ULONG OpcodeSSPrefix; + ULONG OpcodeDSPrefix; + ULONG OpcodeFSPrefix; + ULONG OpcodeGSPrefix; + ULONG OpcodeOPER32Prefix; + ULONG OpcodeADDR32Prefix; + ULONG OpcodeINSB; + ULONG OpcodeINSW; + ULONG OpcodeOUTSB; + ULONG OpcodeOUTSW; + ULONG OpcodePUSHF; + ULONG OpcodePOPF; + ULONG OpcodeINTnn; + ULONG OpcodeINTO; + ULONG OpcodeIRET; + ULONG OpcodeINBimm; + ULONG OpcodeINWimm; + ULONG OpcodeOUTBimm; + ULONG OpcodeOUTWimm ; + ULONG OpcodeINB; + ULONG OpcodeINW; + ULONG OpcodeOUTB; + ULONG OpcodeOUTW; + ULONG OpcodeLOCKPrefix; + ULONG OpcodeREPNEPrefix; + ULONG OpcodeREPPrefix; + ULONG OpcodeHLT; + ULONG OpcodeCLI; + ULONG OpcodeSTI; + ULONG BopCount; +} SYSTEM_VDM_INSTEMUL_INFO, *PSYSTEM_VDM_INSTEMUL_INFO; + +/* Class 20 */ +typedef struct _SYSTEM_VDM_BOP_INFO +{ + /* FIXME */ + PVOID Dummy; +} SYSTEM_VDM_BOP_INFO, *PSYSTEM_VDM_BOP_INFO; + +/* Class 21 */ +typedef struct _SYSTEM_CACHE_INFORMATION +{ + ULONG CurrentSize; + ULONG PeakSize; + ULONG PageFaultCount; + ULONG MinimumWorkingSet; + ULONG MaximumWorkingSet; + ULONG CurrentSizeIncludingTransitionInPages; + ULONG PeakSizeIncludingTransitionInPages; + ULONG Unused[2]; +} SYSTEM_CACHE_INFORMATION, *PSYSTEM_CACHE_INFORMATION; + +/* Class 22 */ +typedef struct _SYSTEM_POOLTAG +{ + union + { + UCHAR Tag[4]; + ULONG TagUlong; + }; + ULONG PagedAllocs; + ULONG PagedFrees; + ULONG PagedUsed; + ULONG NonPagedAllocs; + ULONG NonPagedFrees; + ULONG NonPagedUsed; +} SYSTEM_POOLTAG, *PSYSTEM_POOLTAG; +typedef struct _SYSTEM_POOLTAG_INFORMATION +{ + ULONG Count; + SYSTEM_POOLTAG TagInfo[1]; +} SYSTEM_POOLTAG_INFORMATION, *PSYSTEM_POOLTAG_INFORMATION; + +/* Class 23 */ +typedef struct _SYSTEM_INTERRUPT_INFORMATION +{ + ULONG ContextSwitches; + ULONG DpcCount; + ULONG DpcRate; + ULONG TimeIncrement; + ULONG DpcBypassCount; + ULONG ApcBypassCount; +} SYSTEM_INTERRUPT_INFORMATION, *PSYSTEM_INTERRUPT_INFORMATION; + +/* Class 24 */ +typedef struct _SYSTEM_DPC_BEHAVIOR_INFORMATION +{ + ULONG Spare; + ULONG DpcQueueDepth; + ULONG MinimumDpcRate; + ULONG AdjustDpcThreshold; + ULONG IdealDpcRate; +} SYSTEM_DPC_BEHAVIOR_INFORMATION, *PSYSTEM_DPC_BEHAVIOR_INFORMATION; + +/* Class 25 */ +typedef struct _SYSTEM_MEMORY_INFO +{ + PUCHAR StringOffset; + USHORT ValidCount; + USHORT TransitionCount; + USHORT ModifiedCount; + USHORT PageTableCount; +} SYSTEM_MEMORY_INFO, *PSYSTEM_MEMORY_INFO; +typedef struct _SYSTEM_MEMORY_INFORMATION +{ + ULONG InfoSize; + ULONG StringStart; + SYSTEM_MEMORY_INFO Memory[1]; +} SYSTEM_MEMORY_INFORMATION, *PSYSTEM_MEMORY_INFORMATION; + +/* Class 26 */ +typedef struct _SYSTEM_GDI_DRIVER_INFORMATION +{ + UNICODE_STRING DriverName; + PVOID ImageAddress; + PVOID SectionPointer; + PVOID EntryPoint; + PIMAGE_EXPORT_DIRECTORY ExportSectionPointer; +} SYSTEM_GDI_DRIVER_INFORMATION, *PSYSTEM_GDI_DRIVER_INFORMATION; + +/* Class 27 */ +/* Not an actuall class, simply a PVOID to the ImageAddress */ + +/* Class 28 */ +typedef struct _SYSTEM_QUERY_TIME_ADJUST_INFORMATION +{ + ULONG TimeAdjustment; + ULONG TimeIncrement; + BOOLEAN Enable; +} SYSTEM_QUERY_TIME_ADJUST_INFORMATION, *PSYSTEM_QUERY_TIME_ADJUST_INFORMATION; + +typedef struct _SYSTEM_SET_TIME_ADJUST_INFORMATION +{ + ULONG TimeAdjustment; + BOOLEAN Enable; +} SYSTEM_SET_TIME_ADJUST_INFORMATION, *PSYSTEM_SET_TIME_ADJUST_INFORMATION; + +/* Class 29 - Same as 25 */ + +/* Class 30 - 31 */ +/* FIXME */ + +/* Class 32 */ +typedef struct _SYSTEM_CRASH_DUMP_INFORMATION +{ + HANDLE CrashDumpSection; +} SYSTEM_CRASH_DUMP_INFORMATION, *PSYSTEM_CRASH_DUMP_INFORMATION; + +/* Class 33 */ +typedef struct _SYSTEM_EXCEPTION_INFORMATION +{ + ULONG AlignmentFixupCount; + ULONG ExceptionDispatchCount; + ULONG FloatingEmulationCount; + ULONG ByteWordEmulationCount; +} SYSTEM_EXCEPTION_INFORMATION, *PSYSTEM_EXCEPTION_INFORMATION; + +/* Class 34 */ +typedef struct _SYSTEM_CRASH_STATE_INFORMATION +{ + ULONG ValidCrashDump; +} SYSTEM_CRASH_STATE_INFORMATION, *PSYSTEM_CRASH_STATE_INFORMATION; + +/* Class 35 */ +typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION +{ + BOOLEAN KernelDebuggerEnabled; + BOOLEAN KernelDebuggerNotPresent; +} SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION; + +/* Class 36 */ +typedef struct _SYSTEM_CONTEXT_SWITCH_INFORMATION +{ + ULONG ContextSwitches; + ULONG FindAny; + ULONG FindLast; + ULONG FindIdeal; + ULONG IdleAny; + ULONG IdleCurrent; + ULONG IdleLast; + ULONG IdleIdeal; + ULONG PreemptAny; + ULONG PreemptCurrent; + ULONG PreemptLast; + ULONG SwitchToIdle; +} SYSTEM_CONTEXT_SWITCH_INFORMATION, *PSYSTEM_CONTEXT_SWITCH_INFORMATION; + +/* Class 37 */ +typedef struct _SYSTEM_REGISTRY_QUOTA_INFORMATION +{ + ULONG RegistryQuotaAllowed; + ULONG RegistryQuotaUsed; + ULONG PagedPoolSize; +} SYSTEM_REGISTRY_QUOTA_INFORMATION, *PSYSTEM_REGISTRY_QUOTA_INFORMATION; + +/* Class 38 */ +/* Not a structure, simply send the UNICODE_STRING */ + +/* Class 39 */ +/* Not a structure, simply send a ULONG containing the new separation */ + +/* Class 40 */ +typedef struct _SYSTEM_PLUGPLAY_BUS_INFORMATION +{ + ULONG BusCount; + PLUGPLAY_BUS_INSTANCE BusInstance[1]; +} SYSTEM_PLUGPLAY_BUS_INFORMATION, *PSYSTEM_PLUGPLAY_BUS_INFORMATION; + +/* Class 41 */ +typedef struct _SYSTEM_DOCK_INFORMATION +{ + SYSTEM_DOCK_STATE DockState; + INTERFACE_TYPE DeviceBusType; + ULONG DeviceBusNumber; + ULONG SlotNumber; +} SYSTEM_DOCK_INFORMATION, *PSYSTEM_DOCK_INFORMATION; + +/* Class 42 */ +/* FIXME: Conflict with WINNT.H */ +typedef struct __SYSTEM_POWER_INFORMATION +{ + BOOLEAN SystemSuspendSupported; + BOOLEAN SystemHibernateSupported; + BOOLEAN ResumeTimerSupportsSuspend; + BOOLEAN ResumeTimerSupportsHibernate; + BOOLEAN LidSupported; + BOOLEAN TurboSettingSupported; + BOOLEAN TurboMode; + BOOLEAN SystemAcOrDc; + BOOLEAN PowerDownDisabled; + LARGE_INTEGER SpindownDrives; +} _SYSTEM_POWER_INFORMATION, *P_SYSTEM_POWER_INFORMATION; + +/* Class 43 */ +typedef struct _SYSTEM_LEGACY_DRIVER_INFORMATION +{ + PNP_VETO_TYPE VetoType; + UNICODE_STRING VetoDriver; + /* Buffer Follows */ +} SYSTEM_LEGACY_DRIVER_INFORMATION, *PSYSTEM_LEGACY_DRIVER_INFORMATION; + +/* Class 44 */ +typedef struct _TIME_ZONE_INFORMATION RTL_TIME_ZONE_INFORMATION; + [truncated at 1000 lines; 1515 more skipped]
19 years, 3 months
1
0
0
0
[gdalsnes] 17698: window parent handle -> pointer adaptions
by gdalsnes@svn.reactos.com
window parent handle -> pointer adaptions Modified: trunk/reactos/subsys/win32k/include/userfuncs.h Modified: trunk/reactos/subsys/win32k/ntuser/painting.c Modified: trunk/reactos/subsys/win32k/ntuser/vis.c Modified: trunk/reactos/subsys/win32k/ntuser/windc.c _____ Modified: trunk/reactos/subsys/win32k/include/userfuncs.h --- trunk/reactos/subsys/win32k/include/userfuncs.h 2005-09-06 14:09:22 UTC (rev 17697) +++ trunk/reactos/subsys/win32k/include/userfuncs.h 2005-09-06 14:19:03 UTC (rev 17698) @@ -1,7 +1,12 @@ #ifndef _WIN32K_USERFUNCS_H #define _WIN32K_USERFUNCS_H +//currently unused +#define ASSERT_REFS(obj) +#define UserReferenceWindowObjectCo(o) IntReferenceWindowObject(o) +#define UserDereferenceWindowObjectCo(o) IntReleaseWindowObject(o) + extern PUSER_HANDLE_TABLE gHandleTable; _____ Modified: trunk/reactos/subsys/win32k/ntuser/painting.c --- trunk/reactos/subsys/win32k/ntuser/painting.c 2005-09-06 14:09:22 UTC (rev 17697) +++ trunk/reactos/subsys/win32k/ntuser/painting.c 2005-09-06 14:19:03 UTC (rev 17698) @@ -405,20 +405,18 @@ BOOL FASTCALL IntIsWindowDrawable(PWINDOW_OBJECT Window) { - PWINDOW_OBJECT Old, Wnd = Window; + PWINDOW_OBJECT Wnd = Window; - IntReferenceWindowObject(Wnd); do { if (!(Wnd->Style & WS_VISIBLE) || ((Wnd->Style & WS_MINIMIZE) && (Wnd != Window))) { - IntReleaseWindowObject(Wnd); return FALSE; } - Old = Wnd; - Wnd = IntGetParentObject(Wnd); - IntReleaseWindowObject(Old); + + Wnd = Wnd->Parent; + } while(Wnd); return TRUE; _____ Modified: trunk/reactos/subsys/win32k/ntuser/vis.c --- trunk/reactos/subsys/win32k/ntuser/vis.c 2005-09-06 14:09:22 UTC (rev 17697) +++ trunk/reactos/subsys/win32k/ntuser/vis.c 2005-09-06 14:19:03 UTC (rev 17698) @@ -77,7 +77,7 @@ */ PreviousWindow = Window; - CurrentWindow = IntGetParentObject(Window); + CurrentWindow = Window->Parent; while (CurrentWindow) { if (!(CurrentWindow->Style & WS_VISIBLE)) @@ -113,8 +113,7 @@ } PreviousWindow = CurrentWindow; - CurrentWindow = IntGetParentObject(CurrentWindow); - IntReleaseWindowObject(PreviousWindow); + CurrentWindow = CurrentWindow->Parent; } if (ClipChildren) @@ -159,19 +158,23 @@ HRGN Temp; PWINDOW_OBJECT Parent; + ASSERT_REFS(Window); + Temp = NtGdiCreateRectRgn(0, 0, 0, 0); NtGdiCombineRgn(Temp, NewlyExposed, NULL, RGN_COPY); - Parent = IntGetParentObject(Window); + Parent = Window->Parent; if(Parent) { NtGdiOffsetRgn(Temp, Window->WindowRect.left - Parent->ClientRect.left, Window->WindowRect.top - Parent->ClientRect.top); - co_UserRedrawWindow(Parent, NULL, Temp, + + UserReferenceWindowObjectCo(Parent); + co_UserRedrawWindow(Parent, NULL, Temp, RDW_FRAME | RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN); - IntReleaseWindowObject(Parent); + UserDereferenceWindowObjectCo(Parent); } NtGdiDeleteObject(Temp); } _____ Modified: trunk/reactos/subsys/win32k/ntuser/windc.c --- trunk/reactos/subsys/win32k/ntuser/windc.c 2005-09-06 14:09:22 UTC (rev 17697) +++ trunk/reactos/subsys/win32k/ntuser/windc.c 2005-09-06 14:19:03 UTC (rev 17698) @@ -278,7 +278,7 @@ { PWINDOW_OBJECT Parent; - Parent = IntGetParentObject(Window); + Parent = Window->Parent; if(!Parent) { hRgnVisible = NULL; @@ -430,7 +430,7 @@ Flags = (Flags & ~DCX_CLIPCHILDREN) | DCX_CACHE; } - Parent = (Window ? IntGetParentObject(Window) : NULL); + Parent = (Window ? Window->Parent : NULL); if (NULL == Window || !(Window->Style & WS_CHILD) || NULL == Parent) { @@ -450,9 +450,6 @@ } } - if(Parent) - IntReleaseWindowObject(Parent); - DcxFlags = Flags & DCX_CACHECOMPAREMASK; if (Flags & DCX_CACHE)
19 years, 3 months
1
0
0
0
[gdalsnes] 17697: make window parent a pointer + fix usage
by gdalsnes@svn.reactos.com
make window parent a pointer + fix usage Modified: trunk/reactos/subsys/win32k/include/window.h Modified: trunk/reactos/subsys/win32k/ntuser/focus.c Modified: trunk/reactos/subsys/win32k/ntuser/object.c Modified: trunk/reactos/subsys/win32k/ntuser/painting.c Modified: trunk/reactos/subsys/win32k/ntuser/window.c Modified: trunk/reactos/subsys/win32k/ntuser/winpos.c _____ Modified: trunk/reactos/subsys/win32k/include/window.h --- trunk/reactos/subsys/win32k/include/window.h 2005-09-06 13:36:04 UTC (rev 17696) +++ trunk/reactos/subsys/win32k/include/window.h 2005-09-06 14:09:22 UTC (rev 17697) @@ -72,9 +72,9 @@ /* Entry in the list of thread windows. */ LIST_ENTRY ThreadListEntry; /* Handle to the parent window. */ - HANDLE Parent; + struct _WINDOW_OBJECT* Parent; /* Handle to the owner window. */ - HANDLE Owner; + HWND hOwner; /* DC Entries (DCE) */ PDCE Dce; /* Property list head.*/ _____ Modified: trunk/reactos/subsys/win32k/ntuser/focus.c --- trunk/reactos/subsys/win32k/ntuser/focus.c 2005-09-06 13:36:04 UTC (rev 17696) +++ trunk/reactos/subsys/win32k/ntuser/focus.c 2005-09-06 14:09:22 UTC (rev 17697) @@ -129,7 +129,7 @@ for(Child = Root->FirstChild; Child; Child = Child->NextSibling) { - OwnerWnd = IntGetWindowObject(Child->Owner); + OwnerWnd = IntGetWindowObject(Child->hOwner); if(!OwnerWnd) continue; _____ Modified: trunk/reactos/subsys/win32k/ntuser/object.c --- trunk/reactos/subsys/win32k/ntuser/object.c 2005-09-06 13:36:04 UTC (rev 17696) +++ trunk/reactos/subsys/win32k/ntuser/object.c 2005-09-06 14:09:22 UTC (rev 17697) @@ -52,6 +52,8 @@ { DPRINT1("ObjectHeader 0x%X has invalid reference count (%d)\n", ObjectHeader, ObjectHeader->RefCount); + + ASSERT(FALSE); } if (ObjectHeader->HandleCount < 0) _____ Modified: trunk/reactos/subsys/win32k/ntuser/painting.c --- trunk/reactos/subsys/win32k/ntuser/painting.c 2005-09-06 13:36:04 UTC (rev 17696) +++ trunk/reactos/subsys/win32k/ntuser/painting.c 2005-09-06 14:09:22 UTC (rev 17697) @@ -42,7 +42,7 @@ VOID FASTCALL IntValidateParent(PWINDOW_OBJECT Child, HRGN ValidRegion) { - PWINDOW_OBJECT ParentWindow = IntGetParentObject(Child), OldWindow; + PWINDOW_OBJECT ParentWindow = Child->Parent; while (ParentWindow) { @@ -65,9 +65,8 @@ NtGdiOffsetRgn(ValidRegion, -OffsetX, -OffsetY); } } - OldWindow = ParentWindow; - ParentWindow = IntGetParentObject(ParentWindow); - IntReleaseWindowObject(OldWindow); + + ParentWindow = ParentWindow->Parent; } } _____ Modified: trunk/reactos/subsys/win32k/ntuser/window.c --- trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-06 13:36:04 UTC (rev 17696) +++ trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-06 14:09:22 UTC (rev 17697) @@ -147,13 +147,17 @@ if (Wnd->Style & WS_POPUP) { - hWnd = Wnd->Owner; + hWnd = Wnd->hOwner; return IntGetWindowObject(hWnd); } else if (Wnd->Style & WS_CHILD) { - hWnd = Wnd->Parent; - return IntGetWindowObject(hWnd); + PWINDOW_OBJECT par; + + par = Wnd->Parent; + if (par) IntReferenceWindowObject(par); + return par; + //return IntGetWindowObject(hWnd); } return NULL; @@ -164,7 +168,7 @@ { HWND hWnd; - hWnd = Wnd->Owner; + hWnd = Wnd->hOwner; return IntGetWindowObject(hWnd); } @@ -172,10 +176,11 @@ PWINDOW_OBJECT FASTCALL IntGetParentObject(PWINDOW_OBJECT Wnd) { - HWND hParent; - - hParent = Wnd->Parent; - return IntGetWindowObject(hParent); + PWINDOW_OBJECT par; + + par = Wnd->Parent; + if (par) IntReferenceWindowObject(par); + return par; } /* @@ -759,9 +764,9 @@ BOOL FASTCALL IntIsChildWindow(HWND Parent, HWND Child) { - PWINDOW_OBJECT BaseWindow, Window, Old; + PWINDOW_OBJECT BaseWindow, Window; - if(!(BaseWindow = IntGetWindowObject(Child))) + if(!(BaseWindow = UserGetWindowObjectNoRef(Child))) { return FALSE; } @@ -771,24 +776,16 @@ { if (Window->hSelf == Parent) { - if(Window != BaseWindow) - IntReleaseWindowObject(Window); - IntReleaseWindowObject(BaseWindow); return(TRUE); } if(!(Window->Style & WS_CHILD)) { - if(Window != BaseWindow) - IntReleaseWindowObject(Window); break; } - Old = Window; - Window = IntGetParentObject(Window); - if(Old != BaseWindow) - IntReleaseWindowObject(Old); + + Window = Window->Parent; } - IntReleaseWindowObject(BaseWindow); return(FALSE); } @@ -849,37 +846,34 @@ { PWINDOW_OBJECT Parent; - Wnd->Parent = WndParent->hSelf; + Wnd->Parent = WndParent; if ((Wnd->PrevSibling = WndPrevSibling)) { /* link after WndPrevSibling */ if ((Wnd->NextSibling = WndPrevSibling->NextSibling)) Wnd->NextSibling->PrevSibling = Wnd; - else if ((Parent = IntGetWindowObject(Wnd->Parent))) + else if ((Parent = Wnd->Parent)) { if(Parent->LastChild == WndPrevSibling) Parent->LastChild = Wnd; - IntReleaseWindowObject(Parent); } Wnd->PrevSibling->NextSibling = Wnd; } else { /* link at top */ - Parent = IntGetWindowObject(Wnd->Parent); + Parent = Wnd->Parent; if ((Wnd->NextSibling = WndParent->FirstChild)) Wnd->NextSibling->PrevSibling = Wnd; else if (Parent) { Parent->LastChild = Wnd; Parent->FirstChild = Wnd; - IntReleaseWindowObject(Parent); return; } if(Parent) { Parent->FirstChild = Wnd; - IntReleaseWindowObject(Parent); } } @@ -895,7 +889,7 @@ if(!Wnd) return NULL; - WndOldOwner = IntGetWindowObject(Wnd->Owner); + WndOldOwner = IntGetWindowObject(Wnd->hOwner); if (WndOldOwner) { ret = WndOldOwner->hSelf; @@ -908,11 +902,11 @@ if((WndNewOwner = IntGetWindowObject(hWndNewOwner))) { - Wnd->Owner = hWndNewOwner; + Wnd->hOwner = hWndNewOwner; IntReleaseWindowObject(WndNewOwner); } else - Wnd->Owner = NULL; + Wnd->hOwner = NULL; IntReleaseWindowObject(Wnd); return ret; @@ -1048,23 +1042,14 @@ VOID FASTCALL IntUnlinkWindow(PWINDOW_OBJECT Wnd) { - PWINDOW_OBJECT WndParent; + PWINDOW_OBJECT WndParent = Wnd->Parent; - if((WndParent = IntGetWindowObject(Wnd->Parent))) - { - - } - if (Wnd->NextSibling) Wnd->NextSibling->PrevSibling = Wnd->PrevSibling; else if (WndParent && WndParent->LastChild == Wnd) WndParent->LastChild = Wnd->PrevSibling; if (Wnd->PrevSibling) Wnd->PrevSibling->NextSibling = Wnd->NextSibling; else if (WndParent && WndParent->FirstChild == Wnd) WndParent->FirstChild = Wnd->NextSibling; - if(WndParent) - { - IntReleaseWindowObject(WndParent); - } Wnd->PrevSibling = Wnd->NextSibling = Wnd->Parent = NULL; } @@ -1081,7 +1066,7 @@ for(Child = Window->FirstChild; Child; Child = Child->NextSibling) { - if(Child->Owner && Child->Style & WS_VISIBLE) + if(Child->hOwner && Child->Style & WS_VISIBLE) { /* * The desktop has a popup window if one of them has @@ -1548,14 +1533,14 @@ } Window->MessageQueue = PsGetWin32Thread()->MessageQueue; IntReferenceMessageQueue(Window->MessageQueue); - Window->Parent = (ParentWindow ? ParentWindow->hSelf : NULL); + Window->Parent = ParentWindow; if((OwnerWindow = IntGetWindowObject(OwnerWindowHandle))) { - Window->Owner = OwnerWindowHandle; + Window->hOwner = OwnerWindowHandle; IntReleaseWindowObject(OwnerWindow); HasOwner = TRUE; } else { - Window->Owner = NULL; + Window->hOwner = NULL; HasOwner = FALSE; } Window->UserData = 0; @@ -2192,7 +2177,7 @@ Child = IntGetWindowObject(*ChildHandle); if (Child == NULL) continue; - if (Child->Owner != Window->hSelf) + if (Child->hOwner != Window->hSelf) { IntReleaseWindowObject(Child); continue; @@ -2206,9 +2191,9 @@ continue; } - if (Child->Owner != NULL) + if (Child->hOwner != NULL) { - Child->Owner = NULL; + Child->hOwner = NULL; } IntReleaseWindowObject(Child); @@ -3214,27 +3199,23 @@ PWINDOW_OBJECT Parent, Window; HWND hWndResult = NULL; - if (!(Window = IntGetWindowObject(hWnd))) return NULL; + if (!(Window = UserGetWindowObjectNoRef(hWnd))) return NULL; switch (Relationship) { case GW_HWNDFIRST: - if((Parent = IntGetParentObject(Window))) + if((Parent = Window->Parent)) { if (Parent->FirstChild) hWndResult = Parent->FirstChild->hSelf; - - IntReleaseWindowObject(Parent); } break; case GW_HWNDLAST: - if((Parent = IntGetParentObject(Window))) + if((Parent = Window->Parent)) { if (Parent->LastChild) hWndResult = Parent->LastChild->hSelf; - - IntReleaseWindowObject(Parent); } break; @@ -3249,7 +3230,7 @@ break; case GW_OWNER: - if((Parent = IntGetWindowObject(Window->Owner))) + if((Parent = IntGetWindowObject(Window->hOwner))) { hWndResult = Parent->hSelf; IntReleaseWindowObject(Parent); @@ -3261,8 +3242,6 @@ break; } - IntReleaseWindowObject(Window); - return hWndResult; } @@ -3365,14 +3344,13 @@ break; case GWL_HWNDPARENT: - Parent = IntGetWindowObject(Window->Parent); + Parent = Window->Parent; if(Parent) { if (Parent && Parent->hSelf == IntGetDesktopWindow()) Result = (LONG) UserGetWindow(Window->hSelf, GW_OWNER); else Result = (LONG) Parent->hSelf; - IntReleaseWindowObject(Parent); } break; _____ Modified: trunk/reactos/subsys/win32k/ntuser/winpos.c --- trunk/reactos/subsys/win32k/ntuser/winpos.c 2005-09-06 13:36:04 UTC (rev 17696) +++ trunk/reactos/subsys/win32k/ntuser/winpos.c 2005-09-06 14:09:22 UTC (rev 17697) @@ -254,14 +254,13 @@ RECT WorkArea; PDESKTOP_OBJECT Desktop = PsGetWin32Thread()->Desktop; /* Or rather get it from the window? */ - Parent = IntGetParentObject(Window); + Parent = Window->Parent; if(Parent) { if(IntIsDesktopWindow(Parent)) IntGetDesktopWorkArea(Desktop, &WorkArea); else WorkArea = Parent->ClientRect; - IntReleaseWindowObject(Parent); } else IntGetDesktopWorkArea(Desktop, &WorkArea); @@ -507,7 +506,7 @@ params.rgrc[0] = *WindowRect; params.rgrc[1] = Window->WindowRect; params.rgrc[2] = Window->ClientRect; - Parent = IntGetParentObject(Window); + Parent = Window->Parent; if (0 != (Window->Style & WS_CHILD) && Parent) { IntGdiOffsetRect(&(params.rgrc[0]), - Parent->ClientRect.left, @@ -550,8 +549,6 @@ { WinPos->flags &= ~SWP_NOCLIENTSIZE; } - if(Parent) - IntReleaseWindowObject(Parent); } else { @@ -593,14 +590,13 @@ PWINDOW_OBJECT Parent; X = WinPos->x; Y = WinPos->y; - Parent = IntGetParentObject(Window); + Parent = Window->Parent; if ((0 != (Window->Style & WS_CHILD)) && Parent) { X += Parent->ClientRect.left; Y += Parent->ClientRect.top; } - if(Parent) - IntReleaseWindowObject(Parent); + WindowRect->left = X; WindowRect->top = Y; WindowRect->right += X - Window->WindowRect.left; @@ -805,18 +801,14 @@ && HWND_NOTOPMOST != WinPos->hwndInsertAfter && HWND_BOTTOM != WinPos->hwndInsertAfter) { - PWINDOW_OBJECT Parent = IntGetParentObject(Window); + PWINDOW_OBJECT Parent = Window->Parent; if (UserGetAncestor(WinPos->hwndInsertAfter, GA_PARENT) != (Parent ? Parent->hSelf : NULL)) { - if(Parent) - IntReleaseWindowObject(Parent); return FALSE; } else { - if(Parent) - IntReleaseWindowObject(Parent); /* * We don't need to change the Z order of hwnd if it's already * inserted after hwndInsertAfter or when inserting hwnd after @@ -1382,7 +1374,7 @@ if (Wnd == IntGetThreadFocusWindow() || IntIsChildWindow(Wnd, IntGetThreadFocusWindow())) { - UserSetFocus(Window->Parent); + UserSetFocus(Window->Parent->hSelf); } if (!(Window->Parent))
19 years, 3 months
1
0
0
0
[gdalsnes] 17696: remove WndObjListLock
by gdalsnes@svn.reactos.com
remove WndObjListLock Modified: trunk/reactos/subsys/win32k/eng/window.c Modified: trunk/reactos/subsys/win32k/include/window.h Modified: trunk/reactos/subsys/win32k/ntuser/window.c _____ Modified: trunk/reactos/subsys/win32k/eng/window.c --- trunk/reactos/subsys/win32k/eng/window.c 2005-09-06 11:00:27 UTC (rev 17695) +++ trunk/reactos/subsys/win32k/eng/window.c 2005-09-06 13:36:04 UTC (rev 17696) @@ -155,7 +155,6 @@ ASSERT_IRQL(PASSIVE_LEVEL); - ExAcquireFastMutex(&Window->WndObjListLock); CurrentEntry = Window->WndObjListHead.Flink; while (CurrentEntry != &Window->WndObjListHead) { @@ -189,7 +188,6 @@ } } - ExReleaseFastMutex(&Window->WndObjListLock); } /* @@ -255,9 +253,7 @@ WndObjInt->PixelFormat = iPixelFormat; /* associate object with window */ - ExAcquireFastMutex(&Window->WndObjListLock); InsertTailList(&Window->WndObjListHead, &WndObjInt->ListEntry); - ExReleaseFastMutex(&Window->WndObjListLock); /* release resources */ IntReleaseWindowObject(Window); @@ -305,9 +301,7 @@ else { /* Remove object from window */ - ExAcquireFastMutex(&Window->WndObjListLock); RemoveEntryList(&WndObjInt->ListEntry); - ExReleaseFastMutex(&Window->WndObjListLock); IntReleaseWindowObject(Window); } _____ Modified: trunk/reactos/subsys/win32k/include/window.h --- trunk/reactos/subsys/win32k/include/window.h 2005-09-06 11:00:27 UTC (rev 17695) +++ trunk/reactos/subsys/win32k/include/window.h 2005-09-06 13:36:04 UTC (rev 17696) @@ -94,7 +94,6 @@ ULONG TiledCounter; /* WNDOBJ list */ LIST_ENTRY WndObjListHead; - FAST_MUTEX WndObjListLock; } WINDOW_OBJECT; /* PWINDOW_OBJECT already declared at top of file */ /* Window flags. */ _____ Modified: trunk/reactos/subsys/win32k/ntuser/window.c --- trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-06 11:00:27 UTC (rev 17695) +++ trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-06 13:36:04 UTC (rev 17696) @@ -1591,7 +1591,6 @@ InitializeListHead(&Window->PropListHead); InitializeListHead(&Window->WndObjListHead); - ExInitializeFastMutex(&Window->WndObjListLock); if (NULL != WindowName->Buffer) {
19 years, 3 months
1
0
0
0
[gdalsnes] 17695: naming changes:
by gdalsnes@svn.reactos.com
naming changes: -remove annying "Object" from variables. prepend handles with "h" instead. -rename window->Self -> Window->hSelf Modified: trunk/reactos/subsys/win32k/include/window.h Modified: trunk/reactos/subsys/win32k/ntuser/caret.c Modified: trunk/reactos/subsys/win32k/ntuser/class.c Modified: trunk/reactos/subsys/win32k/ntuser/focus.c Modified: trunk/reactos/subsys/win32k/ntuser/hotkey.c Modified: trunk/reactos/subsys/win32k/ntuser/menu.c Modified: trunk/reactos/subsys/win32k/ntuser/message.c Modified: trunk/reactos/subsys/win32k/ntuser/msgqueue.c Modified: trunk/reactos/subsys/win32k/ntuser/painting.c Modified: trunk/reactos/subsys/win32k/ntuser/scrollbar.c Modified: trunk/reactos/subsys/win32k/ntuser/windc.c Modified: trunk/reactos/subsys/win32k/ntuser/window.c Modified: trunk/reactos/subsys/win32k/ntuser/winpos.c _____ Modified: trunk/reactos/subsys/win32k/include/window.h --- trunk/reactos/subsys/win32k/include/window.h 2005-09-06 10:05:31 UTC (rev 17694) +++ trunk/reactos/subsys/win32k/include/window.h 2005-09-06 11:00:27 UTC (rev 17695) @@ -53,7 +53,7 @@ /* Position of the window's client area. */ RECT ClientRect; /* Handle for the window. */ - HANDLE Self; + HWND hSelf; /* Window flags. */ ULONG Flags; /* Window menu handle or window id */ _____ Modified: trunk/reactos/subsys/win32k/ntuser/caret.c --- trunk/reactos/subsys/win32k/ntuser/caret.c 2005-09-06 10:05:31 UTC (rev 17694) +++ trunk/reactos/subsys/win32k/ntuser/caret.c 2005-09-06 11:00:27 UTC (rev 17695) @@ -334,7 +334,7 @@ ThreadQueue = (PUSER_MESSAGE_QUEUE)PsGetWin32Thread()->MessageQueue; - if(ThreadQueue->CaretInfo->hWnd != WindowObject->Self) + if(ThreadQueue->CaretInfo->hWnd != WindowObject->hSelf) { SetLastWin32Error(ERROR_ACCESS_DENIED); return FALSE; @@ -342,7 +342,7 @@ if(ThreadQueue->CaretInfo->Visible) { - IntKillTimer(WindowObject->Self, IDCARETTIMER, TRUE); + IntKillTimer(WindowObject->hSelf, IDCARETTIMER, TRUE); co_IntHideCaret(ThreadQueue->CaretInfo); ThreadQueue->CaretInfo->Visible = 0; @@ -384,11 +384,11 @@ } -BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT WindowObject) +BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT Window) { PUSER_MESSAGE_QUEUE ThreadQueue; - if(WindowObject->OwnerThread != PsGetCurrentThread()) + if(Window->OwnerThread != PsGetCurrentThread()) { SetLastWin32Error(ERROR_ACCESS_DENIED); return FALSE; @@ -396,7 +396,7 @@ ThreadQueue = (PUSER_MESSAGE_QUEUE)PsGetWin32Thread()->MessageQueue; - if(ThreadQueue->CaretInfo->hWnd != WindowObject->Self) + if(ThreadQueue->CaretInfo->hWnd != Window->hSelf) { SetLastWin32Error(ERROR_ACCESS_DENIED); return FALSE; @@ -409,7 +409,7 @@ { co_IntSendMessage(ThreadQueue->CaretInfo->hWnd, WM_SYSTIMER, IDCARETTIMER, 0); } - IntSetTimer(WindowObject->Self, IDCARETTIMER, IntGetCaretBlinkTime(), NULL, TRUE); + IntSetTimer(Window->hSelf, IDCARETTIMER, IntGetCaretBlinkTime(), NULL, TRUE); } return TRUE; _____ Modified: trunk/reactos/subsys/win32k/ntuser/class.c --- trunk/reactos/subsys/win32k/ntuser/class.c 2005-09-06 10:05:31 UTC (rev 17694) +++ trunk/reactos/subsys/win32k/ntuser/class.c 2005-09-06 11:00:27 UTC (rev 17695) @@ -471,19 +471,19 @@ } ULONG FASTCALL -IntGetClassLong(struct _WINDOW_OBJECT *WindowObject, ULONG Offset, BOOL Ansi) +IntGetClassLong(struct _WINDOW_OBJECT *Window, ULONG Offset, BOOL Ansi) { LONG Ret; if ((int)Offset >= 0) { - DPRINT("GetClassLong(%x, %d)\n", WindowObject->Self, Offset); - if ((Offset + sizeof(LONG)) > WindowObject->Class->cbClsExtra) + DPRINT("GetClassLong(%x, %d)\n", Window->hSelf, Offset); + if ((Offset + sizeof(LONG)) > Window->Class->cbClsExtra) { SetLastWin32Error(ERROR_INVALID_PARAMETER); return 0; } - Ret = *((LONG *)(WindowObject->Class->ExtraData + Offset)); + Ret = *((LONG *)(Window->Class->ExtraData + Offset)); DPRINT("Result: %x\n", Ret); return Ret; } @@ -491,40 +491,40 @@ switch (Offset) { case GCL_CBWNDEXTRA: - Ret = WindowObject->Class->cbWndExtra; + Ret = Window->Class->cbWndExtra; break; case GCL_CBCLSEXTRA: - Ret = WindowObject->Class->cbClsExtra; + Ret = Window->Class->cbClsExtra; break; case GCL_HBRBACKGROUND: - Ret = (ULONG)WindowObject->Class->hbrBackground; + Ret = (ULONG)Window->Class->hbrBackground; break; case GCL_HCURSOR: - Ret = (ULONG)WindowObject->Class->hCursor; + Ret = (ULONG)Window->Class->hCursor; break; case GCL_HICON: - Ret = (ULONG)WindowObject->Class->hIcon; + Ret = (ULONG)Window->Class->hIcon; break; case GCL_HICONSM: - Ret = (ULONG)WindowObject->Class->hIconSm; + Ret = (ULONG)Window->Class->hIconSm; break; case GCL_HMODULE: - Ret = (ULONG)WindowObject->Class->hInstance; + Ret = (ULONG)Window->Class->hInstance; break; case GCL_MENUNAME: - Ret = (ULONG)WindowObject->Class->lpszMenuName.Buffer; + Ret = (ULONG)Window->Class->lpszMenuName.Buffer; break; case GCL_STYLE: - Ret = WindowObject->Class->style; + Ret = Window->Class->style; break; case GCL_WNDPROC: if (Ansi) { - Ret = (ULONG)WindowObject->Class->lpfnWndProcA; + Ret = (ULONG)Window->Class->lpfnWndProcA; } else { - Ret = (ULONG)WindowObject->Class->lpfnWndProcW; + Ret = (ULONG)Window->Class->lpfnWndProcW; } break; default: @@ -537,21 +537,21 @@ DWORD STDCALL NtUserGetClassLong(HWND hWnd, DWORD Offset, BOOL Ansi) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; LONG Ret; DECLARE_RETURN(DWORD); DPRINT("Enter NtUserGetClassLong\n"); UserEnterExclusive(); - WindowObject = IntGetWindowObject(hWnd); - if (WindowObject == NULL) + Window = IntGetWindowObject(hWnd); + if (Window == NULL) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN(0); } - Ret = IntGetClassLong(WindowObject, Offset, Ansi); - IntReleaseWindowObject(WindowObject); + Ret = IntGetClassLong(Window, Offset, Ansi); + IntReleaseWindowObject(Window); RETURN(Ret); CLEANUP: @@ -561,44 +561,44 @@ } void FASTCALL -co_IntSetClassLong(PWINDOW_OBJECT WindowObject, ULONG Offset, LONG dwNewLong, BOOL Ansi) +co_IntSetClassLong(PWINDOW_OBJECT Window, ULONG Offset, LONG dwNewLong, BOOL Ansi) { PWINDOW_OBJECT Parent, Owner; if ((int)Offset >= 0) { - DPRINT("SetClassLong(%x, %d, %x)\n", WindowObject->Self, Offset, dwNewLong); - if ((Offset + sizeof(LONG)) > WindowObject->Class->cbClsExtra) + DPRINT("SetClassLong(%x, %d, %x)\n", Window->hSelf, Offset, dwNewLong); + if ((Offset + sizeof(LONG)) > Window->Class->cbClsExtra) { SetLastWin32Error(ERROR_INVALID_PARAMETER); return; } - *((LONG *)(WindowObject->Class->ExtraData + Offset)) = dwNewLong; + *((LONG *)(Window->Class->ExtraData + Offset)) = dwNewLong; return; } switch (Offset) { case GCL_CBWNDEXTRA: - WindowObject->Class->cbWndExtra = dwNewLong; + Window->Class->cbWndExtra = dwNewLong; break; case GCL_CBCLSEXTRA: - WindowObject->Class->cbClsExtra = dwNewLong; + Window->Class->cbClsExtra = dwNewLong; break; case GCL_HBRBACKGROUND: - WindowObject->Class->hbrBackground = (HBRUSH)dwNewLong; + Window->Class->hbrBackground = (HBRUSH)dwNewLong; break; case GCL_HCURSOR: - WindowObject->Class->hCursor = (HCURSOR)dwNewLong; + Window->Class->hCursor = (HCURSOR)dwNewLong; break; case GCL_HICON: - WindowObject->Class->hIcon = (HICON)dwNewLong; - Owner = IntGetOwner(WindowObject); - Parent = IntGetParent(WindowObject); + Window->Class->hIcon = (HICON)dwNewLong; + Owner = IntGetOwner(Window); + Parent = IntGetParent(Window); if ((!Owner) && (!Parent)) { - co_IntShellHookNotify(HSHELL_REDRAW, (LPARAM) WindowObject->Self); + co_IntShellHookNotify(HSHELL_REDRAW, (LPARAM) Window->hSelf); } if (Parent) @@ -614,43 +614,43 @@ break; case GCL_HICONSM: - WindowObject->Class->hIconSm = (HICON)dwNewLong; + Window->Class->hIconSm = (HICON)dwNewLong; break; case GCL_HMODULE: - WindowObject->Class->hInstance = (HINSTANCE)dwNewLong; + Window->Class->hInstance = (HINSTANCE)dwNewLong; break; case GCL_MENUNAME: - if (WindowObject->Class->lpszMenuName.MaximumLength) - RtlFreeUnicodeString(&WindowObject->Class->lpszMenuName); + if (Window->Class->lpszMenuName.MaximumLength) + RtlFreeUnicodeString(&Window->Class->lpszMenuName); if (!IS_INTRESOURCE(dwNewLong)) { - WindowObject->Class->lpszMenuName.Length = - WindowObject->Class->lpszMenuName.MaximumLength = ((PUNICODE_STRING)dwNewLong)->MaximumLength; - WindowObject->Class->lpszMenuName.Buffer = ExAllocatePoolWithTag(PagedPool, WindowObject->Class->lpszMenuName.MaximumLength, TAG_STRING); - RtlCopyUnicodeString(&WindowObject->Class->lpszMenuName, (PUNICODE_STRING)dwNewLong); + Window->Class->lpszMenuName.Length = + Window->Class->lpszMenuName.MaximumLength = ((PUNICODE_STRING)dwNewLong)->MaximumLength; + Window->Class->lpszMenuName.Buffer = ExAllocatePoolWithTag(PagedPool, Window->Class->lpszMenuName.MaximumLength, TAG_STRING); + RtlCopyUnicodeString(&Window->Class->lpszMenuName, (PUNICODE_STRING)dwNewLong); } else { - WindowObject->Class->lpszMenuName.Length = - WindowObject->Class->lpszMenuName.MaximumLength = 0; - WindowObject->Class->lpszMenuName.Buffer = (LPWSTR)dwNewLong; + Window->Class->lpszMenuName.Length = + Window->Class->lpszMenuName.MaximumLength = 0; + Window->Class->lpszMenuName.Buffer = (LPWSTR)dwNewLong; } break; case GCL_STYLE: - WindowObject->Class->style = dwNewLong; + Window->Class->style = dwNewLong; break; case GCL_WNDPROC: if (Ansi) { - WindowObject->Class->lpfnWndProcA = (WNDPROC)dwNewLong; - WindowObject->Class->lpfnWndProcW = (WNDPROC) IntAddWndProcHandle((WNDPROC)dwNewLong,FALSE); - WindowObject->Class->Unicode = FALSE; + Window->Class->lpfnWndProcA = (WNDPROC)dwNewLong; + Window->Class->lpfnWndProcW = (WNDPROC) IntAddWndProcHandle((WNDPROC)dwNewLong,FALSE); + Window->Class->Unicode = FALSE; } else { - WindowObject->Class->lpfnWndProcW = (WNDPROC)dwNewLong; - WindowObject->Class->lpfnWndProcA = (WNDPROC) IntAddWndProcHandle((WNDPROC)dwNewLong,TRUE); - WindowObject->Class->Unicode = TRUE; + Window->Class->lpfnWndProcW = (WNDPROC)dwNewLong; + Window->Class->lpfnWndProcA = (WNDPROC) IntAddWndProcHandle((WNDPROC)dwNewLong,TRUE); + Window->Class->Unicode = TRUE; } break; } @@ -662,22 +662,21 @@ LONG dwNewLong, BOOL Ansi) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; LONG Ret; DECLARE_RETURN(DWORD); DPRINT("Enter NtUserSetClassLong\n"); UserEnterExclusive(); - WindowObject = IntGetWindowObject(hWnd); - if (WindowObject == NULL) + if (!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN(0); } - Ret = IntGetClassLong(WindowObject, Offset, Ansi); - co_IntSetClassLong(WindowObject, Offset, dwNewLong, Ansi); - IntReleaseWindowObject(WindowObject); + Ret = IntGetClassLong(Window, Offset, Ansi); + co_IntSetClassLong(Window, Offset, dwNewLong, Ansi); + IntReleaseWindowObject(Window); RETURN(Ret); CLEANUP: @@ -702,7 +701,7 @@ DWORD Unknown) { PWNDCLASS_OBJECT Class; - PWINSTATION_OBJECT WinStaObject; + PWINSTATION_OBJECT WinSta; DECLARE_RETURN(BOOL); DPRINT("Enter NtUserUnregisterClass(%S)\n", ClassNameOrAtom); @@ -714,7 +713,7 @@ RETURN( FALSE); } - WinStaObject = PsGetWin32Thread()->Desktop->WindowStation; + WinSta = PsGetWin32Thread()->Desktop->WindowStation; if (!ClassReferenceClassByNameOrAtom(&Class, ClassNameOrAtom, hInstance)) { @@ -742,7 +741,7 @@ RemoveEntryList(&Class->ListEntry); - RtlDeleteAtomFromAtomTable(WinStaObject->AtomTable, Class->Atom); + RtlDeleteAtomFromAtomTable(WinSta->AtomTable, Class->Atom); /* Free the object */ ClassDereferenceObject(Class); _____ Modified: trunk/reactos/subsys/win32k/ntuser/focus.c --- trunk/reactos/subsys/win32k/ntuser/focus.c 2005-09-06 10:05:31 UTC (rev 17694) +++ trunk/reactos/subsys/win32k/ntuser/focus.c 2005-09-06 11:00:27 UTC (rev 17695) @@ -135,7 +135,7 @@ if(OwnerWnd == Owner) { - Ret = Child->Self; + Ret = Child->hSelf; IntReleaseWindowObject(OwnerWnd); return Ret; } @@ -148,9 +148,9 @@ STATIC BOOL FASTCALL co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWindow, BOOL MouseActivate) { - HWND hWnd = Window->Self; + HWND hWnd = Window->hSelf; HWND hWndPrev = NULL; - HWND hWndFocus = FocusWindow->Self; + HWND hWndFocus = FocusWindow->hSelf; HWND hWndFocusPrev = NULL; PUSER_MESSAGE_QUEUE PrevForegroundQueue; @@ -243,8 +243,8 @@ return FALSE; } - Top = UserGetAncestor(Window->Self, GA_ROOT); - if (Top != Window->Self) + Top = UserGetAncestor(Window->hSelf, GA_ROOT); + if (Top != Window->hSelf) { TopWindow = IntGetWindowObject(Top); if (TopWindow == NULL) @@ -261,7 +261,7 @@ /* TMN: Check return valud from this function? */ co_IntSetForegroundAndFocusWindow(TopWindow, Window, TRUE); - if (Top != Window->Self) + if (Top != Window->hSelf) { IntReleaseWindowObject(TopWindow); } @@ -285,7 +285,7 @@ { return ThreadQueue ? 0 : ThreadQueue->ActiveWindow; } - hWnd = Window->Self; + hWnd = Window->hSelf; } hWndPrev = ThreadQueue->ActiveWindow; _____ Modified: trunk/reactos/subsys/win32k/ntuser/hotkey.c --- trunk/reactos/subsys/win32k/ntuser/hotkey.c 2005-09-06 10:05:31 UTC (rev 17694) +++ trunk/reactos/subsys/win32k/ntuser/hotkey.c 2005-09-06 11:00:27 UTC (rev 17695) @@ -128,7 +128,7 @@ HOT_KEY_ITEM, ListEntry); Entry = Entry->Flink; - if (HotKeyItem->hWnd == Window->Self) + if (HotKeyItem->hWnd == Window->hSelf) { RemoveEntryList (&HotKeyItem->ListEntry); ExFreePool (HotKeyItem); _____ Modified: trunk/reactos/subsys/win32k/ntuser/menu.c --- trunk/reactos/subsys/win32k/ntuser/menu.c 2005-09-06 10:05:31 UTC (rev 17694) +++ trunk/reactos/subsys/win32k/ntuser/menu.c 2005-09-06 11:00:27 UTC (rev 17695) @@ -1161,52 +1161,52 @@ } VOID FASTCALL -co_IntInitTracking(PWINDOW_OBJECT WindowObject, PMENU_OBJECT MenuObject, BOOL Popup, +co_IntInitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup, UINT Flags) { /* FIXME - hide caret */ if(!(Flags & TPM_NONOTIFY)) - co_IntSendMessage(WindowObject->Self, WM_SETCURSOR, (WPARAM)WindowObject->Self, HTCAPTION); + co_IntSendMessage(Window->hSelf, WM_SETCURSOR, (WPARAM)Window->hSelf, HTCAPTION); /* FIXME - send WM_SETCURSOR message */ if(!(Flags & TPM_NONOTIFY)) - co_IntSendMessage(WindowObject->Self, WM_INITMENU, (WPARAM)MenuObject->MenuInfo.Self, 0); + co_IntSendMessage(Window->hSelf, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0); } VOID FASTCALL -co_IntExitTracking(PWINDOW_OBJECT WindowObject, PMENU_OBJECT MenuObject, BOOL Popup, +co_IntExitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup, UINT Flags) { if(!(Flags & TPM_NONOTIFY)) - co_IntSendMessage(WindowObject->Self, WM_EXITMENULOOP, 0 /* FIXME */, 0); + co_IntSendMessage(Window->hSelf, WM_EXITMENULOOP, 0 /* FIXME */, 0); /* FIXME - Show caret again */ } INT FASTCALL -IntTrackMenu(PMENU_OBJECT MenuObject, PWINDOW_OBJECT WindowObject, INT x, INT y, +IntTrackMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window, INT x, INT y, RECT lprect) { return 0; } BOOL FASTCALL -co_IntTrackPopupMenu(PMENU_OBJECT MenuObject, PWINDOW_OBJECT WindowObject, +co_IntTrackPopupMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window, UINT Flags, POINT *Pos, UINT MenuPos, RECT *ExcludeRect) { - co_IntInitTracking(WindowObject, MenuObject, TRUE, Flags); + co_IntInitTracking(Window, Menu, TRUE, Flags); - co_IntExitTracking(WindowObject, MenuObject, TRUE, Flags); + co_IntExitTracking(Window, Menu, TRUE, Flags); return FALSE; } BOOL FASTCALL -IntSetMenuItemRect(PMENU_OBJECT MenuObject, UINT Item, BOOL fByPos, RECT *rcRect) +IntSetMenuItemRect(PMENU_OBJECT Menu, UINT Item, BOOL fByPos, RECT *rcRect) { PMENU_ITEM mi; - if(IntGetMenuItemByFlag(MenuObject, Item, (fByPos ? MF_BYPOSITION : MF_BYCOMMAND), + if(IntGetMenuItemByFlag(Menu, Item, (fByPos ? MF_BYPOSITION : MF_BYCOMMAND), &mi, NULL) > -1) { mi->Rect = *rcRect; _____ Modified: trunk/reactos/subsys/win32k/ntuser/message.c --- trunk/reactos/subsys/win32k/ntuser/message.c 2005-09-06 10:05:31 UTC (rev 17694) +++ trunk/reactos/subsys/win32k/ntuser/message.c 2005-09-06 11:00:27 UTC (rev 17695) @@ -513,7 +513,7 @@ return TRUE; } - Result = co_IntSendMessage(MsgWindow->Self, WM_MOUSEACTIVATE, (WPARAM)IntGetParent(MsgWindow), (LPARAM)MAKELONG(*HitTest, Msg->message)); + Result = co_IntSendMessage(MsgWindow->hSelf, WM_MOUSEACTIVATE, (WPARAM)IntGetParent(MsgWindow), (LPARAM)MAKELONG(*HitTest, Msg->message)); switch (Result) { case MA_NOACTIVATEANDEAT: @@ -544,10 +544,10 @@ } if(ThreadQueue == Window->MessageQueue && - ThreadQueue->CaptureWindow != Window->Self) + ThreadQueue->CaptureWindow != Window->hSelf) { /* only send WM_NCHITTEST messages if we're not capturing the window! */ - *HitTest = co_IntSendMessage(Window->Self, WM_NCHITTEST, 0, + *HitTest = co_IntSendMessage(Window->hSelf, WM_NCHITTEST, 0, MAKELONG(Msg->pt.x, Msg->pt.y)); if(*HitTest == (USHORT)HTTRANSPARENT) @@ -565,7 +565,7 @@ if(Wnd != Window) { /* post the message to the other window */ - Msg->hwnd = Wnd->Self; + Msg->hwnd = Wnd->hSelf; if(!(Wnd->Status & WINDOWSTATUS_DESTROYING)) { MsqPostMessage(Wnd->MessageQueue, Msg, FALSE, @@ -612,7 +612,7 @@ (((*HitTest) == HTCAPTION) || ((*HitTest) == HTSYSMENU))) { Msg->message = WM_CONTEXTMENU; - Msg->wParam = (WPARAM)Window->Self; + Msg->wParam = (WPARAM)Window->hSelf; } else { _____ Modified: trunk/reactos/subsys/win32k/ntuser/msgqueue.c --- trunk/reactos/subsys/win32k/ntuser/msgqueue.c 2005-09-06 10:05:31 UTC (rev 17694) +++ trunk/reactos/subsys/win32k/ntuser/msgqueue.c 2005-09-06 11:00:27 UTC (rev 17695) @@ -354,7 +354,7 @@ *ScreenPoint = Message->Msg.pt; - if((hWnd != NULL && Window->Self != hWnd) || + if((hWnd != NULL && Window->hSelf != hWnd) || ((FilterLow != 0 || FilterLow != 0) && (Msg < FilterLow || Msg > FilterHigh))) { /* Reject the message because it doesn't match the filter */ @@ -395,7 +395,7 @@ } /* FIXME - only assign if removing? */ - Message->Msg.hwnd = Window->Self; + Message->Msg.hwnd = Window->hSelf; Message->Msg.message = Msg; Message->Msg.lParam = MAKELONG(Message->Msg.pt.x, Message->Msg.pt.y); @@ -924,7 +924,7 @@ { PostedMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry); - if (PostedMessage->Msg.hwnd == Window->Self) + if (PostedMessage->Msg.hwnd == Window->hSelf) { RemoveEntryList(&PostedMessage->ListEntry); MsqDestroyMessage(PostedMessage); @@ -944,7 +944,7 @@ CurrentEntry = RemoveHeadList(&MessageQueue->SentMessagesListHead); SentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE, ListEntry); - if(SentMessage->Msg.hwnd == Window->Self) + if(SentMessage->Msg.hwnd == Window->hSelf) { DPRINT("Notify the sender and remove a message from the queue that had not been dispatched\n"); _____ Modified: trunk/reactos/subsys/win32k/ntuser/painting.c --- trunk/reactos/subsys/win32k/ntuser/painting.c 2005-09-06 10:05:31 UTC (rev 17694) +++ trunk/reactos/subsys/win32k/ntuser/painting.c 2005-09-06 11:00:27 UTC (rev 17695) @@ -81,7 +81,7 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags) { HDC hDC; - HWND hWnd = Window->Self; + HWND hWnd = Window->hSelf; HRGN TempRegion; if (Flags & (RDW_ERASENOW | RDW_UPDATENOW)) @@ -555,7 +555,7 @@ if (IntIsWindowDirty(Child) && IntWndBelongsToThread(Child, Thread)) { - hFoundWnd = Child->Self; + hFoundWnd = Child->hSelf; break; } } _____ Modified: trunk/reactos/subsys/win32k/ntuser/scrollbar.c --- trunk/reactos/subsys/win32k/ntuser/scrollbar.c 2005-09-06 10:05:31 UTC (rev 17694) +++ trunk/reactos/subsys/win32k/ntuser/scrollbar.c 2005-09-06 11:00:27 UTC (rev 17695) @@ -365,7 +365,7 @@ } else if ((nBar != SB_CTL) && bChangeParams) { - co_UserShowScrollBar(Window->Self, nBar, FALSE); + co_UserShowScrollBar(Window->hSelf, nBar, FALSE); return Info->nPos; } } @@ -374,7 +374,7 @@ /* new_flags = 0;*/ if ((nBar != SB_CTL) && bChangeParams) { - co_UserShowScrollBar(Window->Self, nBar, TRUE); + co_UserShowScrollBar(Window->hSelf, nBar, TRUE); } } @@ -452,13 +452,13 @@ Size = 3 * (sizeof(WINDOW_SCROLLINFO)); if(!(Window->Scroll = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO))) { - DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window->Self); + DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window->hSelf); return FALSE; } RtlZeroMemory(Window->Scroll, Size); - Result = co_WinPosGetNonClientSize(Window->Self, + Result = co_WinPosGetNonClientSize(Window->hSelf, &Window->WindowRect, &Window->ClientRect); _____ Modified: trunk/reactos/subsys/win32k/ntuser/windc.c --- trunk/reactos/subsys/win32k/ntuser/windc.c 2005-09-06 10:05:31 UTC (rev 17694) +++ trunk/reactos/subsys/win32k/ntuser/windc.c 2005-09-06 11:00:27 UTC (rev 17695) @@ -294,7 +294,7 @@ { DcxFlags = Flags & ~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW); } - hRgnVisible = DceGetVisRgn(Parent->Self, DcxFlags, Window->Self, Flags); + hRgnVisible = DceGetVisRgn(Parent->hSelf, DcxFlags, Window->hSelf, Flags); if (hRgnVisible == NULL) { hRgnVisible = NtGdiCreateRectRgn(0, 0, 0, 0); @@ -332,7 +332,7 @@ } else { - hRgnVisible = DceGetVisRgn(Window->Self, Flags, 0, 0); + hRgnVisible = DceGetVisRgn(Window->hSelf, Flags, 0, 0); } noparent: @@ -471,7 +471,7 @@ { DceEmpty = Dce; } - else if (Dce->hwndCurrent == (Window ? Window->Self : NULL) && + else if (Dce->hwndCurrent == (Window ? Window->hSelf : NULL) && ((Dce->DCXFlags & DCX_CACHECOMPAREMASK) == DcxFlags)) { #if 0 /* FIXME */ @@ -498,7 +498,7 @@ else { Dce = Window->Dce; - if (NULL != Dce && Dce->hwndCurrent == (Window ? Window->Self : NULL)) + if (NULL != Dce && Dce->hwndCurrent == (Window ? Window->hSelf : NULL)) { UpdateVisRgn = FALSE; /* updated automatically, via DCHook() */ } @@ -512,7 +512,7 @@ return(NULL); } - Dce->hwndCurrent = (Window ? Window->Self : NULL); + Dce->hwndCurrent = (Window ? Window->hSelf : NULL); Dce->DCXFlags = DcxFlags | (Flags & DCX_WINDOWPAINT) | DCX_DCEBUSY; if (0 == (Flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && NULL != ClipRegion) @@ -781,7 +781,7 @@ pDCE = FirstDce; while (pDCE) { - if (pDCE->hwndCurrent == Window->Self) + if (pDCE->hwndCurrent == Window->hSelf) { if (pDCE == Window->Dce) /* owned or Class DCE*/ { @@ -808,7 +808,7 @@ * We should change this to DPRINT when ReactOS is more stable * (for 1.0?). */ - DPRINT1("[%p] GetDC() without ReleaseDC()!\n", Window->Self); + DPRINT1("[%p] GetDC() without ReleaseDC()!\n", Window->hSelf); DceReleaseDC(pDCE); } @@ -854,7 +854,7 @@ { if (0 == (pDCE->DCXFlags & DCX_DCEEMPTY)) { - if (Window->Self == pDCE->hwndCurrent) + if (Window->hSelf == pDCE->hwndCurrent) { CurrentWindow = Window; } @@ -871,14 +871,14 @@ dc = DC_LockDc(pDCE->hDC); if (dc == NULL) { - if (Window->Self != pDCE->hwndCurrent) + if (Window->hSelf != pDCE->hwndCurrent) { IntReleaseWindowObject(CurrentWindow); } pDCE = pDCE->next; continue; } - if (Window == CurrentWindow || IntIsChildWindow(Window->Self, CurrentWindow->Self)) + if (Window == CurrentWindow || IntIsChildWindow(Window->hSelf, CurrentWindow->hSelf)) { if (pDCE->DCXFlags & DCX_WINDOW) { @@ -907,7 +907,7 @@ DceUpdateVisRgn(pDCE, CurrentWindow, pDCE->DCXFlags); - if (Window->Self != pDCE->hwndCurrent) + if (Window->hSelf != pDCE->hwndCurrent) { // IntEngWindowChanged(CurrentWindow, WOC_RGN_CLIENT); IntReleaseWindowObject(CurrentWindow); _____ Modified: trunk/reactos/subsys/win32k/ntuser/window.c --- trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-06 10:05:31 UTC (rev 17694) +++ trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-06 11:00:27 UTC (rev 17695) @@ -124,16 +124,16 @@ PWINDOW_OBJECT FASTCALL IntGetProcessWindowObject(PW32THREAD Thread, HWND hWnd) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; NTSTATUS Status; if(Thread->Desktop != NULL) { Status = ObmReferenceObjectByHandle(gHandleTable, - hWnd, otWindow, (PVOID*)&WindowObject); + hWnd, otWindow, (PVOID*)&Window); if (NT_SUCCESS(Status)) { - return WindowObject; + return Window; } } return NULL; @@ -208,7 +208,7 @@ for (Child = Window->FirstChild, Index = 0; Child != NULL; Child = Child->NextSibling, ++Index) - List[Index] = Child->Self; + List[Index] = Child->hSelf; List[Index] = NULL; return List; @@ -317,12 +317,12 @@ BelongsToThreadData = IntWndBelongsToThread(Window, ThreadData); - IntDeRegisterShellHookWindow(Window->Self); + IntDeRegisterShellHookWindow(Window->hSelf); if(SendMessages) { /* Send destroy messages */ - IntSendDestroyMsg(Window->Self); + IntSendDestroyMsg(Window->hSelf); } /* free child windows */ @@ -336,7 +336,7 @@ if(!IntWndBelongsToThread(Child, ThreadData)) { /* send WM_DESTROY messages to windows not belonging to the same thread */ - IntSendDestroyMsg(Child->Self); + IntSendDestroyMsg(Child->hSelf); } else co_IntDestroyWindow(Child, ProcessData, ThreadData, SendMessages); @@ -356,9 +356,9 @@ RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_NOCHILDREN); if(BelongsToThreadData) - co_IntSendMessage(Window->Self, WM_NCDESTROY, 0, 0); + co_IntSendMessage(Window->hSelf, WM_NCDESTROY, 0, 0); } - MsqRemoveTimersWindow(ThreadData->MessageQueue, Window->Self); + MsqRemoveTimersWindow(ThreadData->MessageQueue, Window->hSelf); /* flush the message queue */ MsqRemoveWindowMessagesFromQueue(Window); @@ -370,10 +370,10 @@ /* reset shell window handles */ if(ThreadData->Desktop) { - if (Window->Self == ThreadData->Desktop->WindowStation->ShellWindow) + if (Window->hSelf == ThreadData->Desktop->WindowStation->ShellWindow) ThreadData->Desktop->WindowStation->ShellWindow = NULL; - if (Window->Self == ThreadData->Desktop->WindowStation->ShellListView) + if (Window->hSelf == ThreadData->Desktop->WindowStation->ShellListView) ThreadData->Desktop->WindowStation->ShellListView = NULL; } @@ -383,14 +383,14 @@ /* FIXME: do we need to fake QS_MOUSEMOVE wakebit? */ #if 0 /* FIXME */ - WinPosCheckInternalPos(Window->Self); - if (Window->Self == GetCapture()) + WinPosCheckInternalPos(Window->hSelf); + if (Window->hSelf == GetCapture()) { ReleaseCapture(); } /* free resources associated with the window */ - TIMER_RemoveWindowTimers(Window->Self); + TIMER_RemoveWindowTimers(Window->hSelf); #endif if (!(Window->Style & WS_CHILD) && Window->IDMenu @@ -418,7 +418,7 @@ IntUnlinkWindow(Window); IntReferenceWindowObject(Window); - ObmCloseHandle(gHandleTable, Window->Self); + ObmCloseHandle(gHandleTable, Window->hSelf); IntDestroyScrollBars(Window); @@ -442,21 +442,21 @@ } VOID FASTCALL -IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject, UINT *cx, UINT *cy) +IntGetWindowBorderMeasures(PWINDOW_OBJECT Window, UINT *cx, UINT *cy) { - if(HAS_DLGFRAME(WindowObject->Style, WindowObject->ExStyle) && !(WindowObject->Style & WS_MINIMIZE)) + if(HAS_DLGFRAME(Window->Style, Window->ExStyle) && !(Window->Style & WS_MINIMIZE)) { *cx = UserGetSystemMetrics(SM_CXDLGFRAME); *cy = UserGetSystemMetrics(SM_CYDLGFRAME); } else { - if(HAS_THICKFRAME(WindowObject->Style, WindowObject->ExStyle)&& !(WindowObject->Style & WS_MINIMIZE)) + if(HAS_THICKFRAME(Window->Style, Window->ExStyle)&& !(Window->Style & WS_MINIMIZE)) { *cx = UserGetSystemMetrics(SM_CXFRAME); *cy = UserGetSystemMetrics(SM_CYFRAME); } - else if(HAS_THINFRAME(WindowObject->Style, WindowObject->ExStyle)) + else if(HAS_THINFRAME(Window->Style, Window->ExStyle)) { *cx = UserGetSystemMetrics(SM_CXBORDER); *cy = UserGetSystemMetrics(SM_CYBORDER); @@ -469,68 +469,68 @@ } BOOL FASTCALL -IntGetWindowInfo(PWINDOW_OBJECT WindowObject, PWINDOWINFO pwi) +IntGetWindowInfo(PWINDOW_OBJECT Window, PWINDOWINFO pwi) { pwi->cbSize = sizeof(WINDOWINFO); - pwi->rcWindow = WindowObject->WindowRect; - pwi->rcClient = WindowObject->ClientRect; - pwi->dwStyle = WindowObject->Style; - pwi->dwExStyle = WindowObject->ExStyle; - pwi->dwWindowStatus = (UserGetForegroundWindow() == WindowObject->Self); /* WS_ACTIVECAPTION */ - IntGetWindowBorderMeasures(WindowObject, &pwi->cxWindowBorders, &pwi->cyWindowBorders); - pwi->atomWindowType = (WindowObject->Class ? WindowObject->Class->Atom : 0); + pwi->rcWindow = Window->WindowRect; + pwi->rcClient = Window->ClientRect; + pwi->dwStyle = Window->Style; + pwi->dwExStyle = Window->ExStyle; + pwi->dwWindowStatus = (UserGetForegroundWindow() == Window->hSelf); /* WS_ACTIVECAPTION */ + IntGetWindowBorderMeasures(Window, &pwi->cxWindowBorders, &pwi->cyWindowBorders); + pwi->atomWindowType = (Window->Class ? Window->Class->Atom : 0); pwi->wCreatorVersion = 0x400; /* FIXME - return a real version number */ return TRUE; } static BOOL FASTCALL IntSetMenu( - PWINDOW_OBJECT WindowObject, + PWINDOW_OBJECT Window, HMENU Menu, BOOL *Changed) { - PMENU_OBJECT OldMenuObject, NewMenuObject = NULL; + PMENU_OBJECT OldMenu, NewMenu = NULL; - if ((WindowObject->Style & (WS_CHILD | WS_POPUP)) == WS_CHILD) + if ((Window->Style & (WS_CHILD | WS_POPUP)) == WS_CHILD) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); return FALSE; } - *Changed = (WindowObject->IDMenu != (UINT) Menu); + *Changed = (Window->IDMenu != (UINT) Menu); if (! *Changed) { return TRUE; } - if (WindowObject->IDMenu) + if (Window->IDMenu) { - OldMenuObject = IntGetMenuObject((HMENU) WindowObject->IDMenu); - ASSERT(NULL == OldMenuObject || OldMenuObject->MenuInfo.Wnd == WindowObject->Self); + OldMenu = IntGetMenuObject((HMENU) Window->IDMenu); + ASSERT(NULL == OldMenu || OldMenu->MenuInfo.Wnd == Window->hSelf); } else { - OldMenuObject = NULL; + OldMenu = NULL; } if (NULL != Menu) { - NewMenuObject = IntGetMenuObject(Menu); - if (NULL == NewMenuObject) + NewMenu = IntGetMenuObject(Menu); + if (NULL == NewMenu) { - if (NULL != OldMenuObject) + if (NULL != OldMenu) { - IntReleaseMenuObject(OldMenuObject); + IntReleaseMenuObject(OldMenu); } SetLastWin32Error(ERROR_INVALID_MENU_HANDLE); return FALSE; } - if (NULL != NewMenuObject->MenuInfo.Wnd) + if (NULL != NewMenu->MenuInfo.Wnd) { /* Can't use the same menu for two windows */ - if (NULL != OldMenuObject) + if (NULL != OldMenu) { - IntReleaseMenuObject(OldMenuObject); + IntReleaseMenuObject(OldMenu); } SetLastWin32Error(ERROR_INVALID_MENU_HANDLE); return FALSE; @@ -538,16 +538,16 @@ } - WindowObject->IDMenu = (UINT) Menu; - if (NULL != NewMenuObject) + Window->IDMenu = (UINT) Menu; + if (NULL != NewMenu) { - NewMenuObject->MenuInfo.Wnd = WindowObject->Self; - IntReleaseMenuObject(NewMenuObject); + NewMenu->MenuInfo.Wnd = Window->hSelf; + IntReleaseMenuObject(NewMenu); } - if (NULL != OldMenuObject) + if (NULL != OldMenu) { - OldMenuObject->MenuInfo.Wnd = NULL; - IntReleaseMenuObject(OldMenuObject); + OldMenu->MenuInfo.Wnd = NULL; + IntReleaseMenuObject(OldMenu); } return TRUE; @@ -614,14 +614,14 @@ * \note Does not check the validity of the parameters */ VOID FASTCALL -IntGetClientRect(PWINDOW_OBJECT WindowObject, PRECT Rect) +IntGetClientRect(PWINDOW_OBJECT Window, PRECT Rect) { - ASSERT( WindowObject ); + ASSERT( Window ); ASSERT( Rect ); Rect->left = Rect->top = 0; - Rect->right = WindowObject->ClientRect.right - WindowObject->ClientRect.left; - Rect->bottom = WindowObject->ClientRect.bottom - WindowObject->ClientRect.top; + Rect->right = Window->ClientRect.right - Window->ClientRect.left; + Rect->bottom = Window->ClientRect.bottom - Window->ClientRect.top; } @@ -645,11 +645,11 @@ [truncated at 1000 lines; 2256 more skipped]
19 years, 3 months
1
0
0
0
[gdalsnes] 17694: make handle table session global
by gdalsnes@svn.reactos.com
make handle table session global Modified: trunk/reactos/subsys/win32k/include/userfuncs.h Modified: trunk/reactos/subsys/win32k/include/winsta.h Modified: trunk/reactos/subsys/win32k/ntuser/accelerator.c Modified: trunk/reactos/subsys/win32k/ntuser/cursoricon.c Modified: trunk/reactos/subsys/win32k/ntuser/hook.c Modified: trunk/reactos/subsys/win32k/ntuser/input.c Modified: trunk/reactos/subsys/win32k/ntuser/menu.c Modified: trunk/reactos/subsys/win32k/ntuser/monitor.c Modified: trunk/reactos/subsys/win32k/ntuser/msgqueue.c Modified: trunk/reactos/subsys/win32k/ntuser/ntuser.c Modified: trunk/reactos/subsys/win32k/ntuser/object.c Modified: trunk/reactos/subsys/win32k/ntuser/window.c Modified: trunk/reactos/subsys/win32k/ntuser/winpos.c Modified: trunk/reactos/subsys/win32k/ntuser/winsta.c _____ Modified: trunk/reactos/subsys/win32k/include/userfuncs.h --- trunk/reactos/subsys/win32k/include/userfuncs.h 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/include/userfuncs.h 2005-09-06 10:05:31 UTC (rev 17694) @@ -1,6 +1,10 @@ #ifndef _WIN32K_USERFUNCS_H #define _WIN32K_USERFUNCS_H + +extern PUSER_HANDLE_TABLE gHandleTable; + + /*************** WINSTA.C ***************/ HWINSTA FASTCALL UserGetProcessWindowStation(VOID); _____ Modified: trunk/reactos/subsys/win32k/include/winsta.h --- trunk/reactos/subsys/win32k/include/winsta.h 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/include/winsta.h 2005-09-06 10:05:31 UTC (rev 17694) @@ -27,7 +27,6 @@ UNICODE_STRING Name; LIST_ENTRY DesktopListHead; PRTL_ATOM_TABLE AtomTable; - PVOID HandleTable; HANDLE SystemMenuTemplate; PVOID SystemCursor; UINT CaretBlinkRate; _____ Modified: trunk/reactos/subsys/win32k/ntuser/accelerator.c --- trunk/reactos/subsys/win32k/ntuser/accelerator.c 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/ntuser/accelerator.c 2005-09-06 10:05:31 UTC (rev 17694) @@ -94,10 +94,11 @@ RETURN(0); } - Status = ObmReferenceObjectByHandle(WindowStation->HandleTable, + Status = ObmReferenceObjectByHandle(gHandleTable, Table, otAcceleratorTable, (PVOID*)&AcceleratorTable); + if (!NT_SUCCESS(Status)) { SetLastWin32Error(ERROR_INVALID_ACCEL_HANDLE); @@ -161,7 +162,7 @@ } AcceleratorTable = ObmCreateObject( - WindowStation->HandleTable, + gHandleTable, (PHANDLE)&Handle, otAcceleratorTable, sizeof(ACCELERATOR_TABLE)); @@ -179,7 +180,7 @@ AcceleratorTable->Table = ExAllocatePoolWithTag(PagedPool, EntriesCount * sizeof(ACCEL), TAG_ACCEL); if (AcceleratorTable->Table == NULL) { - ObmCloseHandle(WindowStation->HandleTable, Handle); + ObmCloseHandle(gHandleTable, Handle); ObDereferenceObject(WindowStation); SetLastNtError(Status); DPRINT1("E3\n"); @@ -190,7 +191,7 @@ if (!NT_SUCCESS(Status)) { ExFreePool(AcceleratorTable->Table); - ObmCloseHandle(WindowStation->HandleTable, Handle); + ObmCloseHandle(gHandleTable, Handle); ObDereferenceObject(WindowStation); SetLastNtError(Status); DPRINT1("E4\n"); @@ -240,7 +241,7 @@ RETURN( FALSE); } - Status = ObmReferenceObjectByHandle(WindowStation->HandleTable, + Status = ObmReferenceObjectByHandle(gHandleTable, Table, otAcceleratorTable, (PVOID*)&AcceleratorTable); @@ -252,7 +253,7 @@ RETURN( FALSE); } - ObmCloseHandle(WindowStation->HandleTable, Table); + ObmCloseHandle(gHandleTable, Table); if (AcceleratorTable->Table != NULL) { @@ -503,7 +504,7 @@ RETURN( 0); } - Status = ObmReferenceObjectByHandle(WindowStation->HandleTable, + Status = ObmReferenceObjectByHandle(gHandleTable, Table, otAcceleratorTable, (PVOID*)&AcceleratorTable); _____ Modified: trunk/reactos/subsys/win32k/ntuser/cursoricon.c --- trunk/reactos/subsys/win32k/ntuser/cursoricon.c 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/ntuser/cursoricon.c 2005-09-06 10:05:31 UTC (rev 17694) @@ -77,7 +77,7 @@ PCURICON_OBJECT Object; NTSTATUS Status; - Status = ObmReferenceObjectByHandle(WinStaObject->HandleTable, + Status = ObmReferenceObjectByHandle(gHandleTable, Handle, otCursorIcon, (PVOID*)&Object); if (!NT_SUCCESS(Status)) { @@ -391,7 +391,7 @@ PCURICON_OBJECT Object; HANDLE Handle; - Object = ObmCreateObject(WinStaObject->HandleTable, &Handle, otCursorIcon, sizeof(CURICON_OBJECT)); + Object = ObmCreateObject(gHandleTable, &Handle, otCursorIcon, sizeof(CURICON_OBJECT)); if(!Object) { @@ -405,7 +405,7 @@ if (! ReferenceCurIconByProcess(Object)) { DPRINT1("Failed to add process\n"); - ObmCloseHandle(WinStaObject->HandleTable, Handle); + ObmCloseHandle(gHandleTable, Handle); ObmDereferenceObject(Object); return NULL; } @@ -483,7 +483,7 @@ bmpMask = Object->IconInfo.hbmMask; bmpColor = Object->IconInfo.hbmColor; - Ret = NT_SUCCESS(ObmCloseHandle(WinStaObject->HandleTable, Object->Self)); + Ret = NT_SUCCESS(ObmCloseHandle(gHandleTable, Object->Self)); /* delete bitmaps */ if(bmpMask) @@ -941,7 +941,7 @@ RETURN( FALSE); } - Status = ObmReferenceObjectByHandle(WinStaObject->HandleTable, Handle, otCursorIcon, (PVOID*)&Object); + Status = ObmReferenceObjectByHandle(gHandleTable, Handle, otCursorIcon, (PVOID*)&Object); if(!NT_SUCCESS(Status)) { ObDereferenceObject(WinStaObject); _____ Modified: trunk/reactos/subsys/win32k/ntuser/hook.c --- trunk/reactos/subsys/win32k/ntuser/hook.c 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/ntuser/hook.c 2005-09-06 10:05:31 UTC (rev 17694) @@ -83,7 +83,7 @@ } } - Hook = ObmCreateObject(WinStaObj->HandleTable, &Handle, + Hook = ObmCreateObject(gHandleTable, &Handle, otHookProc, sizeof(HOOK)); if (NULL == Hook) { @@ -180,7 +180,7 @@ } /* Close handle */ - ObmCloseHandle(WinStaObj->HandleTable, Hook->Self); + ObmCloseHandle(gHandleTable, Hook->Self); } /* remove a hook, freeing it if the chain is not in use */ @@ -399,7 +399,7 @@ RETURN( FALSE); } - Status = ObmReferenceObjectByHandle(WinStaObj->HandleTable, Hook, + Status = ObmReferenceObjectByHandle(gHandleTable, Hook, otHookProc, (PVOID *) &HookObj); ObDereferenceObject(WinStaObj); if (! NT_SUCCESS(Status)) @@ -687,7 +687,7 @@ RETURN( FALSE); } - Status = ObmReferenceObjectByHandle(WinStaObj->HandleTable, Hook, + Status = ObmReferenceObjectByHandle(gHandleTable, Hook, otHookProc, (PVOID *) &HookObj); if (! NT_SUCCESS(Status)) { _____ Modified: trunk/reactos/subsys/win32k/ntuser/input.c --- trunk/reactos/subsys/win32k/ntuser/input.c 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/ntuser/input.c 2005-09-06 10:05:31 UTC (rev 17694) @@ -378,7 +378,7 @@ MSG Mesg; NTSTATUS Status; - Status = ObmReferenceObjectByHandle(InputWindowStation->HandleTable, + Status = ObmReferenceObjectByHandle(gHandleTable, InputWindowStation->ShellWindow, otWindow, (PVOID *)&Window); @@ -947,7 +947,7 @@ MousePos.y += mi->dy; } - Status = ObmReferenceObjectByHandle(WinSta->HandleTable, + Status = ObmReferenceObjectByHandle(gHandleTable, WinSta->ActiveDesktop->DesktopWindow, otWindow, (PVOID*)&DesktopWindow); if (NT_SUCCESS(Status)) { _____ Modified: trunk/reactos/subsys/win32k/ntuser/menu.c --- trunk/reactos/subsys/win32k/ntuser/menu.c 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/ntuser/menu.c 2005-09-06 10:05:31 UTC (rev 17694) @@ -142,7 +142,7 @@ return NULL; } - NTSTATUS Status = ObmReferenceObjectByHandle(W32Thread->Desktop->WindowStation->HandleTabl e, + NTSTATUS Status = ObmReferenceObjectByHandle(gHandleTable, hMenu, otMenu, (PVOID*)&MenuObject); if (!NT_SUCCESS(Status)) { @@ -243,7 +243,7 @@ NULL); if(NT_SUCCESS(Status)) { - ObmCloseHandle(WindowStation->HandleTable, MenuObject->MenuInfo.Self); + ObmCloseHandle(gHandleTable, MenuObject->MenuInfo.Self); ObDereferenceObject(WindowStation); return TRUE; } @@ -255,10 +255,9 @@ IntCreateMenu(PHANDLE Handle, BOOL IsMenuBar) { PMENU_OBJECT MenuObject; - PW32THREAD Win32Thread = PsGetWin32Thread(); MenuObject = (PMENU_OBJECT)ObmCreateObject( - Win32Thread->Desktop->WindowStation->HandleTable, Handle, + gHandleTable, Handle, otMenu, sizeof(MENU_OBJECT)); if(!MenuObject) @@ -367,7 +366,7 @@ return NULL; MenuObject = (PMENU_OBJECT)ObmCreateObject( - PsGetWin32Thread()->Desktop->WindowStation->HandleTable, &Handle, + gHandleTable, &Handle, otMenu, sizeof(MENU_OBJECT)); if(!MenuObject) return NULL; _____ Modified: trunk/reactos/subsys/win32k/ntuser/monitor.c --- trunk/reactos/subsys/win32k/ntuser/monitor.c 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/ntuser/monitor.c 2005-09-06 10:05:31 UTC (rev 17694) @@ -91,7 +91,7 @@ HANDLE Handle; PMONITOR_OBJECT Monitor; - Monitor = ObmCreateObject(PsGetWin32Thread()->Desktop->WindowStation->HandleTable, &Handle, otMonitor, sizeof (MONITOR_OBJECT)); + Monitor = ObmCreateObject(gHandleTable, &Handle, otMonitor, sizeof (MONITOR_OBJECT)); if (Monitor == NULL) { return NULL; @@ -141,7 +141,7 @@ PMONITOR_OBJECT Monitor; NTSTATUS Status; - Status = ObmReferenceObjectByHandle(PsGetWin32Thread()->Desktop->WindowStation->H andleTable, hMonitor, otMonitor, (PVOID *)&Monitor); + Status = ObmReferenceObjectByHandle(gHandleTable, hMonitor, otMonitor, (PVOID *)&Monitor); if (!NT_SUCCESS(Status) || Monitor == NULL) { /* FIXME: SetLastNtError( status ); ? */ _____ Modified: trunk/reactos/subsys/win32k/ntuser/msgqueue.c --- trunk/reactos/subsys/win32k/ntuser/msgqueue.c 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/ntuser/msgqueue.c 2005-09-06 10:05:31 UTC (rev 17694) @@ -733,7 +733,7 @@ } WinSta = Win32Thread->Desktop->WindowStation; - Status = ObmReferenceObjectByHandle(WinSta->HandleTable, + Status = ObmReferenceObjectByHandle(gHandleTable, hWnd, otWindow, (PVOID*)&Window); if (!NT_SUCCESS(Status)) { _____ Modified: trunk/reactos/subsys/win32k/ntuser/ntuser.c --- trunk/reactos/subsys/win32k/ntuser/ntuser.c 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/ntuser/ntuser.c 2005-09-06 10:05:31 UTC (rev 17694) @@ -49,6 +49,15 @@ // DPRINT("Enter InitUserImpl\n"); // ExInitializeResourceLite(&UserLock); + + + gHandleTable = ObmCreateHandleTable(); + if (!gHandleTable) + { + DPRINT("Failed creating handle table\n"); + return STATUS_INSUFFICIENT_RESOURCES; + } + ExInitializeFastMutex(&UserLock); return STATUS_SUCCESS; _____ Modified: trunk/reactos/subsys/win32k/ntuser/object.c --- trunk/reactos/subsys/win32k/ntuser/object.c 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/ntuser/object.c 2005-09-06 10:05:31 UTC (rev 17694) @@ -40,6 +40,9 @@ #define USER_BODY_TO_HEADER(ObjectBody) \ ((PUSER_OBJECT_HEADER)(((PUSER_OBJECT_HEADER)ObjectBody) - 1)) + +PUSER_HANDLE_TABLE gHandleTable = NULL; + /* FUNCTIONS *****************************************************************/ VOID FASTCALL _____ Modified: trunk/reactos/subsys/win32k/ntuser/window.c --- trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-06 10:05:31 UTC (rev 17694) @@ -129,7 +129,7 @@ if(Thread->Desktop != NULL) { - Status = ObmReferenceObjectByHandle(Thread->Desktop->WindowStation->HandleTable, + Status = ObmReferenceObjectByHandle(gHandleTable, hWnd, otWindow, (PVOID*)&WindowObject); if (NT_SUCCESS(Status)) { @@ -418,7 +418,7 @@ IntUnlinkWindow(Window); IntReferenceWindowObject(Window); - ObmCloseHandle(ThreadData->Desktop->WindowStation->HandleTable, Window->Self); + ObmCloseHandle(gHandleTable, Window->Self); IntDestroyScrollBars(Window); @@ -1498,7 +1498,7 @@ /* Create the window object. */ WindowObject = (PWINDOW_OBJECT) - ObmCreateObject(PsGetWin32Thread()->Desktop->WindowStation->HandleTable, &Handle, + ObmCreateObject(gHandleTable, &Handle, otWindow, sizeof(WINDOW_OBJECT) + ClassObject->cbWndExtra ); _____ Modified: trunk/reactos/subsys/win32k/ntuser/winpos.c --- trunk/reactos/subsys/win32k/ntuser/winpos.c 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/ntuser/winpos.c 2005-09-06 10:05:31 UTC (rev 17694) @@ -1256,7 +1256,7 @@ // HRGN VisibleRgn; Status = - ObmReferenceObjectByHandle(PsGetWin32Thread()->Desktop->WindowStation->H andleTable, + ObmReferenceObjectByHandle(gHandleTable, Wnd, otWindow, (PVOID*)&Window); _____ Modified: trunk/reactos/subsys/win32k/ntuser/winsta.c --- trunk/reactos/subsys/win32k/ntuser/winsta.c 2005-09-06 09:35:39 UTC (rev 17693) +++ trunk/reactos/subsys/win32k/ntuser/winsta.c 2005-09-06 10:05:31 UTC (rev 17694) @@ -535,18 +535,6 @@ return 0; } - WindowStationObject->HandleTable = ObmCreateHandleTable(); - if (!WindowStationObject->HandleTable) - { - DPRINT("Failed creating handle table\n"); - ExFreePool(CurInfo); - ExFreePool(WindowStationName.Buffer); - /* FIXME - Delete window station object */ - ObDereferenceObject(WindowStationObject); - SetLastNtError(STATUS_INSUFFICIENT_RESOURCES); - return 0; - } - InitHotKeys(WindowStationObject); CurInfo->Enabled = FALSE;
19 years, 3 months
1
0
0
0
[gdalsnes] 17693: move object.c and ssec.c into ntuser where they belong
by gdalsnes@svn.reactos.com
move object.c and ssec.c into ntuser where they belong Modified: trunk/reactos/subsys/win32k/include/userfuncs.h Deleted: trunk/reactos/subsys/win32k/misc/object.c Deleted: trunk/reactos/subsys/win32k/misc/ssec.c Added: trunk/reactos/subsys/win32k/ntuser/object.c Added: trunk/reactos/subsys/win32k/ntuser/ssec.c Modified: trunk/reactos/subsys/win32k/ntuser/window.c Modified: trunk/reactos/subsys/win32k/win32k.xml _____ Modified: trunk/reactos/subsys/win32k/include/userfuncs.h --- trunk/reactos/subsys/win32k/include/userfuncs.h 2005-09-06 07:58:43 UTC (rev 17692) +++ trunk/reactos/subsys/win32k/include/userfuncs.h 2005-09-06 09:35:39 UTC (rev 17693) @@ -74,6 +74,8 @@ /*************** WINDOW.C ***************/ +PWINDOW_OBJECT FASTCALL UserGetWindowObjectNoRef(HWND hWnd); + VOID FASTCALL co_DestroyThreadWindows(struct _ETHREAD *Thread); _____ Deleted: trunk/reactos/subsys/win32k/misc/object.c --- trunk/reactos/subsys/win32k/misc/object.c 2005-09-06 07:58:43 UTC (rev 17692) +++ trunk/reactos/subsys/win32k/misc/object.c 2005-09-06 09:35:39 UTC (rev 17693) @@ -1,507 +0,0 @@ -/* - * ReactOS W32 Subsystem - * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* $Id$ - * - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: User object manager - * FILE: subsys/win32k/misc/object.c - * PROGRAMMERS: David Welch (welch(a)cwcom.net) - * Casper S. Hornstrup (chorns(a)users.sourceforge.net) - * UPDATE HISTORY: - * 06-06-2001 CSH Ported kernel object manager - */ -/* INCLUDES ******************************************************************/ - -#include <w32k.h> - -#define NDEBUG -#include <debug.h> - -#define USER_HEADER_TO_BODY(ObjectHeader) \ - ((PVOID)(((PUSER_OBJECT_HEADER)ObjectHeader) + 1)) - -#define USER_BODY_TO_HEADER(ObjectBody) \ - ((PUSER_OBJECT_HEADER)(((PUSER_OBJECT_HEADER)ObjectBody) - 1)) - -/* FUNCTIONS *****************************************************************/ - -VOID FASTCALL -ObmpPerformRetentionChecks(PUSER_OBJECT_HEADER ObjectHeader) -{ - if (ObjectHeader->RefCount < 0) - { - DPRINT1("ObjectHeader 0x%X has invalid reference count (%d)\n", - ObjectHeader, ObjectHeader->RefCount); - } - - if (ObjectHeader->HandleCount < 0) - { - DPRINT1("Object 0x%X has invalid handle count (%d)\n", - ObjectHeader, ObjectHeader->HandleCount); - } - - if ((ObjectHeader->RefCount == 0) && (ObjectHeader->HandleCount == 0)) - { - ExFreePool(ObjectHeader); - } -} - -PUSER_HANDLE FASTCALL -ObmpGetObjectByHandle(PUSER_HANDLE_TABLE HandleTable, - HANDLE Handle) -/* - * FUNCTION: Get the data structure for a handle - * ARGUMENTS: - * HandleTable = Table to search - * Handle = Handle to get data structure for - * RETURNS: - * Pointer to the data structure identified by the handle on success, - * NULL on failure - */ -{ - ULONG Index = (((ULONG)Handle) >> 2) - 1; - ULONG Count = Index / HANDLE_BLOCK_ENTRIES; - PUSER_HANDLE_BLOCK Block = NULL; - PLIST_ENTRY Current; - ULONG i; - - if (NULL == Handle) - { - return NULL; - } - - Current = HandleTable->ListHead.Flink; - - for (i = 0; i < Count; i++) - { - Current = Current->Flink; - if (Current == &(HandleTable->ListHead)) - { - DPRINT1("Invalid handle 0x%x\n", Handle); - return NULL; - } - } - - Block = CONTAINING_RECORD(Current, USER_HANDLE_BLOCK, ListEntry); - return &(Block->Handles[Index % HANDLE_BLOCK_ENTRIES]); -} - -VOID FASTCALL -ObmpCloseAllHandles(PUSER_HANDLE_TABLE HandleTable) -{ - PLIST_ENTRY CurrentEntry; - PUSER_HANDLE_BLOCK Current; - PVOID ObjectBody; - ULONG i; - - CurrentEntry = HandleTable->ListHead.Flink; - - while (CurrentEntry != &HandleTable->ListHead) - { - Current = CONTAINING_RECORD(CurrentEntry, USER_HANDLE_BLOCK, ListEntry); - - for (i = 0; i < HANDLE_BLOCK_ENTRIES; i++) - { - ObjectBody = Current->Handles[i].ObjectBody; - - if (ObjectBody != NULL) - { - PUSER_OBJECT_HEADER ObjectHeader = USER_BODY_TO_HEADER(ObjectBody); - - ObmReferenceObjectByPointer(ObjectBody, otUnknown); - ObjectHeader->HandleCount--; - Current->Handles[i].ObjectBody = NULL; - - ObmDereferenceObject(ObjectBody); - - CurrentEntry = &HandleTable->ListHead; - break; - } - } - - CurrentEntry = CurrentEntry->Flink; - } - -} - -VOID FASTCALL -ObmpDeleteHandleTable(PUSER_HANDLE_TABLE HandleTable) -{ - PUSER_HANDLE_BLOCK Current; - PLIST_ENTRY CurrentEntry; - - ObmpCloseAllHandles(HandleTable); - - CurrentEntry = RemoveHeadList(&HandleTable->ListHead); - - while (CurrentEntry != &HandleTable->ListHead) - { - Current = CONTAINING_RECORD(CurrentEntry, - USER_HANDLE_BLOCK, - ListEntry); - - ExFreePool(Current); - - CurrentEntry = RemoveHeadList(&HandleTable->ListHead); - } -} - -PVOID FASTCALL -ObmpDeleteHandle(PUSER_HANDLE_TABLE HandleTable, - HANDLE Handle) -{ - PUSER_OBJECT_HEADER ObjectHeader; - PUSER_HANDLE Entry; - PVOID ObjectBody; - - Entry = ObmpGetObjectByHandle(HandleTable, Handle); - if (Entry == NULL) - { - DPRINT1("Invalid handle\n"); - return NULL; - } - - ObjectBody = Entry->ObjectBody; - - if (ObjectBody != NULL) - { - ObjectHeader = USER_BODY_TO_HEADER(ObjectBody); - ObjectHeader->HandleCount--; - ObmReferenceObjectByPointer(ObjectBody, otUnknown); - Entry->ObjectBody = NULL; - } - - return ObjectBody; -} - -NTSTATUS FASTCALL -ObmpInitializeObject(PUSER_HANDLE_TABLE HandleTable, - PUSER_OBJECT_HEADER ObjectHeader, - PHANDLE Handle, - USER_OBJECT_TYPE ObjectType, - ULONG ObjectSize) -{ - DWORD Status = STATUS_SUCCESS; - - ObjectHeader->Type = ObjectType; - ObjectHeader->HandleCount = 0; - ObjectHeader->RefCount = 1; - ObjectHeader->Size = ObjectSize; - - if (Handle != NULL) - { - Status = ObmCreateHandle(HandleTable, - USER_HEADER_TO_BODY(ObjectHeader), - Handle); - } - - return Status; -} - - -ULONG FASTCALL -ObmGetReferenceCount(PVOID ObjectBody) -{ - PUSER_OBJECT_HEADER ObjectHeader = USER_BODY_TO_HEADER(ObjectBody); - - return ObjectHeader->RefCount; -} - -ULONG FASTCALL -ObmGetHandleCount(PVOID ObjectBody) -{ - PUSER_OBJECT_HEADER ObjectHeader = USER_BODY_TO_HEADER(ObjectBody); - - return ObjectHeader->HandleCount; -} - -VOID FASTCALL -ObmReferenceObject(PVOID ObjectBody) -/* - * FUNCTION: Increments a given object's reference count and performs - * retention checks - * ARGUMENTS: - * ObjectBody = Body of the object - */ -{ - PUSER_OBJECT_HEADER ObjectHeader; - - if (!ObjectBody) - { - DPRINT1("Cannot Reference NULL!\n"); - return; - } - - ObjectHeader = USER_BODY_TO_HEADER(ObjectBody); - - ObjectHeader->RefCount++; - - ObmpPerformRetentionChecks(ObjectHeader); -} - -VOID FASTCALL -ObmDereferenceObject(PVOID ObjectBody) -/* - * FUNCTION: Decrements a given object's reference count and performs - * retention checks - * ARGUMENTS: - * ObjectBody = Body of the object - */ -{ - PUSER_OBJECT_HEADER ObjectHeader; - - if (!ObjectBody) - { - DPRINT1("Cannot Dereference NULL!\n"); - return; - } - - ObjectHeader = USER_BODY_TO_HEADER(ObjectBody); - - ObjectHeader->RefCount--; - ObmpPerformRetentionChecks(ObjectHeader); -} - -NTSTATUS FASTCALL -ObmReferenceObjectByPointer(PVOID ObjectBody, - USER_OBJECT_TYPE ObjectType) -/* - * FUNCTION: Increments the pointer reference count for a given object - * ARGUMENTS: - * ObjectBody = Object's body - * ObjectType = Object type - * RETURNS: Status - */ -{ - PUSER_OBJECT_HEADER ObjectHeader; - - ObjectHeader = USER_BODY_TO_HEADER(ObjectBody); - - if ((ObjectType != otUnknown) && (ObjectHeader->Type != ObjectType)) - { - return STATUS_INVALID_PARAMETER; - } - ObjectHeader->RefCount++; - - return STATUS_SUCCESS; -} - -PVOID FASTCALL -ObmCreateObject(PUSER_HANDLE_TABLE HandleTable, - PHANDLE Handle, - USER_OBJECT_TYPE ObjectType, - ULONG ObjectSize) -{ - PUSER_OBJECT_HEADER ObjectHeader; - PVOID ObjectBody; - DWORD Status; - - ObjectHeader = (PUSER_OBJECT_HEADER)ExAllocatePool(PagedPool, - ObjectSize + sizeof(USER_OBJECT_HEADER)); - if (!ObjectHeader) - { - return NULL; - } - - ObjectBody = USER_HEADER_TO_BODY(ObjectHeader); - - RtlZeroMemory(ObjectBody, ObjectSize); - - Status = ObmpInitializeObject(HandleTable, - ObjectHeader, - Handle, - ObjectType, - ObjectSize); - - if (!NT_SUCCESS(Status)) - { - ExFreePool(ObjectHeader); - return NULL; - } - - return ObjectBody; -} - -NTSTATUS FASTCALL -ObmCreateHandle(PUSER_HANDLE_TABLE HandleTable, - PVOID ObjectBody, - PHANDLE HandleReturn) -/* - * FUNCTION: Add a handle referencing an object - * ARGUMENTS: - * HandleTable = Table to put handle in - * ObjectBody = Object body that the handle should refer to - * RETURNS: The created handle - */ -{ - PUSER_HANDLE_BLOCK NewBlock; - PLIST_ENTRY Current; - ULONG Handle; - ULONG i; - - if (ObjectBody != NULL) - { - USER_BODY_TO_HEADER(ObjectBody)->HandleCount++; - } - - Handle = 1; - Current = HandleTable->ListHead.Flink; - /* - * Scan through the currently allocated Handle blocks looking for a free - * slot - */ - while (Current != &(HandleTable->ListHead)) - { - PUSER_HANDLE_BLOCK Block = - CONTAINING_RECORD(Current, USER_HANDLE_BLOCK, ListEntry); - - for (i = 0; i < HANDLE_BLOCK_ENTRIES; i++) - { - if (!Block->Handles[i].ObjectBody) - { - Block->Handles[i].ObjectBody = ObjectBody; - *HandleReturn = (HANDLE)((Handle + i) << 2); - return STATUS_SUCCESS; - } - } - - Handle = Handle + HANDLE_BLOCK_ENTRIES; - Current = Current->Flink; - } - - /* - * Add a new Handle block to the end of the list - */ - NewBlock = (PUSER_HANDLE_BLOCK)ExAllocatePool(PagedPool, - sizeof(USER_HANDLE_BLOCK)); - if (!NewBlock) - { - DPRINT1("Unable to allocate new handle block\n"); - *HandleReturn = (PHANDLE)NULL; - return STATUS_INSUFFICIENT_RESOURCES; - } - - RtlZeroMemory(NewBlock, sizeof(USER_HANDLE_BLOCK)); - NewBlock->Handles[0].ObjectBody = ObjectBody; - InsertTailList(&HandleTable->ListHead, &NewBlock->ListEntry); - *HandleReturn = (HANDLE)(Handle << 2); - - return STATUS_SUCCESS; -} - -NTSTATUS FASTCALL -ObmReferenceObjectByHandle(PUSER_HANDLE_TABLE HandleTable, - HANDLE Handle, - USER_OBJECT_TYPE ObjectType, - PVOID* Object) -/* - * FUNCTION: Increments the reference count for an object and returns a - * pointer to its body - * ARGUMENTS: - * HandleTable = Table to search - * Handle = Handle for the object - * ObjectType = Type of object - * Object (OUT) = Points to the object body on return - * RETURNS: Status - */ -{ - PUSER_OBJECT_HEADER ObjectHeader; - PUSER_HANDLE UserHandle; - PVOID ObjectBody; - - UserHandle = ObmpGetObjectByHandle(HandleTable, Handle); - - if ((UserHandle == NULL) || (UserHandle->ObjectBody == NULL)) - { - return STATUS_UNSUCCESSFUL; - } - - ObjectBody = UserHandle->ObjectBody; - ObmReferenceObjectByPointer(ObjectBody, ObjectType); - - ObjectHeader = USER_BODY_TO_HEADER(ObjectBody); - - if ((ObjectType != otUnknown) && (ObjectHeader->Type != ObjectType)) - { - DPRINT1("Object type mismatch 0x%x 0x%x\n", ObjectType, ObjectHeader->Type); - ObmDereferenceObject(ObjectBody); - return STATUS_UNSUCCESSFUL; - } - - *Object = ObjectBody; - - return STATUS_SUCCESS; -} - -NTSTATUS FASTCALL -ObmCloseHandle(PUSER_HANDLE_TABLE HandleTable, - HANDLE Handle) -{ - PVOID ObjectBody; - - ObjectBody = ObmpDeleteHandle(HandleTable, Handle); - if (ObjectBody == NULL) - { - return STATUS_UNSUCCESSFUL; - } - - ObmDereferenceObject(ObjectBody); - - return STATUS_SUCCESS; -} - -VOID FASTCALL -ObmInitializeHandleTable(PUSER_HANDLE_TABLE HandleTable) -{ - InitializeListHead(&HandleTable->ListHead); -} - -VOID FASTCALL -ObmFreeHandleTable(PUSER_HANDLE_TABLE HandleTable) -{ - ObmpDeleteHandleTable(HandleTable); -} - -PUSER_HANDLE_TABLE FASTCALL -ObmCreateHandleTable(VOID) -{ - PUSER_HANDLE_TABLE HandleTable; - - HandleTable = (PUSER_HANDLE_TABLE)ExAllocatePool(PagedPool, - sizeof(USER_HANDLE_TABLE)); - if (!HandleTable) - { - DPRINT1("Unable to create handle table\n"); - return NULL; - } - - ObmInitializeHandleTable(HandleTable); - - return HandleTable; -} - -VOID FASTCALL -ObmDestroyHandleTable(PUSER_HANDLE_TABLE HandleTable) -{ - ObmFreeHandleTable(HandleTable); - ExFreePool(HandleTable); -} - -/* EOF */ _____ Deleted: trunk/reactos/subsys/win32k/misc/ssec.c --- trunk/reactos/subsys/win32k/misc/ssec.c 2005-09-06 07:58:43 UTC (rev 17692) +++ trunk/reactos/subsys/win32k/misc/ssec.c 2005-09-06 09:35:39 UTC (rev 17693) @@ -1,421 +0,0 @@ -/* - * ReactOS W32 Subsystem - * Copyright (C) 1998 - 2005 ReactOS Team - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS kernel - * PURPOSE: shared sections support - * FILE: subsys/win32k/misc/ssec.c - * PROGRAMER: Thomas Weidenmueller <w3seek(a)reactos.com> - */ - -#include <w32k.h> - -#define NDEBUG -#include <debug.h> - -/* - * FIXME - instead of mapping the memory into system space using - * MmMapViewInSystemSpace() we should rather use - * MmMapViewInSessionSpace() to map it into session space! - */ - -NTSTATUS INTERNAL_CALL -IntUserCreateSharedSectionPool(IN ULONG MaximumPoolSize, - IN PSHARED_SECTION_POOL *SharedSectionPool) -{ - PSHARED_SECTION_POOL Pool; - ULONG PoolStructSize; - - ASSERT(SharedSectionPool); - - PoolStructSize = ROUND_UP(sizeof(SHARED_SECTION_POOL), PAGE_SIZE); - Pool = ExAllocatePoolWithTag(NonPagedPool, - PoolStructSize, - TAG_SSECTPOOL); - if(Pool != NULL) - { - RtlZeroMemory(Pool, PoolStructSize); - - /* initialize the session heap */ - ExInitializeFastMutex(&Pool->Lock); - Pool->PoolSize = ROUND_UP(MaximumPoolSize, PAGE_SIZE); - Pool->PoolFree = Pool->PoolSize; - Pool->SharedSectionCount = 0; - Pool->SectionsArray.Next = NULL; - Pool->SectionsArray.nEntries = ((PoolStructSize - sizeof(SHARED_SECTION_POOL)) / - sizeof(SHARED_SECTION)) - 1; - - ASSERT(Pool->SectionsArray.nEntries > 0); - - *SharedSectionPool = Pool; - - return STATUS_SUCCESS; - } - - return STATUS_INSUFFICIENT_RESOURCES; -} - - -VOID INTERNAL_CALL -IntUserFreeSharedSectionPool(IN PSHARED_SECTION_POOL SharedSectionPool) -{ - PSHARED_SECTIONS_ARRAY Array, OldArray; - PSHARED_SECTION SharedSection, LastSharedSection; - - ASSERT(SharedSectionPool); - - Array = &SharedSectionPool->SectionsArray; - - ExAcquireFastMutex(&SharedSectionPool->Lock); - while(SharedSectionPool->SharedSectionCount > 0 && Array != NULL) - { - for(SharedSection = Array->SharedSection, LastSharedSection = SharedSection + Array->nEntries; - SharedSection != LastSharedSection && SharedSectionPool->SharedSectionCount > 0; - SharedSection++) - { - if(SharedSection->SectionObject != NULL) - { - ASSERT(SharedSection->SystemMappedBase); - - /* FIXME - use MmUnmapViewInSessionSpace() once implemented! */ - MmUnmapViewInSystemSpace(SharedSection->SystemMappedBase); - /* dereference the keep-alive reference so the section get's deleted */ - ObDereferenceObject(SharedSection->SectionObject); - - SharedSectionPool->SharedSectionCount--; - } - } - - OldArray = Array; - Array = Array->Next; - - /* all shared sections in this array were freed, link the following array to - the main session heap and free this array */ - SharedSectionPool->SectionsArray.Next = Array; - ExFreePool(OldArray); - } - - ASSERT(SharedSectionPool->SectionsArray.Next == NULL); - ASSERT(SharedSectionPool->SharedSectionCount == 0); - - ExReleaseFastMutex(&SharedSectionPool->Lock); -} - - -NTSTATUS INTERNAL_CALL -IntUserCreateSharedSection(IN PSHARED_SECTION_POOL SharedSectionPool, - IN OUT PVOID *SystemMappedBase, - IN OUT ULONG *SharedSectionSize) -{ - PSHARED_SECTIONS_ARRAY Array, LastArray; - PSHARED_SECTION FreeSharedSection, SharedSection, LastSharedSection; - LARGE_INTEGER SectionSize; - ULONG Size; - NTSTATUS Status; - - ASSERT(SharedSectionPool && SharedSectionSize && (*SharedSectionSize) > 0 && SystemMappedBase); - - FreeSharedSection = NULL; - - Size = ROUND_UP(*SharedSectionSize, PAGE_SIZE); - - ExAcquireFastMutex(&SharedSectionPool->Lock); - - if(Size > SharedSectionPool->PoolFree) - { - ExReleaseFastMutex(&SharedSectionPool->Lock); - DPRINT1("Shared Section Pool limit (0x%x KB) reached, attempted to allocate a 0x%x KB shared section!\n", - SharedSectionPool->PoolSize / 1024, (*SharedSectionSize) / 1024); - return STATUS_INSUFFICIENT_RESOURCES; - } - - /* walk the array to find a free entry */ - for(Array = &SharedSectionPool->SectionsArray, LastArray = Array; - Array != NULL && FreeSharedSection == NULL; - Array = Array->Next) - { - LastArray = Array; - - for(SharedSection = Array->SharedSection, LastSharedSection = SharedSection + Array->nEntries; - SharedSection != LastSharedSection; - SharedSection++) - { - if(SharedSection->SectionObject == NULL) - { - FreeSharedSection = SharedSection; - break; - } - } - - if(Array->Next != NULL) - { - LastArray = Array; - } - } - - ASSERT(LastArray); - - if(FreeSharedSection == NULL) - { - ULONG nNewEntries; - PSHARED_SECTIONS_ARRAY NewArray; - - ASSERT(LastArray->Next == NULL); - - /* couldn't find a free entry in the array, extend the array */ - - nNewEntries = ((PAGE_SIZE - sizeof(SHARED_SECTIONS_ARRAY)) / sizeof(SHARED_SECTION)) + 1; - NewArray = ExAllocatePoolWithTag(NonPagedPool, - sizeof(SHARED_SECTIONS_ARRAY) + ((nNewEntries - 1) * - sizeof(SHARED_SECTION)), - TAG_SSECTPOOL); - if(NewArray == NULL) - { - ExReleaseFastMutex(&SharedSectionPool->Lock); - DPRINT1("Failed to allocate new array for shared sections!\n"); - return STATUS_INSUFFICIENT_RESOURCES; - } - - NewArray->nEntries = nNewEntries; - NewArray->Next = NULL; - LastArray->Next = NewArray; - - Array = NewArray; - FreeSharedSection = &Array->SharedSection[0]; - } - - ASSERT(FreeSharedSection); - - /* now allocate a real section */ - - SectionSize.QuadPart = Size; - Status = MmCreateSection(&FreeSharedSection->SectionObject, - SECTION_ALL_ACCESS, - NULL, - &SectionSize, - PAGE_EXECUTE_READWRITE, - SEC_COMMIT, - NULL, - NULL); - if(NT_SUCCESS(Status)) - { - Status = MmMapViewInSystemSpace(FreeSharedSection->SectionObject, - &FreeSharedSection->SystemMappedBase, - &FreeSharedSection->ViewSize); - if(NT_SUCCESS(Status)) - { - (*SharedSectionSize) -= Size; - SharedSectionPool->SharedSectionCount++; - - *SystemMappedBase = FreeSharedSection->SystemMappedBase; - *SharedSectionSize = FreeSharedSection->ViewSize; - } - else - { - ObDereferenceObject(FreeSharedSection->SectionObject); - FreeSharedSection->SectionObject = NULL; - DPRINT1("Failed to map the shared section into system space! Status 0x%x\n", Status); - } - } - - ExReleaseFastMutex(&SharedSectionPool->Lock); - - return Status; -} - - -NTSTATUS INTERNAL_CALL -InUserDeleteSharedSection(PSHARED_SECTION_POOL SharedSectionPool, - PVOID SystemMappedBase) -{ - PSHARED_SECTIONS_ARRAY Array; - PSECTION_OBJECT SectionObject; - PSHARED_SECTION SharedSection, LastSharedSection; - NTSTATUS Status; - - ASSERT(SharedSectionPool && SystemMappedBase); - - SectionObject = NULL; - - ExAcquireFastMutex(&SharedSectionPool->Lock); - - for(Array = &SharedSectionPool->SectionsArray; - Array != NULL && SectionObject == NULL; - Array = Array->Next) - { - for(SharedSection = Array->SharedSection, LastSharedSection = SharedSection + Array->nEntries; - SharedSection != LastSharedSection; - SharedSection++) - { - if(SharedSection->SystemMappedBase == SystemMappedBase) - { - SectionObject = SharedSection->SectionObject; - SharedSection->SectionObject = NULL; - SharedSection->SystemMappedBase = NULL; - - ASSERT(SharedSectionPool->SharedSectionCount > 0); - SharedSectionPool->SharedSectionCount--; - break; - } - } - } - - ExReleaseFastMutex(&SharedSectionPool->Lock); - - if(SectionObject != NULL) - { - Status = MmUnmapViewInSystemSpace(SystemMappedBase); - ObDereferenceObject(SectionObject); - } - else - { - DPRINT1("Couldn't find and delete a shared section with SystemMappedBase=0x%x!\n", SystemMappedBase); - Status = STATUS_UNSUCCESSFUL; - } - - return Status; -} - - -NTSTATUS INTERNAL_CALL -IntUserMapSharedSection(IN PSHARED_SECTION_POOL SharedSectionPool, - IN PEPROCESS Process, - IN PVOID SystemMappedBase, - IN PLARGE_INTEGER SectionOffset OPTIONAL, - IN OUT PVOID *UserMappedBase, - IN PULONG ViewSize OPTIONAL, - IN BOOLEAN ReadOnly) -{ - PSHARED_SECTIONS_ARRAY Array; - PSECTION_OBJECT SectionObject; - PSHARED_SECTION SharedSection, LastSharedSection; - NTSTATUS Status; - - ASSERT(SharedSectionPool && Process && SystemMappedBase && UserMappedBase); - - SectionObject = NULL; - SharedSection = NULL; - - ExAcquireFastMutex(&SharedSectionPool->Lock); - - for(Array = &SharedSectionPool->SectionsArray; - Array != NULL && SectionObject == NULL; - Array = Array->Next) - { - for(SharedSection = Array->SharedSection, LastSharedSection = SharedSection + Array->nEntries; - SharedSection != LastSharedSection; - SharedSection++) - { - if(SharedSection->SystemMappedBase == SystemMappedBase) - { - SectionObject = SharedSection->SectionObject; - break; - } - } - } - - if(SectionObject != NULL) - { - ULONG RealViewSize = (ViewSize ? min(*ViewSize, SharedSection->ViewSize) : SharedSection->ViewSize); - - ObReferenceObjectByPointer(SectionObject, - (ReadOnly ? SECTION_MAP_READ : SECTION_MAP_READ | SECTION_MAP_WRITE), - NULL, - KernelMode); - - Status = MmMapViewOfSection(SectionObject, - Process, - UserMappedBase, - 0, - 0, - SectionOffset, - &RealViewSize, - ViewUnmap, /* not sure if we should inherit it... */ - MEM_COMMIT, - (ReadOnly ? PAGE_READONLY : PAGE_READWRITE)); - if(!NT_SUCCESS(Status)) - { - DPRINT1("Failed to map shared section (readonly=%d) into user memory! Status: 0x%x\n", ReadOnly, Status); - } - } - else - { - DPRINT1("Couldn't find and map a shared section with SystemMappedBase=0x%x!\n", SystemMappedBase); - Status = STATUS_UNSUCCESSFUL; - } - - ExReleaseFastMutex(&SharedSectionPool->Lock); - - return Status; -} - - -NTSTATUS INTERNAL_CALL -IntUserUnMapSharedSection(IN PSHARED_SECTION_POOL SharedSectionPool, - IN PEPROCESS Process, - IN PVOID SystemMappedBase, - IN PVOID UserMappedBase) -{ - PSHARED_SECTIONS_ARRAY Array; - PSECTION_OBJECT SectionObject; - PSHARED_SECTION SharedSection, LastSharedSection; - NTSTATUS Status; - - ASSERT(SharedSectionPool && Process && SystemMappedBase && UserMappedBase); - - SectionObject = NULL; - - ExAcquireFastMutex(&SharedSectionPool->Lock); - - for(Array = &SharedSectionPool->SectionsArray; - Array != NULL && SectionObject == NULL; - Array = Array->Next) - { - for(SharedSection = Array->SharedSection, LastSharedSection = SharedSection + Array->nEntries; - SharedSection != LastSharedSection; - SharedSection++) - { - if(SharedSection->SystemMappedBase == SystemMappedBase) - { - SectionObject = SharedSection->SectionObject; - break; - } - } - } - - ExReleaseFastMutex(&SharedSectionPool->Lock); - - if(SectionObject != NULL) - { - Status = MmUnmapViewOfSection(Process, - UserMappedBase); - ObDereferenceObject(SectionObject); - if(!NT_SUCCESS(Status)) - { - DPRINT1("Failed to unmap shared section UserMappedBase=0x%x! Status: 0x%x\n", UserMappedBase, Status); - } - } - else - { - DPRINT1("Couldn't find and unmap a shared section with SystemMappedBase=0x%x!\n", SystemMappedBase); - Status = STATUS_UNSUCCESSFUL; - } - - return Status; -} _____ Copied: trunk/reactos/subsys/win32k/ntuser/object.c (from rev 17685, trunk/reactos/subsys/win32k/misc/object.c) _____ Copied: trunk/reactos/subsys/win32k/ntuser/ssec.c (from rev 17668, trunk/reactos/subsys/win32k/misc/ssec.c) _____ Modified: trunk/reactos/subsys/win32k/ntuser/window.c --- trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-06 07:58:43 UTC (rev 17692) +++ trunk/reactos/subsys/win32k/ntuser/window.c 2005-09-06 09:35:39 UTC (rev 17693) @@ -75,6 +75,18 @@ /* HELPER FUNCTIONS ***********************************************************/ + + +/* temp hack */ +PWINDOW_OBJECT FASTCALL UserGetWindowObjectNoRef(HWND hWnd) +{ + + PWINDOW_OBJECT w = IntGetWindowObject(hWnd); + if (w) IntReleaseWindowObject(w); + return w; +} + + /* * IntIsWindow * _____ Modified: trunk/reactos/subsys/win32k/win32k.xml --- trunk/reactos/subsys/win32k/win32k.xml 2005-09-06 07:58:43 UTC (rev 17692) +++ trunk/reactos/subsys/win32k/win32k.xml 2005-09-06 09:35:39 UTC (rev 17693) @@ -58,8 +58,6 @@ <file>driver.c</file> <file>error.c</file> <file>math.c</file> - <file>object.c</file> - <file>ssec.c</file> <file>copy.c</file> </directory> <directory name="ntddraw"> @@ -99,6 +97,8 @@ <file>window.c</file> <file>winpos.c</file> <file>winsta.c</file> + <file>object.c</file> + <file>ssec.c</file> </directory> <directory name="objects"> <file>bezier.c</file>
19 years, 3 months
1
0
0
0
[gdalsnes] 17692: forgot a file:-| sry
by gdalsnes@svn.reactos.com
forgot a file:-| sry Added: trunk/reactos/subsys/win32k/include/ntuser.h _____ Added: trunk/reactos/subsys/win32k/include/ntuser.h --- trunk/reactos/subsys/win32k/include/ntuser.h 2005-09-06 06:44:34 UTC (rev 17691) +++ trunk/reactos/subsys/win32k/include/ntuser.h 2005-09-06 07:58:43 UTC (rev 17692) @@ -0,0 +1,60 @@ +#ifndef _WIN32K_NTUSER_H +#define _WIN32K_NTUSER_H + + +extern char* _file; +extern DWORD _line; +extern DWORD _locked; + +extern FAST_MUTEX UserLock; + +#define DECLARE_RETURN(type) type _ret_ +#define RETURN(value) { _ret_ = value; goto _cleanup_; } +#define CLEANUP /*unreachable*/ ASSERT(FALSE); _cleanup_ +#define END_CLEANUP return _ret_; + + +#define UserEnterCo() UserEnterExclusive() +#define UserLeaveCo() UserLeave() + +#define UserEnterShared() UserEnterExclusive() + +#define UserEnterExclusive() \ +{ \ + /* DPRINT1("try xlock, %s, %i (%i)\n",__FILE__,__LINE__, _locked);*/ \ + if (UserLock.Owner == KeGetCurrentThread()){ \ + DPRINT1("file %s, line %i\n",_file, _line); \ + ASSERT(FALSE); \ + } \ + UUserEnterExclusive(); \ + ASSERT(InterlockedIncrement(&_locked) == 1 /*> 0*/); \ + _file = __FILE__; _line = __LINE__; \ + /* DPRINT("got lock, %s, %i (%i)\n",__FILE__,__LINE__, _locked);*/ \ +} + +#define UserLeave() \ +{ \ + ASSERT(InterlockedDecrement(&_locked) == 0/*>= 0*/); \ + /*DPRINT("unlock, %s, %i (%i)\n",__FILE__,__LINE__, _locked);*/ \ + if (UserLock.Owner != KeGetCurrentThread()) { \ + DPRINT1("file %s, line %i\n",_file, _line); \ + ASSERT(FALSE); \ + } \ + _file = __FILE__; _line = __LINE__; \ + UUserLeave(); \ +} + + + +NTSTATUS FASTCALL InitUserImpl(VOID); +VOID FASTCALL UninitUser(VOID); +VOID FASTCALL UUserEnterShared(VOID); +VOID FASTCALL UUserEnterExclusive(VOID); +VOID FASTCALL UUserLeave(VOID); +BOOL FASTCALL UserIsEntered(); + + + +#endif /* _WIN32K_NTUSER_H */ + +/* EOF */
19 years, 3 months
1
0
0
0
← Newer
1
...
46
47
48
49
50
51
52
...
59
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
Results per page:
10
25
50
100
200