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
October 2014
----- 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
19 participants
730 discussions
Start a n
N
ew thread
[jgardou] 64942: [WIN32K] - Fix hook leaks. User object manager creates object with 2 (two, deux, zwei, dos) reference counts.
by jgardou@svn.reactos.org
Author: jgardou Date: Thu Oct 23 20:08:03 2014 New Revision: 64942 URL:
http://svn.reactos.org/svn/reactos?rev=64942&view=rev
Log: [WIN32K] - Fix hook leaks. User object manager creates object with 2 (two, deux, zwei, dos) reference counts. Modified: trunk/reactos/win32ss/user/ntuser/hook.c Modified: trunk/reactos/win32ss/user/ntuser/hook.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/hook.c…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/hook.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/hook.c [iso-8859-1] Thu Oct 23 20:08:03 2014 @@ -1402,7 +1402,7 @@ BOOL Ansi) { PWINSTATION_OBJECT WinStaObj; - PHOOK Hook; + PHOOK Hook = NULL; UNICODE_STRING ModuleName; NTSTATUS Status; HHOOK Handle; @@ -1634,6 +1634,8 @@ RETURN( Handle); CLEANUP: + if (Hook) + UserDereferenceObject(Hook); TRACE("Leave NtUserSetWindowsHookEx, ret=%p\n", _ret_); UserLeave(); END_CLEANUP;
10 years, 2 months
1
0
0
0
[akhaldi] 64941: * Sync up to trunk head (r64939).
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Oct 23 19:52:45 2014 New Revision: 64941 URL:
http://svn.reactos.org/svn/reactos?rev=64941&view=rev
Log: * Sync up to trunk head (r64939). Added: branches/shell-experiments/base/applications/network/net/cmdUser.c - copied unchanged from r64939, trunk/reactos/base/applications/network/net/cmdUser.c branches/shell-experiments/dll/win32/advapi32/wine/ - copied from r64939, trunk/reactos/dll/win32/advapi32/wine/ Removed: branches/shell-experiments/dll/win32/advapi32/crypt/ Modified: branches/shell-experiments/ (props changed) branches/shell-experiments/base/applications/network/net/CMakeLists.txt branches/shell-experiments/base/applications/network/net/lang/en-US.rc branches/shell-experiments/base/applications/network/net/lang/ro-RO.rc branches/shell-experiments/base/applications/network/net/lang/ru-RU.rc branches/shell-experiments/base/applications/network/net/main.c branches/shell-experiments/base/applications/network/net/net.h branches/shell-experiments/dll/directx/wine/dsound/sound3d.c branches/shell-experiments/dll/win32/advapi32/CMakeLists.txt branches/shell-experiments/dll/win32/advapi32/advapi32.h branches/shell-experiments/dll/win32/winspool/info.c branches/shell-experiments/drivers/bus/acpi/compbatt/comppnp.c branches/shell-experiments/drivers/bus/pcix/pci/id.c branches/shell-experiments/media/doc/README.WINE branches/shell-experiments/ntoskrnl/include/internal/io.h branches/shell-experiments/ntoskrnl/io/iomgr/driver.c branches/shell-experiments/subsystems/ntvdm/io.c branches/shell-experiments/subsystems/ntvdm/io.h branches/shell-experiments/win32ss/user/ntuser/class.c branches/shell-experiments/win32ss/user/ntuser/cursoricon_new.c branches/shell-experiments/win32ss/user/ntuser/window.c branches/shell-experiments/win32ss/user/user32/windows/cursoricon_new.c Propchange: branches/shell-experiments/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Oct 23 19:52:45 2014 @@ -18,4 +18,4 @@ /branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567 /branches/wlan-bringup:54809-54998 -/trunk/reactos:61927-64921 +/trunk/reactos:61927-64939 Modified: branches/shell-experiments/base/applications/network/net/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
============================================================================== --- branches/shell-experiments/base/applications/network/net/CMakeLists.txt [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/network/net/CMakeLists.txt [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -10,6 +10,7 @@ cmdPause.c cmdStart.c cmdStop.c + cmdUser.c help.c net.h) Modified: branches/shell-experiments/base/applications/network/net/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
============================================================================== --- branches/shell-experiments/base/applications/network/net/lang/en-US.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/network/net/lang/en-US.rc [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -44,7 +44,9 @@ IDS_TIME_HELP "TIME\n..." IDS_USE_SYNTAX "Usage:\nNET USE ..." IDS_USE_HELP "USE\n..." - IDS_USER_SYNTAX "Usage:\nNET USER ..." + IDS_USER_SYNTAX "Usage:\nNET USER [username [password | *] [options]] [/DOMAIN]\n\ + username {password | *} /ADD [options] [/DOMAIN]\n\ + username [/DELETE] [/DOMAIN]" IDS_USER_HELP "USER\n..." IDS_VIEW_SYNTAX "Usage:\nNET VIEW ..." IDS_VIEW_HELP "VIEW\n..." Modified: branches/shell-experiments/base/applications/network/net/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
============================================================================== --- branches/shell-experiments/base/applications/network/net/lang/ro-RO.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/network/net/lang/ro-RO.rc [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -50,7 +50,9 @@ IDS_TIME_HELP "TIME\n..." IDS_USE_SYNTAX "Utilizare:\nNET USE ..." IDS_USE_HELP "USE\n..." - IDS_USER_SYNTAX "Utilizare:\nNET USER ..." + IDS_USER_SYNTAX "Utilizare:\nNET USER [username [password | *] [options]] [/DOMAIN]\n\ + username {password | *} /ADD [options] [/DOMAIN]\n\ + username [/DELETE] [/DOMAIN]" IDS_USER_HELP "USER\n..." IDS_VIEW_SYNTAX "Utilizare:\nNET VIEW ..." IDS_VIEW_HELP "VIEW\n..." Modified: branches/shell-experiments/base/applications/network/net/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
============================================================================== --- branches/shell-experiments/base/applications/network/net/lang/ru-RU.rc [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/network/net/lang/ru-RU.rc [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -45,7 +45,9 @@ IDS_TIME_HELP "TIME\n..." IDS_USE_SYNTAX "ÐÑполÑзование:\nNET USE ..." IDS_USE_HELP "USE\n..." - IDS_USER_SYNTAX "ÐÑполÑзование:\nNET USER ..." + IDS_USER_SYNTAX "ÐÑполÑзование:\nNET USER [username [password | *] [options]] [/DOMAIN]\n\ + username {password | *} /ADD [options] [/DOMAIN]\n\ + username [/DELETE] [/DOMAIN]" IDS_USER_HELP "USER\n..." IDS_VIEW_SYNTAX "ÐÑполÑзование:\nNET VIEW ..." IDS_VIEW_HELP "VIEW\n..." Modified: branches/shell-experiments/base/applications/network/net/main.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
============================================================================== --- branches/shell-experiments/base/applications/network/net/main.c [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/network/net/main.c [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -40,7 +40,7 @@ {L"stop", cmdStop}, {L"time", unimplemented}, {L"use", unimplemented}, - {L"user", unimplemented}, + {L"user", cmdUser}, {L"view", unimplemented}, {NULL, NULL} }; Modified: branches/shell-experiments/base/applications/network/net/net.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/applicat…
============================================================================== --- branches/shell-experiments/base/applications/network/net/net.h [iso-8859-1] (original) +++ branches/shell-experiments/base/applications/network/net/net.h [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -13,6 +13,7 @@ #include <windef.h> #include <winbase.h> +#include <winnls.h> #include <winuser.h> #include <winsvc.h> #include <stdio.h> @@ -39,5 +40,6 @@ INT cmdPause(INT argc, WCHAR **argv); INT cmdStart(INT argc, WCHAR **argv); INT cmdStop(INT argc, WCHAR **argv); +INT cmdUser(INT argc, WCHAR **argv); #endif /* _NET_PCH_ */ Modified: branches/shell-experiments/dll/directx/wine/dsound/sound3d.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/directx/w…
============================================================================== --- branches/shell-experiments/dll/directx/wine/dsound/sound3d.c [iso-8859-1] (original) +++ branches/shell-experiments/dll/directx/wine/dsound/sound3d.c [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -121,6 +121,7 @@ return c; } +#ifndef __REACTOS__ /* calculates the length of vector's projection on another vector */ static inline D3DVALUE ProjectVector (const D3DVECTOR *a, const D3DVECTOR *p) { @@ -131,6 +132,7 @@ p->y, p->z, result); return result; } +#endif /******************************************************************************* * 3D Buffer and Listener mixing Modified: branches/shell-experiments/dll/win32/advapi32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/adv…
============================================================================== --- branches/shell-experiments/dll/win32/advapi32/CMakeLists.txt [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/advapi32/CMakeLists.txt [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -17,9 +17,6 @@ ${REACTOS_SOURCE_DIR}/include/reactos/idl/svcctl.idl) list(APPEND SOURCE - crypt/crypt.c - crypt/crypt_des.c - crypt/crypt_lmhash.c misc/dllmain.c misc/efs.c misc/hwprofiles.c @@ -44,6 +41,9 @@ service/sctrl.c token/privilege.c token/token.c + wine/crypt.c + wine/crypt_des.c + wine/crypt_lmhash.c advapi32.h) add_library(advapi32 SHARED Modified: branches/shell-experiments/dll/win32/advapi32/advapi32.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/adv…
============================================================================== --- branches/shell-experiments/dll/win32/advapi32/advapi32.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/advapi32/advapi32.h [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -39,7 +39,7 @@ #include <wine/debug.h> #include <wine/unicode.h> -#include "crypt/crypt.h" +#include "wine/crypt.h" #ifndef HAS_FN_PROGRESSW #define FN_PROGRESSW FN_PROGRESS Modified: branches/shell-experiments/dll/win32/winspool/info.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/win…
============================================================================== --- branches/shell-experiments/dll/win32/winspool/info.c [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/winspool/info.c [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -28,10 +28,6 @@ #include <winnls.h> #include <shlwapi.h> -#include <wine/debug.h> - -WINE_DEFAULT_DEBUG_CHANNEL(winspool); - /****************************************************************************** * GetDefaultPrinterA (WINSPOOL.@) */ Modified: branches/shell-experiments/drivers/bus/acpi/compbatt/comppnp.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/drivers/bus/a…
============================================================================== --- branches/shell-experiments/drivers/bus/acpi/compbatt/comppnp.c [iso-8859-1] (original) +++ branches/shell-experiments/drivers/bus/acpi/compbatt/comppnp.c [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -69,7 +69,7 @@ /* Done */ ExReleaseFastMutex(&DeviceExtension->Lock); if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING RemoveBatteryFromList\n"); - return STATUS_SUCCESS; + return NULL; } BOOLEAN Modified: branches/shell-experiments/drivers/bus/pcix/pci/id.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/drivers/bus/p…
============================================================================== --- branches/shell-experiments/drivers/bus/pcix/pci/id.c [iso-8859-1] (original) +++ branches/shell-experiments/drivers/bus/pcix/pci/id.c [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -118,7 +118,7 @@ } ULONG -NTAPI +__cdecl PciIdPrintf(IN PPCI_ID_BUFFER IdBuffer, IN PCCH Format, ...) @@ -153,7 +153,7 @@ } ULONG -NTAPI +__cdecl PciIdPrintfAppend(IN PPCI_ID_BUFFER IdBuffer, IN PCCH Format, ...) Modified: branches/shell-experiments/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/media/doc/REA…
============================================================================== --- branches/shell-experiments/media/doc/README.WINE [iso-8859-1] (original) +++ branches/shell-experiments/media/doc/README.WINE [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -256,9 +256,11 @@ reactos/lib/3rdparty/strmbase # Synced to Wine-1.7.27 advapi32 - - reactos/dll/win32/advapi32/crypt/*.c # Synced to Wine-1.7.27 - reactos/dll/win32/advapi32/sec/cred.c # Synced to Wine-1.7.27 - reactos/dll/win32/advapi32/sec/sid.c # Out of Sync + reactos/dll/win32/advapi32/wine/crypt.c # Synced to Wine-1.7.27 + reactos/dll/win32/advapi32/wine/crypt_des.c # Synced to Wine-1.7.27 + reactos/dll/win32/advapi32/wine/crypt_lmhash.c # Synced to Wine-1.7.27 + reactos/dll/win32/advapi32/sec/cred.c # Synced to Wine-1.7.27 + reactos/dll/win32/advapi32/sec/sid.c # Out of Sync gdi32 - reactos/dll/win32/gdi32/objects/linedda.c # Synced at 20090410 Modified: branches/shell-experiments/ntoskrnl/include/internal/io.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/ntoskrnl/incl…
============================================================================== --- branches/shell-experiments/ntoskrnl/include/internal/io.h [iso-8859-1] (original) +++ branches/shell-experiments/ntoskrnl/include/internal/io.h [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -385,7 +385,7 @@ typedef struct _LOAD_UNLOAD_PARAMS { NTSTATUS Status; - PUNICODE_STRING ServiceName; + PCUNICODE_STRING RegistryPath; WORK_QUEUE_ITEM WorkItem; KEVENT Event; PDRIVER_OBJECT DriverObject; @@ -1083,10 +1083,11 @@ OUT PLDR_DATA_TABLE_ENTRY *ModuleObject ); -VOID +NTSTATUS NTAPI IopLoadUnloadDriver( - IN OUT PLOAD_UNLOAD_PARAMS LoadParams + _In_opt_ PCUNICODE_STRING RegistryPath, + _Inout_ PDRIVER_OBJECT *DriverObject ); NTSTATUS Modified: branches/shell-experiments/ntoskrnl/io/iomgr/driver.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/ntoskrnl/io/i…
============================================================================== --- branches/shell-experiments/ntoskrnl/io/iomgr/driver.c [iso-8859-1] (original) +++ branches/shell-experiments/ntoskrnl/io/iomgr/driver.c [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -39,15 +39,16 @@ /* PRIVATE FUNCTIONS **********************************************************/ -NTSTATUS NTAPI +NTSTATUS +NTAPI IopInvalidDeviceRequest( - PDEVICE_OBJECT DeviceObject, - PIRP Irp) -{ - Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST; - Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_INVALID_DEVICE_REQUEST; + PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST; + Irp->IoStatus.Information = 0; + IoCompleteRequest(Irp, IO_NO_INCREMENT); + return STATUS_INVALID_DEVICE_REQUEST; } VOID @@ -64,8 +65,7 @@ ASSERT(!DriverObject->DeviceObject); /* Get the extension and loop them */ - DriverExtension = IoGetDrvObjExtension(DriverObject)-> - ClientDriverExtension; + DriverExtension = IoGetDrvObjExtension(DriverObject)->ClientDriverExtension; while (DriverExtension) { /* Get the next one */ @@ -98,61 +98,60 @@ } } -NTSTATUS FASTCALL +NTSTATUS +FASTCALL IopGetDriverObject( - PDRIVER_OBJECT *DriverObject, - PUNICODE_STRING ServiceName, - BOOLEAN FileSystem) -{ - PDRIVER_OBJECT Object; - WCHAR NameBuffer[MAX_PATH]; - UNICODE_STRING DriverName; - NTSTATUS Status; - - DPRINT("IopGetDriverObject(%p '%wZ' %x)\n", - DriverObject, ServiceName, FileSystem); - - *DriverObject = NULL; - - /* Create ModuleName string */ - if (ServiceName == NULL || ServiceName->Buffer == NULL) - /* We don't know which DriverObject we have to open */ - return STATUS_INVALID_PARAMETER_2; - - DriverName.Buffer = NameBuffer; - DriverName.Length = 0; - DriverName.MaximumLength = sizeof(NameBuffer); - - if (FileSystem == TRUE) - RtlAppendUnicodeToString(&DriverName, FILESYSTEM_ROOT_NAME); - else - RtlAppendUnicodeToString(&DriverName, DRIVER_ROOT_NAME); - RtlAppendUnicodeStringToString(&DriverName, ServiceName); - - DPRINT("Driver name: '%wZ'\n", &DriverName); - - /* Open driver object */ - Status = ObReferenceObjectByName( - &DriverName, - OBJ_OPENIF | OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, /* Attributes */ - NULL, /* PassedAccessState */ - 0, /* DesiredAccess */ - IoDriverObjectType, - KernelMode, - NULL, /* ParseContext */ - (PVOID*)&Object); - - if (!NT_SUCCESS(Status)) - { - DPRINT("Failed to reference driver object, status=0x%08x\n", Status); - return Status; - } - - *DriverObject = Object; - - DPRINT("Driver Object: %p\n", Object); - - return STATUS_SUCCESS; + PDRIVER_OBJECT *DriverObject, + PUNICODE_STRING ServiceName, + BOOLEAN FileSystem) +{ + PDRIVER_OBJECT Object; + WCHAR NameBuffer[MAX_PATH]; + UNICODE_STRING DriverName; + NTSTATUS Status; + + DPRINT("IopGetDriverObject(%p '%wZ' %x)\n", + DriverObject, ServiceName, FileSystem); + + *DriverObject = NULL; + + /* Create ModuleName string */ + if (ServiceName == NULL || ServiceName->Buffer == NULL) + /* We don't know which DriverObject we have to open */ + return STATUS_INVALID_PARAMETER_2; + + DriverName.Buffer = NameBuffer; + DriverName.Length = 0; + DriverName.MaximumLength = sizeof(NameBuffer); + + if (FileSystem == TRUE) + RtlAppendUnicodeToString(&DriverName, FILESYSTEM_ROOT_NAME); + else + RtlAppendUnicodeToString(&DriverName, DRIVER_ROOT_NAME); + RtlAppendUnicodeStringToString(&DriverName, ServiceName); + + DPRINT("Driver name: '%wZ'\n", &DriverName); + + /* Open driver object */ + Status = ObReferenceObjectByName(&DriverName, + OBJ_OPENIF | OBJ_KERNEL_HANDLE | OBJ_CASE_INSENSITIVE, /* Attributes */ + NULL, /* PassedAccessState */ + 0, /* DesiredAccess */ + IoDriverObjectType, + KernelMode, + NULL, /* ParseContext */ + (PVOID*)&Object); + if (!NT_SUCCESS(Status)) + { + DPRINT("Failed to reference driver object, status=0x%08x\n", Status); + return Status; + } + + *DriverObject = Object; + + DPRINT("Driver Object: %p\n", Object); + + return STATUS_SUCCESS; } /* @@ -193,7 +192,6 @@ * * Display 'Loading XXX...' message. */ - VOID FASTCALL INIT_FUNCTION @@ -234,55 +232,55 @@ * Remarks * The input image path isn't freed on error. */ - NTSTATUS FASTCALL IopNormalizeImagePath( - _Inout_ _When_(return>=0, _At_(ImagePath->Buffer, _Post_notnull_ __drv_allocatesMem(Mem))) - PUNICODE_STRING ImagePath, - _In_ PUNICODE_STRING ServiceName) -{ - UNICODE_STRING InputImagePath; - - DPRINT("Normalizing image path '%wZ' for service '%wZ'\n", ImagePath, ServiceName); - - RtlCopyMemory( - &InputImagePath, - ImagePath, - sizeof(UNICODE_STRING)); - - if (InputImagePath.Length == 0) - { - ImagePath->Length = 0; - ImagePath->MaximumLength = - (33 * sizeof(WCHAR)) + ServiceName->Length + sizeof(UNICODE_NULL); - ImagePath->Buffer = ExAllocatePool(NonPagedPool, ImagePath->MaximumLength); - if (ImagePath->Buffer == NULL) - return STATUS_NO_MEMORY; - - RtlAppendUnicodeToString(ImagePath, L"\\SystemRoot\\system32\\drivers\\"); - RtlAppendUnicodeStringToString(ImagePath, ServiceName); - RtlAppendUnicodeToString(ImagePath, L".sys"); - } else - if (InputImagePath.Buffer[0] != L'\\') - { - ImagePath->Length = 0; - ImagePath->MaximumLength = - 12 * sizeof(WCHAR) + InputImagePath.Length + sizeof(UNICODE_NULL); - ImagePath->Buffer = ExAllocatePool(NonPagedPool, ImagePath->MaximumLength); - if (ImagePath->Buffer == NULL) - return STATUS_NO_MEMORY; - - RtlAppendUnicodeToString(ImagePath, L"\\SystemRoot\\"); - RtlAppendUnicodeStringToString(ImagePath, &InputImagePath); - - /* Free caller's string */ - ExFreePoolWithTag(InputImagePath.Buffer, TAG_RTLREGISTRY); - } - - DPRINT("Normalized image path is '%wZ' for service '%wZ'\n", ImagePath, ServiceName); - - return STATUS_SUCCESS; + _Inout_ _When_(return>=0, _At_(ImagePath->Buffer, _Post_notnull_ __drv_allocatesMem(Mem))) + PUNICODE_STRING ImagePath, + _In_ PUNICODE_STRING ServiceName) +{ + UNICODE_STRING InputImagePath; + + DPRINT("Normalizing image path '%wZ' for service '%wZ'\n", ImagePath, ServiceName); + + RtlCopyMemory(&InputImagePath, + ImagePath, + sizeof(UNICODE_STRING)); + + if (InputImagePath.Length == 0) + { + ImagePath->Length = 0; + ImagePath->MaximumLength = + (33 * sizeof(WCHAR)) + ServiceName->Length + sizeof(UNICODE_NULL); + ImagePath->Buffer = ExAllocatePool(NonPagedPool, + ImagePath->MaximumLength); + if (ImagePath->Buffer == NULL) + return STATUS_NO_MEMORY; + + RtlAppendUnicodeToString(ImagePath, L"\\SystemRoot\\system32\\drivers\\"); + RtlAppendUnicodeStringToString(ImagePath, ServiceName); + RtlAppendUnicodeToString(ImagePath, L".sys"); + } + else if (InputImagePath.Buffer[0] != L'\\') + { + ImagePath->Length = 0; + ImagePath->MaximumLength = + 12 * sizeof(WCHAR) + InputImagePath.Length + sizeof(UNICODE_NULL); + ImagePath->Buffer = ExAllocatePool(NonPagedPool, + ImagePath->MaximumLength); + if (ImagePath->Buffer == NULL) + return STATUS_NO_MEMORY; + + RtlAppendUnicodeToString(ImagePath, L"\\SystemRoot\\"); + RtlAppendUnicodeStringToString(ImagePath, &InputImagePath); + + /* Free caller's string */ + ExFreePoolWithTag(InputImagePath.Buffer, TAG_RTLREGISTRY); + } + + DPRINT("Normalized image path is '%wZ' for service '%wZ'\n", ImagePath, ServiceName); + + return STATUS_SUCCESS; } /* @@ -297,130 +295,129 @@ * Return Value * Status */ - -NTSTATUS FASTCALL +NTSTATUS +FASTCALL IopLoadServiceModule( - IN PUNICODE_STRING ServiceName, - OUT PLDR_DATA_TABLE_ENTRY *ModuleObject) -{ - RTL_QUERY_REGISTRY_TABLE QueryTable[3]; - ULONG ServiceStart; - UNICODE_STRING ServiceImagePath, CCSName; - NTSTATUS Status; - HANDLE CCSKey, ServiceKey; - PVOID BaseAddress; + IN PUNICODE_STRING ServiceName, + OUT PLDR_DATA_TABLE_ENTRY *ModuleObject) +{ + RTL_QUERY_REGISTRY_TABLE QueryTable[3]; + ULONG ServiceStart; + UNICODE_STRING ServiceImagePath, CCSName; + NTSTATUS Status; + HANDLE CCSKey, ServiceKey; + PVOID BaseAddress; ASSERT(ServiceName->Length); DPRINT("IopLoadServiceModule(%wZ, 0x%p)\n", ServiceName, ModuleObject); - if (ExpInTextModeSetup) - { - /* We have no registry, but luckily we know where all the drivers are */ - - /* ServiceStart < 4 is all that matters */ - ServiceStart = 0; - - /* IopNormalizeImagePath will do all of the work for us if we give it an empty string */ - ServiceImagePath.Length = ServiceImagePath.MaximumLength = 0; - ServiceImagePath.Buffer = NULL; - } - else - { - /* Open CurrentControlSet */ - RtlInitUnicodeString(&CCSName, - L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services"); - Status = IopOpenRegistryKeyEx(&CCSKey, NULL, &CCSName, KEY_READ); - if (!NT_SUCCESS(Status)) - { - DPRINT1("IopOpenRegistryKeyEx() failed for '%wZ' with Status %08X\n", - &CCSName, Status); - return Status; - } - - /* Open service key */ - Status = IopOpenRegistryKeyEx(&ServiceKey, CCSKey, ServiceName, KEY_READ); - if (!NT_SUCCESS(Status)) - { - DPRINT1("IopOpenRegistryKeyEx() failed for '%wZ' with Status %08X\n", - ServiceName, Status); - ZwClose(CCSKey); - return Status; - } - - /* - * Get information about the service. - */ - - RtlZeroMemory(QueryTable, sizeof(QueryTable)); - - RtlInitUnicodeString(&ServiceImagePath, NULL); - - QueryTable[0].Name = L"Start"; - QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT; - QueryTable[0].EntryContext = &ServiceStart; - - QueryTable[1].Name = L"ImagePath"; - QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT; - QueryTable[1].EntryContext = &ServiceImagePath; - - Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE, - (PWSTR)ServiceKey, QueryTable, NULL, NULL); - - ZwClose(ServiceKey); - ZwClose(CCSKey); - - if (!NT_SUCCESS(Status)) - { - DPRINT1("RtlQueryRegistryValues() failed (Status %x)\n", Status); - return Status; - } - } - - /* - * Normalize the image path for all later processing. - */ - - Status = IopNormalizeImagePath(&ServiceImagePath, ServiceName); - - if (!NT_SUCCESS(Status)) - { - DPRINT("IopNormalizeImagePath() failed (Status %x)\n", Status); - return Status; - } - - /* - * Case for disabled drivers - */ - - if (ServiceStart >= 4) - { - /* We can't load this */ - Status = STATUS_DRIVER_UNABLE_TO_LOAD; - } - else - { - DPRINT("Loading module from %wZ\n", &ServiceImagePath); - Status = MmLoadSystemImage(&ServiceImagePath, NULL, NULL, 0, (PVOID)ModuleObject, &BaseAddress); - if (NT_SUCCESS(Status)) - { - IopDisplayLoadingMessage(ServiceName); - } - } - - ExFreePool(ServiceImagePath.Buffer); - - /* - * Now check if the module was loaded successfully. - */ - - if (!NT_SUCCESS(Status)) - { - DPRINT("Module loading failed (Status %x)\n", Status); - } - - DPRINT("Module loading (Status %x)\n", Status); - - return Status; + if (ExpInTextModeSetup) + { + /* We have no registry, but luckily we know where all the drivers are */ + + /* ServiceStart < 4 is all that matters */ + ServiceStart = 0; + + /* IopNormalizeImagePath will do all of the work for us if we give it an empty string */ + ServiceImagePath.Length = ServiceImagePath.MaximumLength = 0; + ServiceImagePath.Buffer = NULL; + } + else + { + /* Open CurrentControlSet */ + RtlInitUnicodeString(&CCSName, + L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Services"); + Status = IopOpenRegistryKeyEx(&CCSKey, NULL, &CCSName, KEY_READ); + if (!NT_SUCCESS(Status)) + { + DPRINT1("IopOpenRegistryKeyEx() failed for '%wZ' with Status %08X\n", + &CCSName, Status); + return Status; + } + + /* Open service key */ + Status = IopOpenRegistryKeyEx(&ServiceKey, CCSKey, ServiceName, KEY_READ); + if (!NT_SUCCESS(Status)) + { + DPRINT1("IopOpenRegistryKeyEx() failed for '%wZ' with Status %08X\n", + ServiceName, Status); + ZwClose(CCSKey); + return Status; + } + + /* + * Get information about the service. + */ + RtlZeroMemory(QueryTable, sizeof(QueryTable)); + + RtlInitUnicodeString(&ServiceImagePath, NULL); + + QueryTable[0].Name = L"Start"; + QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[0].EntryContext = &ServiceStart; + + QueryTable[1].Name = L"ImagePath"; + QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[1].EntryContext = &ServiceImagePath; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE, + (PWSTR)ServiceKey, + QueryTable, + NULL, + NULL); + + ZwClose(ServiceKey); + ZwClose(CCSKey); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlQueryRegistryValues() failed (Status %x)\n", Status); + return Status; + } + } + + /* + * Normalize the image path for all later processing. + */ + Status = IopNormalizeImagePath(&ServiceImagePath, ServiceName); + + if (!NT_SUCCESS(Status)) + { + DPRINT("IopNormalizeImagePath() failed (Status %x)\n", Status); + return Status; + } + + /* + * Case for disabled drivers + */ + if (ServiceStart >= 4) + { + /* We can't load this */ + Status = STATUS_DRIVER_UNABLE_TO_LOAD; + } + else + { + DPRINT("Loading module from %wZ\n", &ServiceImagePath); + Status = MmLoadSystemImage(&ServiceImagePath, NULL, NULL, 0, (PVOID)ModuleObject, &BaseAddress); + if (NT_SUCCESS(Status)) + { + IopDisplayLoadingMessage(ServiceName); + } + } + + ExFreePool(ServiceImagePath.Buffer); + + /* + * Now check if the module was loaded successfully. + */ + if (!NT_SUCCESS(Status)) + { + DPRINT("Module loading failed (Status %x)\n", Status); + } + + DPRINT("Module loading (Status %x)\n", Status); + + return Status; } VOID @@ -450,84 +447,83 @@ * On successful return this contains the driver object representing * the loaded driver. */ - -NTSTATUS FASTCALL +NTSTATUS +FASTCALL IopInitializeDriverModule( - IN PDEVICE_NODE DeviceNode, - IN PLDR_DATA_TABLE_ENTRY ModuleObject, - IN PUNICODE_STRING ServiceName, - IN BOOLEAN FileSystemDriver, - OUT PDRIVER_OBJECT *DriverObject) -{ - const WCHAR ServicesKeyName[] = L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"; - WCHAR NameBuffer[MAX_PATH]; - UNICODE_STRING DriverName; - UNICODE_STRING RegistryKey; - PDRIVER_INITIALIZE DriverEntry; - PDRIVER_OBJECT Driver; - NTSTATUS Status; - - DriverEntry = ModuleObject->EntryPoint; - - if (ServiceName != NULL && ServiceName->Length != 0) - { - RegistryKey.Length = 0; - RegistryKey.MaximumLength = sizeof(ServicesKeyName) + ServiceName->Length; - RegistryKey.Buffer = ExAllocatePool(PagedPool, RegistryKey.MaximumLength); - if (RegistryKey.Buffer == NULL) - { - return STATUS_INSUFFICIENT_RESOURCES; - } - RtlAppendUnicodeToString(&RegistryKey, ServicesKeyName); - RtlAppendUnicodeStringToString(&RegistryKey, ServiceName); - } - else - { - RtlInitUnicodeString(&RegistryKey, NULL); - } - - /* Create ModuleName string */ - if (ServiceName && ServiceName->Length > 0) - { - if (FileSystemDriver == TRUE) - wcscpy(NameBuffer, FILESYSTEM_ROOT_NAME); - else - wcscpy(NameBuffer, DRIVER_ROOT_NAME); - - RtlInitUnicodeString(&DriverName, NameBuffer); - DriverName.MaximumLength = sizeof(NameBuffer); - - RtlAppendUnicodeStringToString(&DriverName, ServiceName); - - DPRINT("Driver name: '%wZ'\n", &DriverName); - } - else - DriverName.Length = 0; - - Status = IopCreateDriver( - DriverName.Length > 0 ? &DriverName : NULL, - DriverEntry, - &RegistryKey, - ServiceName, - ModuleObject, - &Driver); - RtlFreeUnicodeString(&RegistryKey); - - *DriverObject = Driver; - if (!NT_SUCCESS(Status)) - { - DPRINT("IopCreateDriver() failed (Status 0x%08lx)\n", Status); - return Status; - } - - MmFreeDriverInitialization((PLDR_DATA_TABLE_ENTRY)Driver->DriverSection); - - /* Set the driver as initialized */ - IopReadyDeviceObjects(Driver); - - if (PnpSystemInit) IopReinitializeDrivers(); - - return STATUS_SUCCESS; + IN PDEVICE_NODE DeviceNode, + IN PLDR_DATA_TABLE_ENTRY ModuleObject, + IN PUNICODE_STRING ServiceName, + IN BOOLEAN FileSystemDriver, + OUT PDRIVER_OBJECT *DriverObject) +{ + const WCHAR ServicesKeyName[] = L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\"; + WCHAR NameBuffer[MAX_PATH]; + UNICODE_STRING DriverName; + UNICODE_STRING RegistryKey; + PDRIVER_INITIALIZE DriverEntry; + PDRIVER_OBJECT Driver; + NTSTATUS Status; + + DriverEntry = ModuleObject->EntryPoint; + + if (ServiceName != NULL && ServiceName->Length != 0) + { + RegistryKey.Length = 0; + RegistryKey.MaximumLength = sizeof(ServicesKeyName) + ServiceName->Length; + RegistryKey.Buffer = ExAllocatePool(PagedPool, RegistryKey.MaximumLength); + if (RegistryKey.Buffer == NULL) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + RtlAppendUnicodeToString(&RegistryKey, ServicesKeyName); + RtlAppendUnicodeStringToString(&RegistryKey, ServiceName); + } + else + { + RtlInitUnicodeString(&RegistryKey, NULL); + } + + /* Create ModuleName string */ + if (ServiceName && ServiceName->Length > 0) + { + if (FileSystemDriver == TRUE) + wcscpy(NameBuffer, FILESYSTEM_ROOT_NAME); + else + wcscpy(NameBuffer, DRIVER_ROOT_NAME); + + RtlInitUnicodeString(&DriverName, NameBuffer); + DriverName.MaximumLength = sizeof(NameBuffer); + + RtlAppendUnicodeStringToString(&DriverName, ServiceName); + + DPRINT("Driver name: '%wZ'\n", &DriverName); + } + else + DriverName.Length = 0; + + Status = IopCreateDriver(DriverName.Length > 0 ? &DriverName : NULL, + DriverEntry, + &RegistryKey, + ServiceName, + ModuleObject, + &Driver); + RtlFreeUnicodeString(&RegistryKey); + + *DriverObject = Driver; + if (!NT_SUCCESS(Status)) + { + DPRINT("IopCreateDriver() failed (Status 0x%08lx)\n", Status); + return Status; + } + + MmFreeDriverInitialization((PLDR_DATA_TABLE_ENTRY)Driver->DriverSection); + + /* Set the driver as initialized */ + IopReadyDeviceObjects(Driver); + + if (PnpSystemInit) IopReinitializeDrivers(); + + return STATUS_SUCCESS; } /* @@ -535,64 +531,67 @@ * * Internal routine used by IopAttachFilterDrivers. */ - -NTSTATUS NTAPI +NTSTATUS +NTAPI IopAttachFilterDriversCallback( - PWSTR ValueName, - ULONG ValueType, - PVOID ValueData, - ULONG ValueLength, - PVOID Context, - PVOID EntryContext) -{ - PDEVICE_NODE DeviceNode = Context; - UNICODE_STRING ServiceName; - PWCHAR Filters; - PLDR_DATA_TABLE_ENTRY ModuleObject; - PDRIVER_OBJECT DriverObject; - NTSTATUS Status; - - /* No filter value present */ - if (ValueType == REG_NONE) - return STATUS_SUCCESS; - - for (Filters = ValueData; - ((ULONG_PTR)Filters - (ULONG_PTR)ValueData) < ValueLength && - *Filters != 0; - Filters += (ServiceName.Length / sizeof(WCHAR)) + 1) - { - DPRINT("Filter Driver: %S (%wZ)\n", Filters, &DeviceNode->InstancePath); - - ServiceName.Buffer = Filters; - ServiceName.MaximumLength = - ServiceName.Length = (USHORT)wcslen(Filters) * sizeof(WCHAR); - - Status = IopGetDriverObject(&DriverObject, - &ServiceName, - FALSE); - if (!NT_SUCCESS(Status)) - { - /* Load and initialize the filter driver */ - Status = IopLoadServiceModule(&ServiceName, &ModuleObject); - if (!NT_SUCCESS(Status)) - return Status; - - Status = IopInitializeDriverModule(DeviceNode, ModuleObject, &ServiceName, - FALSE, &DriverObject); - if (!NT_SUCCESS(Status)) - return Status; - } - - Status = IopInitializeDevice(DeviceNode, DriverObject); - - /* Remove extra reference */ - ObDereferenceObject(DriverObject); - - if (!NT_SUCCESS(Status)) - return Status; - } - - return STATUS_SUCCESS; + PWSTR ValueName, + ULONG ValueType, + PVOID ValueData, + ULONG ValueLength, + PVOID Context, + PVOID EntryContext) +{ + PDEVICE_NODE DeviceNode = Context; + UNICODE_STRING ServiceName; + PWCHAR Filters; + PLDR_DATA_TABLE_ENTRY ModuleObject; + PDRIVER_OBJECT DriverObject; + NTSTATUS Status; + + /* No filter value present */ + if (ValueType == REG_NONE) + return STATUS_SUCCESS; + + for (Filters = ValueData; + ((ULONG_PTR)Filters - (ULONG_PTR)ValueData) < ValueLength && + *Filters != 0; + Filters += (ServiceName.Length / sizeof(WCHAR)) + 1) + { + DPRINT("Filter Driver: %S (%wZ)\n", Filters, &DeviceNode->InstancePath); + + ServiceName.Buffer = Filters; + ServiceName.MaximumLength = + ServiceName.Length = (USHORT)wcslen(Filters) * sizeof(WCHAR); + + Status = IopGetDriverObject(&DriverObject, + &ServiceName, + FALSE); + if (!NT_SUCCESS(Status)) + { + /* Load and initialize the filter driver */ + Status = IopLoadServiceModule(&ServiceName, &ModuleObject); + if (!NT_SUCCESS(Status)) + return Status; + + Status = IopInitializeDriverModule(DeviceNode, + ModuleObject, + &ServiceName, + FALSE, + &DriverObject); + if (!NT_SUCCESS(Status)) + return Status; + } + + Status = IopInitializeDevice(DeviceNode, DriverObject); + + /* Remove extra reference */ + ObDereferenceObject(DriverObject); + + if (!NT_SUCCESS(Status)) + return Status; + } + + return STATUS_SUCCESS; } /* @@ -605,143 +604,148 @@ * Set to TRUE for loading lower level filters or FALSE for upper * level filters. */ - -NTSTATUS FASTCALL +NTSTATUS +FASTCALL IopAttachFilterDrivers( - PDEVICE_NODE DeviceNode, - BOOLEAN Lower) -{ - RTL_QUERY_REGISTRY_TABLE QueryTable[2] = { { NULL, 0, NULL, NULL, 0, NULL, 0 }, }; - UNICODE_STRING Class; - WCHAR ClassBuffer[40]; - UNICODE_STRING EnumRoot = RTL_CONSTANT_STRING(ENUM_ROOT); - HANDLE EnumRootKey, SubKey; - NTSTATUS Status; - - /* Open enumeration root key */ - Status = IopOpenRegistryKeyEx(&EnumRootKey, NULL, - &EnumRoot, KEY_READ); - if (!NT_SUCCESS(Status)) - { - DPRINT1("ZwOpenKey() failed with Status %08X\n", Status); - return Status; - } - - /* Open subkey */ - Status = IopOpenRegistryKeyEx(&SubKey, EnumRootKey, - &DeviceNode->InstancePath, KEY_READ); - if (!NT_SUCCESS(Status)) - { - DPRINT1("ZwOpenKey() failed with Status %08X\n", Status); - ZwClose(EnumRootKey); - return Status; - } - - /* - * First load the device filters - */ - QueryTable[0].QueryRoutine = IopAttachFilterDriversCallback; - if (Lower) - QueryTable[0].Name = L"LowerFilters"; - else - QueryTable[0].Name = L"UpperFilters"; - QueryTable[0].Flags = 0; - QueryTable[0].DefaultType = REG_NONE; - - Status = RtlQueryRegistryValues( - RTL_REGISTRY_HANDLE, - (PWSTR)SubKey, - QueryTable, - DeviceNode, - NULL); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Failed to load device %s filters: %08X\n", - Lower ? "lower" : "upper", Status); - ZwClose(SubKey); - ZwClose(EnumRootKey); - return Status; - } - - /* - * Now get the class GUID - */ - Class.Length = 0; - Class.MaximumLength = 40 * sizeof(WCHAR); - Class.Buffer = ClassBuffer; - QueryTable[0].QueryRoutine = NULL; - QueryTable[0].Name = L"ClassGUID"; - QueryTable[0].EntryContext = &Class; - QueryTable[0].Flags = RTL_QUERY_REGISTRY_REQUIRED | RTL_QUERY_REGISTRY_DIRECT; - - Status = RtlQueryRegistryValues( - RTL_REGISTRY_HANDLE, - (PWSTR)SubKey, - QueryTable, - DeviceNode, - NULL); - - /* Close handles */ - ZwClose(SubKey); - ZwClose(EnumRootKey); - - /* - * Load the class filter driver - */ - if (NT_SUCCESS(Status)) - { - UNICODE_STRING ControlClass = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Class"); - - Status = IopOpenRegistryKeyEx(&EnumRootKey, NULL, - &ControlClass, KEY_READ); - if (!NT_SUCCESS(Status)) - { - DPRINT1("ZwOpenKey() failed with Status %08X\n", Status); - return Status; - } - - /* Open subkey */ - Status = IopOpenRegistryKeyEx(&SubKey, EnumRootKey, - &Class, KEY_READ); - if (!NT_SUCCESS(Status)) - { - /* It's okay if there's no class key */ - DPRINT1("ZwOpenKey() failed with Status %08X\n", Status); - ZwClose(EnumRootKey); - return STATUS_SUCCESS; - } - - QueryTable[0].QueryRoutine = IopAttachFilterDriversCallback; - if (Lower) - QueryTable[0].Name = L"LowerFilters"; - else - QueryTable[0].Name = L"UpperFilters"; - QueryTable[0].EntryContext = NULL; - QueryTable[0].Flags = 0; - QueryTable[0].DefaultType = REG_NONE; - - Status = RtlQueryRegistryValues( - RTL_REGISTRY_HANDLE, - (PWSTR)SubKey, - QueryTable, - DeviceNode, - NULL); - - /* Clean up */ - ZwClose(SubKey); - ZwClose(EnumRootKey); - - if (!NT_SUCCESS(Status)) - { - DPRINT1("Failed to load class %s filters: %08X\n", - Lower ? "lower" : "upper", Status); - ZwClose(SubKey); - ZwClose(EnumRootKey); - return Status; - } - } - - return STATUS_SUCCESS; + PDEVICE_NODE DeviceNode, + BOOLEAN Lower) +{ + RTL_QUERY_REGISTRY_TABLE QueryTable[2] = { { NULL, 0, NULL, NULL, 0, NULL, 0 }, }; + UNICODE_STRING Class; + WCHAR ClassBuffer[40]; + UNICODE_STRING EnumRoot = RTL_CONSTANT_STRING(ENUM_ROOT); + HANDLE EnumRootKey, SubKey; + NTSTATUS Status; + + /* Open enumeration root key */ + Status = IopOpenRegistryKeyEx(&EnumRootKey, + NULL, + &EnumRoot, + KEY_READ); + if (!NT_SUCCESS(Status)) + { + DPRINT1("ZwOpenKey() failed with Status %08X\n", Status); + return Status; + } + + /* Open subkey */ + Status = IopOpenRegistryKeyEx(&SubKey, + EnumRootKey, + &DeviceNode->InstancePath, + KEY_READ); + if (!NT_SUCCESS(Status)) + { + DPRINT1("ZwOpenKey() failed with Status %08X\n", Status); + ZwClose(EnumRootKey); + return Status; + } + + /* + * First load the device filters + */ + QueryTable[0].QueryRoutine = IopAttachFilterDriversCallback; + if (Lower) + QueryTable[0].Name = L"LowerFilters"; + else + QueryTable[0].Name = L"UpperFilters"; + QueryTable[0].Flags = 0; + QueryTable[0].DefaultType = REG_NONE; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE, + (PWSTR)SubKey, + QueryTable, + DeviceNode, + NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to load device %s filters: %08X\n", + Lower ? "lower" : "upper", Status); + ZwClose(SubKey); + ZwClose(EnumRootKey); + return Status; + } + + /* + * Now get the class GUID + */ + Class.Length = 0; + Class.MaximumLength = 40 * sizeof(WCHAR); + Class.Buffer = ClassBuffer; + QueryTable[0].QueryRoutine = NULL; + QueryTable[0].Name = L"ClassGUID"; + QueryTable[0].EntryContext = &Class; + QueryTable[0].Flags = RTL_QUERY_REGISTRY_REQUIRED | RTL_QUERY_REGISTRY_DIRECT; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE, + (PWSTR)SubKey, + QueryTable, + DeviceNode, + NULL); + + /* Close handles */ + ZwClose(SubKey); + ZwClose(EnumRootKey); + + /* + * Load the class filter driver + */ + if (NT_SUCCESS(Status)) + { + UNICODE_STRING ControlClass = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\Class"); + + Status = IopOpenRegistryKeyEx(&EnumRootKey, + NULL, + &ControlClass, + KEY_READ); + if (!NT_SUCCESS(Status)) + { + DPRINT1("ZwOpenKey() failed with Status %08X\n", Status); + return Status; + } + + /* Open subkey */ + Status = IopOpenRegistryKeyEx(&SubKey, + EnumRootKey, + &Class, + KEY_READ); + if (!NT_SUCCESS(Status)) + { + /* It's okay if there's no class key */ + DPRINT1("ZwOpenKey() failed with Status %08X\n", Status); + ZwClose(EnumRootKey); + return STATUS_SUCCESS; + } + + QueryTable[0].QueryRoutine = IopAttachFilterDriversCallback; + if (Lower) + QueryTable[0].Name = L"LowerFilters"; + else + QueryTable[0].Name = L"UpperFilters"; + QueryTable[0].EntryContext = NULL; + QueryTable[0].Flags = 0; + QueryTable[0].DefaultType = REG_NONE; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_HANDLE, + (PWSTR)SubKey, + QueryTable, + DeviceNode, + NULL); + + /* Clean up */ + ZwClose(SubKey); + ZwClose(EnumRootKey); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to load class %s filters: %08X\n", + Lower ? "lower" : "upper", Status); + ZwClose(SubKey); + ZwClose(EnumRootKey); + return Status; + } + } + + return STATUS_SUCCESS; } NTSTATUS @@ -836,7 +840,6 @@ * * Initialize a driver that is already loaded in memory. */ - NTSTATUS NTAPI INIT_FUNCTION @@ -852,85 +855,91 @@ PLIST_ENTRY NextEntry; UNICODE_STRING ServiceName; - /* - * Display 'Loading XXX...' message - */ - IopDisplayLoadingMessage(ModuleName); - InbvIndicateProgress(); - - /* - * Generate filename without path (not needed by freeldr) - */ - FileNameWithoutPath = wcsrchr(ModuleName->Buffer, L'\\'); - if (FileNameWithoutPath == NULL) - { - FileNameWithoutPath = ModuleName->Buffer; - } - else - { - FileNameWithoutPath++; - } - - /* - * Strip the file extension from ServiceName - */ - RtlCreateUnicodeString(&ServiceName, FileNameWithoutPath); - FileExtension = wcsrchr(ServiceName.Buffer, '.'); - if (FileExtension != NULL) - { - ServiceName.Length -= (USHORT)wcslen(FileExtension) * sizeof(WCHAR); - FileExtension[0] = 0; - } - - /* - * Determine the right device object - */ - /* Use IopRootDeviceNode for now */ - Status = IopCreateDeviceNode(IopRootDeviceNode, NULL, &ServiceName, &DeviceNode); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Driver '%wZ' load failed, status (%x)\n", ModuleName, Status); - return(Status); - } - - /* Lookup the new Ldr entry in PsLoadedModuleList */ - NextEntry = PsLoadedModuleList.Flink; - while (NextEntry != &PsLoadedModuleList) - { - LdrEntry = CONTAINING_RECORD(NextEntry, - LDR_DATA_TABLE_ENTRY, - InLoadOrderLinks); - if (RtlEqualUnicodeString(ModuleName, &LdrEntry->BaseDllName, TRUE)) - { - break; - } - - NextEntry = NextEntry->Flink; - } - NT_ASSERT(NextEntry != &PsLoadedModuleList); - - /* - * Initialize the driver - */ - Status = IopInitializeDriverModule(DeviceNode, LdrEntry, - &DeviceNode->ServiceName, FALSE, &DriverObject); - - if (!NT_SUCCESS(Status)) - { - IopFreeDeviceNode(DeviceNode); - return Status; - } - - Status = IopInitializeDevice(DeviceNode, DriverObject); - if (NT_SUCCESS(Status)) - { - Status = IopStartDevice(DeviceNode); - } - - /* Remove extra reference from IopInitializeDriverModule */ - ObDereferenceObject(DriverObject); - - return Status; + /* + * Display 'Loading XXX...' message + */ + IopDisplayLoadingMessage(ModuleName); + InbvIndicateProgress(); + + /* + * Generate filename without path (not needed by freeldr) + */ + FileNameWithoutPath = wcsrchr(ModuleName->Buffer, L'\\'); + if (FileNameWithoutPath == NULL) + { + FileNameWithoutPath = ModuleName->Buffer; + } + else + { + FileNameWithoutPath++; + } + + /* + * Strip the file extension from ServiceName + */ + RtlCreateUnicodeString(&ServiceName, FileNameWithoutPath); + FileExtension = wcsrchr(ServiceName.Buffer, '.'); + if (FileExtension != NULL) + { + ServiceName.Length -= (USHORT)wcslen(FileExtension) * sizeof(WCHAR); + FileExtension[0] = 0; + } + + /* + * Determine the right device object + */ + /* Use IopRootDeviceNode for now */ + Status = IopCreateDeviceNode(IopRootDeviceNode, + NULL, + &ServiceName, + &DeviceNode); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Driver '%wZ' load failed, status (%x)\n", ModuleName, Status); + return(Status); + } + + /* Lookup the new Ldr entry in PsLoadedModuleList */ + NextEntry = PsLoadedModuleList.Flink; + while (NextEntry != &PsLoadedModuleList) + { + LdrEntry = CONTAINING_RECORD(NextEntry, + LDR_DATA_TABLE_ENTRY, + InLoadOrderLinks); + if (RtlEqualUnicodeString(ModuleName, &LdrEntry->BaseDllName, TRUE)) + { + break; + } + + NextEntry = NextEntry->Flink; + } + NT_ASSERT(NextEntry != &PsLoadedModuleList); + + /* + * Initialize the driver + */ + Status = IopInitializeDriverModule(DeviceNode, + LdrEntry, + &DeviceNode->ServiceName, + FALSE, + &DriverObject); + + if (!NT_SUCCESS(Status)) + { + IopFreeDeviceNode(DeviceNode); + return Status; + } + + Status = IopInitializeDevice(DeviceNode, DriverObject); + if (NT_SUCCESS(Status)) + { + Status = IopStartDevice(DeviceNode); + } + + /* Remove extra reference from IopInitializeDriverModule */ + ObDereferenceObject(DriverObject); + + return Status; } /* @@ -1195,204 +1204,180 @@ NTSTATUS NTAPI IopUnloadDriver(PUNICODE_STRING DriverServiceName, BOOLEAN UnloadPnpDrivers) { - RTL_QUERY_REGISTRY_TABLE QueryTable[2]; - UNICODE_STRING ImagePath; - UNICODE_STRING ServiceName; - UNICODE_STRING ObjectName; - PDRIVER_OBJECT DriverObject; - PDEVICE_OBJECT DeviceObject; - PEXTENDED_DEVOBJ_EXTENSION DeviceExtension; - LOAD_UNLOAD_PARAMS LoadParams; - NTSTATUS Status; - LPWSTR Start; - BOOLEAN SafeToUnload = TRUE; - - DPRINT("IopUnloadDriver('%wZ', %u)\n", DriverServiceName, UnloadPnpDrivers); - - PAGED_CODE(); - - /* - * Get the service name from the registry key name - */ - - Start = wcsrchr(DriverServiceName->Buffer, L'\\'); - if (Start == NULL) - Start = DriverServiceName->Buffer; - else - Start++; - - RtlInitUnicodeString(&ServiceName, Start); - - /* - * Construct the driver object name - */ - - ObjectName.Length = ((USHORT)wcslen(Start) + 8) * sizeof(WCHAR); - ObjectName.MaximumLength = ObjectName.Length + sizeof(WCHAR); - ObjectName.Buffer = ExAllocatePool(PagedPool, ObjectName.MaximumLength); - if (!ObjectName.Buffer) return STATUS_INSUFFICIENT_RESOURCES; - wcscpy(ObjectName.Buffer, DRIVER_ROOT_NAME); - memcpy(ObjectName.Buffer + 8, Start, ObjectName.Length - 8 * sizeof(WCHAR)); - ObjectName.Buffer[ObjectName.Length/sizeof(WCHAR)] = 0; - - /* - * Find the driver object - */ - Status = ObReferenceObjectByName(&ObjectName, - 0, - 0, - 0, - IoDriverObjectType, - KernelMode, - 0, - (PVOID*)&DriverObject); - - if (!NT_SUCCESS(Status)) - { - DPRINT1("Can't locate driver object for %wZ\n", &ObjectName); - ExFreePool(ObjectName.Buffer); - return Status; - } - - /* - * Free the buffer for driver object name - */ - ExFreePool(ObjectName.Buffer); - - /* Check that driver is not already unloading */ - if (DriverObject->Flags & DRVO_UNLOAD_INVOKED) - { - DPRINT1("Driver deletion pending\n"); - ObDereferenceObject(DriverObject); - return STATUS_DELETE_PENDING; - } - - /* - * Get path of service... - */ - - RtlZeroMemory(QueryTable, sizeof(QueryTable)); - - RtlInitUnicodeString(&ImagePath, NULL); - - QueryTable[0].Name = L"ImagePath"; - QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT; - QueryTable[0].EntryContext = &ImagePath; - - Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE, - DriverServiceName->Buffer, QueryTable, NULL, NULL); - - if (!NT_SUCCESS(Status)) - { - DPRINT1("RtlQueryRegistryValues() failed (Status %x)\n", Status); - ObDereferenceObject(DriverObject); - return Status; - } - - /* - * Normalize the image path for all later processing. - */ - - Status = IopNormalizeImagePath(&ImagePath, &ServiceName); - - if (!NT_SUCCESS(Status)) - { - DPRINT1("IopNormalizeImagePath() failed (Status %x)\n", Status); - ObDereferenceObject(DriverObject); - return Status; - } - - /* - * Free the service path - */ - - ExFreePool(ImagePath.Buffer); - - /* - * Unload the module and release the references to the device object - */ + RTL_QUERY_REGISTRY_TABLE QueryTable[2]; + UNICODE_STRING ImagePath; + UNICODE_STRING ServiceName; + UNICODE_STRING ObjectName; + PDRIVER_OBJECT DriverObject; + PDEVICE_OBJECT DeviceObject; + PEXTENDED_DEVOBJ_EXTENSION DeviceExtension; + NTSTATUS Status; + LPWSTR Start; + BOOLEAN SafeToUnload = TRUE; + + DPRINT("IopUnloadDriver('%wZ', %u)\n", DriverServiceName, UnloadPnpDrivers); + + PAGED_CODE(); + + /* + * Get the service name from the registry key name + */ + + Start = wcsrchr(DriverServiceName->Buffer, L'\\'); + if (Start == NULL) + Start = DriverServiceName->Buffer; + else + Start++; + + RtlInitUnicodeString(&ServiceName, Start); + + /* + * Construct the driver object name + */ + + ObjectName.Length = ((USHORT)wcslen(Start) + 8) * sizeof(WCHAR); + ObjectName.MaximumLength = ObjectName.Length + sizeof(WCHAR); + ObjectName.Buffer = ExAllocatePool(PagedPool, ObjectName.MaximumLength); + if (!ObjectName.Buffer) return STATUS_INSUFFICIENT_RESOURCES; + wcscpy(ObjectName.Buffer, DRIVER_ROOT_NAME); + memcpy(ObjectName.Buffer + 8, Start, ObjectName.Length - 8 * sizeof(WCHAR)); + ObjectName.Buffer[ObjectName.Length/sizeof(WCHAR)] = 0; + + /* + * Find the driver object + */ + Status = ObReferenceObjectByName(&ObjectName, + 0, + 0, + 0, + IoDriverObjectType, + KernelMode, + 0, + (PVOID*)&DriverObject); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("Can't locate driver object for %wZ\n", &ObjectName); + ExFreePool(ObjectName.Buffer); + return Status; + } + + /* + * Free the buffer for driver object name + */ + ExFreePool(ObjectName.Buffer); + + /* Check that driver is not already unloading */ + if (DriverObject->Flags & DRVO_UNLOAD_INVOKED) + { + DPRINT1("Driver deletion pending\n"); + ObDereferenceObject(DriverObject); + return STATUS_DELETE_PENDING; + } + + /* + * Get path of service... + */ + RtlZeroMemory(QueryTable, sizeof(QueryTable)); + + RtlInitUnicodeString(&ImagePath, NULL); + + QueryTable[0].Name = L"ImagePath"; + QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT; + QueryTable[0].EntryContext = &ImagePath; + + Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE, + DriverServiceName->Buffer, + QueryTable, + NULL, + NULL); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("RtlQueryRegistryValues() failed (Status %x)\n", Status); + ObDereferenceObject(DriverObject); + return Status; + } + + /* + * Normalize the image path for all later processing. + */ + Status = IopNormalizeImagePath(&ImagePath, &ServiceName); + + if (!NT_SUCCESS(Status)) + { + DPRINT1("IopNormalizeImagePath() failed (Status %x)\n", Status); + ObDereferenceObject(DriverObject); + return Status; + } + + /* + * Free the service path + */ + ExFreePool(ImagePath.Buffer); + + /* + * Unload the module and release the references to the device object + */ /* Call the load/unload routine, depending on current process */ - if (DriverObject->DriverUnload && DriverObject->DriverSection && - (UnloadPnpDrivers || (DriverObject->Flags & DRVO_LEGACY_DRIVER))) - { - /* Loop through each device object of the driver - and set DOE_UNLOAD_PENDING flag */ - DeviceObject = DriverObject->DeviceObject; - while (DeviceObject) - { - /* Set the unload pending flag for the device */ - DeviceExtension = IoGetDevObjExtension(DeviceObject); - DeviceExtension->ExtensionFlags |= DOE_UNLOAD_PENDING; - - /* Make sure there are no attached devices or no reference counts */ - if ((DeviceObject->ReferenceCount) || (DeviceObject->AttachedDevice)) - { - /* Not safe to unload */ - DPRINT1("Drivers device object is referenced or has attached devices\n"); - - SafeToUnload = FALSE; - } - - DeviceObject = DeviceObject->NextDevice; - } - - /* If not safe to unload, then return success */ - if (!SafeToUnload) - { - ObDereferenceObject(DriverObject); - return STATUS_SUCCESS; - } - - DPRINT1("Unloading driver '%wZ' (manual)\n", &DriverObject->DriverName); - - /* Set the unload invoked flag */ - DriverObject->Flags |= DRVO_UNLOAD_INVOKED; - - if (PsGetCurrentProcess() == PsInitialSystemProcess) - { - /* Just call right away */ - (*DriverObject->DriverUnload)(DriverObject); - } - else - { - /* Load/Unload must be called from system process */ - - /* Prepare parameters block */ - LoadParams.DriverObject = DriverObject; - KeInitializeEvent(&LoadParams.Event, NotificationEvent, FALSE); - - ExInitializeWorkItem(&LoadParams.WorkItem, - (PWORKER_THREAD_ROUTINE)IopLoadUnloadDriver, - (PVOID)&LoadParams); - - /* Queue it */ - ExQueueWorkItem(&LoadParams.WorkItem, DelayedWorkQueue); - - /* And wait when it completes */ - KeWaitForSingleObject(&LoadParams.Event, UserRequest, KernelMode, - FALSE, NULL); - } - - /* Mark the driver object temporary, so it could be deleted later */ - ObMakeTemporaryObject(DriverObject); - - /* Dereference it 2 times */ - ObDereferenceObject(DriverObject); - ObDereferenceObject(DriverObject); - - return STATUS_SUCCESS; - } - else - { - DPRINT1("No DriverUnload function! '%wZ' will not be unloaded!\n", &DriverObject->DriverName); - - /* Dereference one time (refd inside this function) */ - ObDereferenceObject(DriverObject); - - /* Return unloading failure */ - return STATUS_INVALID_DEVICE_REQUEST; - } + if (DriverObject->DriverUnload && DriverObject->DriverSection && + (UnloadPnpDrivers || (DriverObject->Flags & DRVO_LEGACY_DRIVER))) + { + /* Loop through each device object of the driver + and set DOE_UNLOAD_PENDING flag */ + DeviceObject = DriverObject->DeviceObject; + while (DeviceObject) + { + /* Set the unload pending flag for the device */ + DeviceExtension = IoGetDevObjExtension(DeviceObject); + DeviceExtension->ExtensionFlags |= DOE_UNLOAD_PENDING; + + /* Make sure there are no attached devices or no reference counts */ + if ((DeviceObject->ReferenceCount) || (DeviceObject->AttachedDevice)) + { + /* Not safe to unload */ + DPRINT1("Drivers device object is referenced or has attached devices\n"); + + SafeToUnload = FALSE; + } + + DeviceObject = DeviceObject->NextDevice; + } + + /* If not safe to unload, then return success */ + if (!SafeToUnload) + { + ObDereferenceObject(DriverObject); + return STATUS_SUCCESS; + } + + DPRINT1("Unloading driver '%wZ' (manual)\n", &DriverObject->DriverName); + + /* Set the unload invoked flag and call the unload routine */ + DriverObject->Flags |= DRVO_UNLOAD_INVOKED; + Status = IopLoadUnloadDriver(NULL, &DriverObject); + NT_ASSERT(Status == STATUS_SUCCESS); + + /* Mark the driver object temporary, so it could be deleted later */ + ObMakeTemporaryObject(DriverObject); + + /* Dereference it 2 times */ + ObDereferenceObject(DriverObject); + ObDereferenceObject(DriverObject); + + return Status; + } + else + { + DPRINT1("No DriverUnload function! '%wZ' will not be unloaded!\n", &DriverObject->DriverName); + + /* Dereference one time (refd inside this function) */ + ObDereferenceObject(DriverObject); + + /* Return unloading failure */ + return STATUS_INVALID_DEVICE_REQUEST; + } } VOID @@ -1676,8 +1661,8 @@ IoCreateDriver(IN PUNICODE_STRING DriverName OPTIONAL, IN PDRIVER_INITIALIZE InitializationFunction) { - PDRIVER_OBJECT DriverObject; - return IopCreateDriver(DriverName, InitializationFunction, NULL, DriverName, NULL, &DriverObject); + PDRIVER_OBJECT DriverObject; + return IopCreateDriver(DriverName, InitializationFunction, NULL, DriverName, NULL, &DriverObject); } /* @@ -1865,8 +1850,24 @@ return DriverExtensions + 1; } -VOID NTAPI -IopLoadUnloadDriver(PLOAD_UNLOAD_PARAMS LoadParams) +VOID +NTAPI +IopLoadUnloadDriverWorker( + _Inout_ PVOID Parameter) +{ + PLOAD_UNLOAD_PARAMS LoadParams = Parameter; + + NT_ASSERT(PsGetCurrentProcess() == PsInitialSystemProcess); + LoadParams->Status = IopLoadUnloadDriver(LoadParams->RegistryPath, + &LoadParams->DriverObject); + KeSetEvent(&LoadParams->Event, 0, FALSE); +} + +NTSTATUS +NTAPI +IopLoadUnloadDriver( + _In_opt_ PCUNICODE_STRING RegistryPath, + _Inout_ PDRIVER_OBJECT *DriverObject) { RTL_QUERY_REGISTRY_TABLE QueryTable[3]; UNICODE_STRING ImagePath; @@ -1874,20 +1875,40 @@ NTSTATUS Status; ULONG Type; PDEVICE_NODE DeviceNode; - PDRIVER_OBJECT DriverObject; PLDR_DATA_TABLE_ENTRY ModuleObject; PVOID BaseAddress; WCHAR *cur; + /* Load/Unload must be called from system process */ + if (PsGetCurrentProcess() != PsInitialSystemProcess) + { + LOAD_UNLOAD_PARAMS LoadParams; + + /* Prepare parameters block */ + LoadParams.RegistryPath = RegistryPath; + LoadParams.DriverObject = *DriverObject; + KeInitializeEvent(&LoadParams.Event, NotificationEvent, FALSE); + + /* Initialize and queue a work item */ + ExInitializeWorkItem(&LoadParams.WorkItem, + IopLoadUnloadDriverWorker, + &LoadParams); + ExQueueWorkItem(&LoadParams.WorkItem, DelayedWorkQueue); + + /* And wait till it completes */ + KeWaitForSingleObject(&LoadParams.Event, + UserRequest, + KernelMode, + FALSE, + NULL); + return LoadParams.Status; + } + /* Check if it's an unload request */ - if (LoadParams->DriverObject) - { - (*LoadParams->DriverObject->DriverUnload)(LoadParams->DriverObject); - - /* Return success and signal the event */ - LoadParams->Status = STATUS_SUCCESS; - KeSetEvent(&LoadParams->Event, 0, FALSE); - return; + if (*DriverObject) + { + (*DriverObject)->DriverUnload(*DriverObject); + return STATUS_SUCCESS; } RtlInitUnicodeString(&ImagePath, NULL); @@ -1895,28 +1916,26 @@ /* * Get the service name from the registry key name. */ - ASSERT(LoadParams->ServiceName->Length >= sizeof(WCHAR)); - - ServiceName = *LoadParams->ServiceName; - cur = LoadParams->ServiceName->Buffer + - (LoadParams->ServiceName->Length / sizeof(WCHAR)) - 1; - while (LoadParams->ServiceName->Buffer != cur) + ASSERT(RegistryPath->Length >= sizeof(WCHAR)); + + ServiceName = *RegistryPath; + cur = RegistryPath->Buffer + RegistryPath->Length / sizeof(WCHAR) - 1; + while (RegistryPath->Buffer != cur) { if (*cur == L'\\') { ServiceName.Buffer = cur + 1; - ServiceName.Length = LoadParams->ServiceName->Length - + ServiceName.Length = RegistryPath->Length - (USHORT)((ULONG_PTR)ServiceName.Buffer - - (ULONG_PTR)LoadParams->ServiceName->Buffer); + (ULONG_PTR)RegistryPath->Buffer); break; } cur--; } /* - * Get service type. - */ - + * Get service type. + */ RtlZeroMemory(&QueryTable, sizeof(QueryTable)); RtlInitUnicodeString(&ImagePath, NULL); @@ -1930,28 +1949,23 @@ QueryTable[1].EntryContext = &ImagePath; Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE, - LoadParams->ServiceName->Buffer, + RegistryPath->Buffer, QueryTable, NULL, NULL); if (!NT_SUCCESS(Status)) { DPRINT("RtlQueryRegistryValues() failed (Status %lx)\n", Status); if (ImagePath.Buffer) ExFreePool(ImagePath.Buffer); - LoadParams->Status = Status; - KeSetEvent(&LoadParams->Event, 0, FALSE); - return; - } - - /* - * Normalize the image path for all later processing. - */ - + return Status; + } + + /* + * Normalize the image path for all later processing. + */ Status = IopNormalizeImagePath(&ImagePath, &ServiceName); if (!NT_SUCCESS(Status)) { DPRINT("IopNormalizeImagePath() failed (Status %x)\n", Status); - LoadParams->Status = Status; - KeSetEvent(&LoadParams->Event, 0, FALSE); - return; + return Status; } DPRINT("FullImagePath: '%wZ'\n", &ImagePath); @@ -1961,7 +1975,7 @@ * Get existing DriverObject pointer (in case the driver * has already been loaded and initialized). */ - Status = IopGetDriverObject(&DriverObject, + Status = IopGetDriverObject(DriverObject, &ServiceName, (Type == 2 /* SERVICE_FILE_SYSTEM_DRIVER */ || Type == 8 /* SERVICE_RECOGNIZER_DRIVER */)); @@ -1971,15 +1985,12 @@ /* * Load the driver module */ - DPRINT("Loading module from %wZ\n", &ImagePath); Status = MmLoadSystemImage(&ImagePath, NULL, NULL, 0, (PVOID)&ModuleObject, &BaseAddress); if (!NT_SUCCESS(Status)) { DPRINT("MmLoadSystemImage() failed (Status %lx)\n", Status); - LoadParams->Status = Status; - KeSetEvent(&LoadParams->Event, 0, FALSE); - return; + return Status; } /* @@ -1990,9 +2001,7 @@ { DPRINT1("IopCreateDeviceNode() failed (Status %lx)\n", Status); MmUnloadSystemImage(ModuleObject); - LoadParams->Status = Status; - KeSetEvent(&LoadParams->Event, 0, FALSE); - return; + return Status; } IopDisplayLoadingMessage(&DeviceNode->ServiceName); @@ -2002,19 +2011,17 @@ &DeviceNode->ServiceName, (Type == 2 /* SERVICE_FILE_SYSTEM_DRIVER */ || Type == 8 /* SERVICE_RECOGNIZER_DRIVER */), - &DriverObject); + DriverObject); if (!NT_SUCCESS(Status)) { DPRINT1("IopInitializeDriverModule() failed (Status %lx)\n", Status); MmUnloadSystemImage(ModuleObject); IopFreeDeviceNode(DeviceNode); - LoadParams->Status = Status; - KeSetEvent(&LoadParams->Event, 0, FALSE); - return; + return Status; } /* Initialize and start device */ - IopInitializeDevice(DeviceNode, DriverObject); + IopInitializeDevice(DeviceNode, *DriverObject); Status = IopStartDevice(DeviceNode); } else @@ -2023,12 +2030,10 @@ Status = STATUS_IMAGE_ALREADY_LOADED; /* IopGetDriverObject references the DriverObject, so dereference it */ - ObDereferenceObject(DriverObject); - } - - /* Pass status to the caller and signal the event */ - LoadParams->Status = Status; - KeSetEvent(&LoadParams->Event, 0, FALSE); + ObDereferenceObject(*DriverObject); + } + + return Status; } /* @@ -2051,7 +2056,7 @@ { UNICODE_STRING CapturedDriverServiceName = { 0, 0, NULL }; KPROCESSOR_MODE PreviousMode; - LOAD_UNLOAD_PARAMS LoadParams; + PDRIVER_OBJECT DriverObject; NTSTATUS Status; PAGED_CODE(); @@ -2081,35 +2086,14 @@ DPRINT("NtLoadDriver('%wZ')\n", &CapturedDriverServiceName); - LoadParams.ServiceName = &CapturedDriverServiceName; - LoadParams.DriverObject = NULL; - KeInitializeEvent(&LoadParams.Event, NotificationEvent, FALSE); - - /* Call the load/unload routine, depending on current process */ - if (PsGetCurrentProcess() == PsInitialSystemProcess) - { - /* Just call right away */ - IopLoadUnloadDriver(&LoadParams); - } - else - { - /* Load/Unload must be called from system process */ - ExInitializeWorkItem(&LoadParams.WorkItem, - (PWORKER_THREAD_ROUTINE)IopLoadUnloadDriver, - (PVOID)&LoadParams); - - /* Queue it */ - ExQueueWorkItem(&LoadParams.WorkItem, DelayedWorkQueue); - - /* And wait when it completes */ - KeWaitForSingleObject(&LoadParams.Event, UserRequest, KernelMode, - FALSE, NULL); - } + /* Load driver and call its entry point */ + DriverObject = NULL; + Status = IopLoadUnloadDriver(&CapturedDriverServiceName, &DriverObject); ReleaseCapturedUnicodeString(&CapturedDriverServiceName, PreviousMode); - return LoadParams.Status; + return Status; } /* @@ -2131,7 +2115,7 @@ NTSTATUS NTAPI NtUnloadDriver(IN PUNICODE_STRING DriverServiceName) { - return IopUnloadDriver(DriverServiceName, FALSE); + return IopUnloadDriver(DriverServiceName, FALSE); } /* EOF */ Modified: branches/shell-experiments/subsystems/ntvdm/io.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/subsystems/nt…
============================================================================== --- branches/shell-experiments/subsystems/ntvdm/io.c [iso-8859-1] (original) +++ branches/shell-experiments/subsystems/ntvdm/io.c [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -70,7 +70,7 @@ { UCHAR Data; ASSERT(Port <= MAXWORD); - IoPortProc[Port].VddIoHandlers.inb_handler((WORD)Port, &Data); + IoPortProc[Port].VddIoHandlers.inb_handler(Port, &Data); return Data; } else @@ -82,7 +82,7 @@ } VOID -IOReadStrB(USHORT Port, +IOReadStrB(USHORT Port, PUCHAR Buffer, ULONG Count) { @@ -96,7 +96,7 @@ { ASSERT(Port <= MAXWORD); ASSERT(Count <= MAXWORD); - IoPortProc[Port].VddIoHandlers.insb_handler((WORD)Port, Buffer, (WORD)Count); + IoPortProc[Port].VddIoHandlers.insb_handler(Port, Buffer, (WORD)Count); } else { @@ -106,7 +106,7 @@ VOID IOWriteB(USHORT Port, - UCHAR Buffer) + UCHAR Buffer) { if (IoPortProc[Port].hVdd == INVALID_HANDLE_VALUE && IoPortProc[Port].IoHandlers.OutB) @@ -117,7 +117,7 @@ IoPortProc[Port].VddIoHandlers.outb_handler) { ASSERT(Port <= MAXWORD); - IoPortProc[Port].VddIoHandlers.outb_handler((WORD)Port, Buffer); + IoPortProc[Port].VddIoHandlers.outb_handler(Port, Buffer); } else { @@ -127,7 +127,7 @@ } VOID -IOWriteStrB(USHORT Port, +IOWriteStrB(USHORT Port, PUCHAR Buffer, ULONG Count) { @@ -141,7 +141,7 @@ { ASSERT(Port <= MAXWORD); ASSERT(Count <= MAXWORD); - IoPortProc[Port].VddIoHandlers.outsb_handler((WORD)Port, Buffer, (WORD)Count); + IoPortProc[Port].VddIoHandlers.outsb_handler(Port, Buffer, (WORD)Count); } else { @@ -162,7 +162,7 @@ { USHORT Data; ASSERT(Port <= MAXWORD); - IoPortProc[Port].VddIoHandlers.inw_handler((WORD)Port, &Data); + IoPortProc[Port].VddIoHandlers.inw_handler(Port, &Data); return Data; } else @@ -177,7 +177,7 @@ } VOID -IOReadStrW(USHORT Port, +IOReadStrW(USHORT Port, PUSHORT Buffer, ULONG Count) { @@ -191,7 +191,7 @@ { ASSERT(Port <= MAXWORD); ASSERT(Count <= MAXWORD); - IoPortProc[Port].VddIoHandlers.insw_handler((WORD)Port, Buffer, (WORD)Count); + IoPortProc[Port].VddIoHandlers.insw_handler(Port, Buffer, (WORD)Count); } else { @@ -200,7 +200,7 @@ } VOID -IOWriteW(USHORT Port, +IOWriteW(USHORT Port, USHORT Buffer) { if (IoPortProc[Port].hVdd == INVALID_HANDLE_VALUE && @@ -212,7 +212,7 @@ IoPortProc[Port].VddIoHandlers.outw_handler) { ASSERT(Port <= MAXWORD); - IoPortProc[Port].VddIoHandlers.outw_handler((WORD)Port, Buffer); + IoPortProc[Port].VddIoHandlers.outw_handler(Port, Buffer); } else { @@ -223,7 +223,7 @@ } VOID -IOWriteStrW(USHORT Port, +IOWriteStrW(USHORT Port, PUSHORT Buffer, ULONG Count) { @@ -237,7 +237,7 @@ { ASSERT(Port <= MAXWORD); ASSERT(Count <= MAXWORD); - IoPortProc[Port].VddIoHandlers.outsw_handler((WORD)Port, Buffer, (WORD)Count); + IoPortProc[Port].VddIoHandlers.outsw_handler(Port, Buffer, (WORD)Count); } else { @@ -265,7 +265,7 @@ } VOID -IOReadStrD(USHORT Port, +IOReadStrD(USHORT Port, PULONG Buffer, ULONG Count) { @@ -282,7 +282,7 @@ VOID IOWriteD(USHORT Port, - ULONG Buffer) + ULONG Buffer) { if (IoPortProc[Port].hVdd == INVALID_HANDLE_VALUE && IoPortProc[Port].IoHandlers.OutD) @@ -298,7 +298,7 @@ } VOID -IOWriteStrD(USHORT Port, +IOWriteStrD(USHORT Port, PULONG Buffer, ULONG Count) { Modified: branches/shell-experiments/subsystems/ntvdm/io.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/subsystems/nt…
============================================================================== --- branches/shell-experiments/subsystems/ntvdm/io.h [iso-8859-1] (original) +++ branches/shell-experiments/subsystems/ntvdm/io.h [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -36,45 +36,45 @@ UCHAR IOReadB(USHORT Port); VOID -IOReadStrB(USHORT Port, +IOReadStrB(USHORT Port, PUCHAR Buffer, ULONG Count); VOID IOWriteB(USHORT Port, - UCHAR Buffer); + UCHAR Buffer); VOID -IOWriteStrB(USHORT Port, +IOWriteStrB(USHORT Port, PUCHAR Buffer, ULONG Count); USHORT IOReadW(USHORT Port); VOID -IOReadStrW(USHORT Port, +IOReadStrW(USHORT Port, PUSHORT Buffer, ULONG Count); VOID -IOWriteW(USHORT Port, +IOWriteW(USHORT Port, USHORT Buffer); VOID -IOWriteStrW(USHORT Port, +IOWriteStrW(USHORT Port, PUSHORT Buffer, ULONG Count); ULONG IOReadD(USHORT Port); VOID -IOReadStrD(USHORT Port, +IOReadStrD(USHORT Port, PULONG Buffer, ULONG Count); VOID IOWriteD(USHORT Port, - ULONG Buffer); + ULONG Buffer); VOID -IOWriteStrD(USHORT Port, +IOWriteStrD(USHORT Port, PULONG Buffer, ULONG Count); Modified: branches/shell-experiments/win32ss/user/ntuser/class.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/ntuser/class.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/ntuser/class.c [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -9,7 +9,6 @@ #include <win32k.h> DBG_DEFAULT_CHANNEL(UserClass); -BOOL FASTCALL IntClassDestroyIcon(HANDLE hCurIcon); static NTSTATUS IntDeregisterClassAtom(IN RTL_ATOM Atom); REGISTER_SYSCLASS DefaultServerClasses[] = @@ -251,7 +250,13 @@ if (Class->spcur) UserDereferenceObject(Class->spcur); if (Class->spicnSm) + { UserDereferenceObject(Class->spicnSm); + /* Destroy the icon if we own it */ + if ((Class->CSF_flags & CSF_CACHEDSMICON) + && !(UserObjectInDestroy(UserHMGetHandle(Class->spicnSm)))) + IntDestroyCurIconObject(Class->spicnSm); + } #else if (Class->hIconSmIntern) IntClassDestroyIcon(Class->hIconSmIntern); @@ -1969,6 +1974,7 @@ { /* We will change the small icon */ UserDereferenceObject(Class->spicnSm); + IntDestroyCurIconObject(Class->spicnSm); Class->spicnSm = NULL; Class->CSF_flags &= ~CSF_CACHEDSMICON; } @@ -1985,7 +1991,7 @@ IMAGE_ICON, UserGetSystemMetrics( SM_CXSMICON ), UserGetSystemMetrics( SM_CYSMICON ), - LR_COPYFROMRESOURCE | LR_SHARED); + LR_COPYFROMRESOURCE); } if (!SmallIconHandle) { @@ -1995,7 +2001,7 @@ IMAGE_ICON, UserGetSystemMetrics( SM_CXSMICON ), UserGetSystemMetrics( SM_CYSMICON ), - LR_SHARED); + 0); } if (SmallIconHandle) { @@ -2062,6 +2068,7 @@ #ifdef NEW_CURSORICON { PCURICON_OBJECT NewSmallIcon = NULL; + BOOLEAN NewIconFromCache = FALSE; if (NewLong) { @@ -2072,10 +2079,54 @@ return 0; } } + else + { + /* Create the new small icon from the large one */ + HICON SmallIconHandle = NULL; + if((Class->spicn->CURSORF_flags & (CURSORF_LRSHARED | CURSORF_FROMRESOURCE)) + == (CURSORF_LRSHARED | CURSORF_FROMRESOURCE)) + { + SmallIconHandle = co_IntCopyImage( + UserHMGetHandle(Class->spicn), + IMAGE_ICON, + UserGetSystemMetrics( SM_CXSMICON ), + UserGetSystemMetrics( SM_CYSMICON ), + LR_COPYFROMRESOURCE); + } + if (!SmallIconHandle) + { + /* Retry without copying from resource */ + SmallIconHandle = co_IntCopyImage( + UserHMGetHandle(Class->spicn), + IMAGE_ICON, + UserGetSystemMetrics( SM_CXSMICON ), + UserGetSystemMetrics( SM_CYSMICON ), + 0); + } + if (SmallIconHandle) + { + /* So use it */ + NewSmallIcon = UserGetCurIconObject(SmallIconHandle); + NewIconFromCache = TRUE; + } + else + { + ERR("Failed getting a small icon for the class.\n"); + } + } if (Class->spicnSm) { - Ret = (ULONG_PTR)UserHMGetHandle(Class->spicnSm); + if (Class->CSF_flags & CSF_CACHEDSMICON) + { + /* We must destroy the icon if we own it */ + IntDestroyCurIconObject(Class->spicnSm); + Ret = 0; + } + else + { + Ret = (ULONG_PTR)UserHMGetHandle(Class->spicnSm); + } UserDereferenceObject(Class->spicnSm); } else @@ -2083,7 +2134,10 @@ Ret = 0; } - Class->CSF_flags &= ~CSF_CACHEDSMICON; + if (NewIconFromCache) + Class->CSF_flags |= CSF_CACHEDSMICON; + else + Class->CSF_flags &= ~CSF_CACHEDSMICON; Class->spicnSm = NewSmallIcon; /* Update the clones */ @@ -2094,7 +2148,10 @@ UserDereferenceObject(Class->spicnSm); if (NewSmallIcon) UserReferenceObject(NewSmallIcon); - Class->CSF_flags &= ~CSF_CACHEDSMICON; + if (NewIconFromCache) + Class->CSF_flags |= CSF_CACHEDSMICON; + else + Class->CSF_flags &= ~CSF_CACHEDSMICON; Class->spicnSm = NewSmallIcon; Class = Class->pclsNext; } Modified: branches/shell-experiments/win32ss/user/ntuser/cursoricon_new.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/ntuser/cursoricon_new.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/ntuser/cursoricon_new.c [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -187,7 +187,8 @@ /* We just mark the handle as being destroyed. * Deleting all the stuff will be deferred to the actual struct free. */ - return UserDeleteObject(CurIcon->head.h, TYPE_CURSOR); + UserDeleteObject(CurIcon->head.h, TYPE_CURSOR); + return TRUE; } void @@ -357,16 +358,18 @@ /* Get the module name from the atom table */ _SEH2_TRY { - if (BufLen > (lpModule->MaximumLength * sizeof(WCHAR))) + BufLen += sizeof(WCHAR); + if (BufLen > (lpModule->MaximumLength)) { lpModule->Length = 0; + lpModule->MaximumLength = BufLen; } else { ProbeForWrite(lpModule->Buffer, lpModule->MaximumLength, 1); - BufLen = lpModule->MaximumLength * sizeof(WCHAR); + BufLen = lpModule->MaximumLength; RtlQueryAtomInAtomTable(gAtomTable, CurIcon->atomModName, NULL, NULL, lpModule->Buffer, &BufLen); - lpModule->Length = BufLen/sizeof(WCHAR); + lpModule->Length = BufLen; } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) @@ -395,15 +398,18 @@ { lpResName->Buffer = CurIcon->strName.Buffer; lpResName->Length = 0; + lpResName->MaximumLength = 0; } - else if (lpResName->MaximumLength < CurIcon->strName.Length) + else if (lpResName->MaximumLength < CurIcon->strName.MaximumLength) { lpResName->Length = 0; + lpResName->MaximumLength = CurIcon->strName.MaximumLength; } else { - ProbeForWrite(lpResName->Buffer, lpResName->MaximumLength * sizeof(WCHAR), 1); - RtlCopyMemory(lpResName->Buffer, CurIcon->strName.Buffer, lpResName->Length); + ProbeForWrite(lpResName->Buffer, lpResName->MaximumLength, 1); + RtlCopyMemory(lpResName->Buffer, CurIcon->strName.Buffer, CurIcon->strName.Length); + lpResName->Length = CurIcon->strName.Length; } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) Modified: branches/shell-experiments/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/ntuser/window.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/ntuser/window.c [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -1686,7 +1686,7 @@ IMAGE_ICON, UserGetSystemMetrics( SM_CXSMICON ), UserGetSystemMetrics( SM_CYSMICON ), - LR_COPYFROMRESOURCE | LR_SHARED); + LR_COPYFROMRESOURCE); } if (!IconSmHandle) { @@ -1696,7 +1696,7 @@ IMAGE_ICON, UserGetSystemMetrics( SM_CXSMICON ), UserGetSystemMetrics( SM_CYSMICON ), - LR_SHARED); + 0); } if (IconSmHandle) Modified: branches/shell-experiments/win32ss/user/user32/windows/cursoricon_new.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/win32ss/user/…
============================================================================== --- branches/shell-experiments/win32ss/user/user32/windows/cursoricon_new.c [iso-8859-1] (original) +++ branches/shell-experiments/win32ss/user/user32/windows/cursoricon_new.c [iso-8859-1] Thu Oct 23 19:52:45 2014 @@ -397,7 +397,7 @@ if ( dwFileSize < sizeof(*dir) ) return NULL; - if (dwFileSize < (sizeof(*dir) + FIELD_OFFSET(CURSORICONFILEDIR, idEntries[dir->idCount]))) + if (dwFileSize < FIELD_OFFSET(CURSORICONFILEDIR, idEntries[dir->idCount])) return NULL; /* @@ -1342,27 +1342,37 @@ } else RtlInitUnicodeString(&ustrRsrc, lpszName); - - /* Prepare the module name string */ - ustrModule.Buffer = HeapAlloc(GetProcessHeap(), 0, size*sizeof(WCHAR)); - /* Get it */ - do - { - DWORD ret = GetModuleFileNameW(hinst, ustrModule.Buffer, size); + + /* Get the module name string */ + while (TRUE) + { + DWORD ret; + ustrModule.Buffer = HeapAlloc(GetProcessHeap(), 0, size*sizeof(WCHAR)); + if (!ustrModule.Buffer) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return NULL; + } + ret = GetModuleFileNameW(hinst, ustrModule.Buffer, size); if(ret == 0) { HeapFree(GetProcessHeap(), 0, ustrModule.Buffer); return NULL; } - if(ret < size) + + /* This API is completely broken... */ + if (ret == size) { - ustrModule.Length = ret*sizeof(WCHAR); - ustrModule.MaximumLength = size*sizeof(WCHAR); - break; + HeapFree(GetProcessHeap(), 0, ustrModule.Buffer); + size *= 2; + continue; } - size *= 2; - ustrModule.Buffer = HeapReAlloc(GetProcessHeap(), 0, ustrModule.Buffer, size*sizeof(WCHAR)); - } while(TRUE); + + ustrModule.Buffer[ret] = UNICODE_NULL; + ustrModule.Length = ret * sizeof(WCHAR); + ustrModule.MaximumLength = size * sizeof(WCHAR); + break; + } /* Ask win32k */ param.bIcon = bIcon; @@ -1691,75 +1701,51 @@ /* Get the icon module/resource names */ UNICODE_STRING ustrModule; UNICODE_STRING ustrRsrc; - PVOID pvBuf; HMODULE hModule; - ustrModule.MaximumLength = MAX_PATH * sizeof(WCHAR); - ustrRsrc.MaximumLength = 256; - + ustrModule.MaximumLength = 0; + ustrRsrc.MaximumLength = 0; + + /* Get the buffer size */ + if (!NtUserGetIconInfo(hicon, NULL, &ustrModule, &ustrRsrc, NULL, FALSE)) + { + return NULL; + } + ustrModule.Buffer = HeapAlloc(GetProcessHeap(), 0, ustrModule.MaximumLength); if (!ustrModule.Buffer) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return NULL; } - /* Keep track of the buffer for the resource, NtUserGetIconInfo might overwrite it */ - pvBuf = HeapAlloc(GetProcessHeap(), 0, ustrRsrc.MaximumLength); - if (!pvBuf) - { - HeapFree(GetProcessHeap(), 0, ustrModule.Buffer); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return NULL; - } - ustrRsrc.Buffer = pvBuf; - - do - { - if (!NtUserGetIconInfo(hicon, NULL, &ustrModule, &ustrRsrc, NULL, FALSE)) + + if (ustrRsrc.MaximumLength) + { + ustrRsrc.Buffer = HeapAlloc(GetProcessHeap(), 0, ustrRsrc.MaximumLength); + if (!ustrRsrc.Buffer) { HeapFree(GetProcessHeap(), 0, ustrModule.Buffer); - HeapFree(GetProcessHeap(), 0, pvBuf); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); return NULL; } - - if (ustrModule.Length && (ustrRsrc.Length || IS_INTRESOURCE(ustrRsrc.Buffer))) - { - /* Buffers were big enough */ - break; - } - - /* Find which buffer were too small */ - if (!ustrModule.Length) - { - PWSTR newBuffer; - ustrModule.MaximumLength *= 2; - newBuffer = HeapReAlloc(GetProcessHeap(), 0, ustrModule.Buffer, ustrModule.MaximumLength); - if(!ustrModule.Buffer) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto leave; - } - ustrModule.Buffer = newBuffer; - } - - if (!ustrRsrc.Length) - { - ustrRsrc.MaximumLength *= 2; - pvBuf = HeapReAlloc(GetProcessHeap(), 0, ustrRsrc.Buffer, ustrRsrc.MaximumLength); - if (!pvBuf) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto leave; - } - ustrRsrc.Buffer = pvBuf; - } - } while(TRUE); + } + + if (!NtUserGetIconInfo(hicon, NULL, &ustrModule, &ustrRsrc, NULL, FALSE)) + { + HeapFree(GetProcessHeap(), 0, ustrModule.Buffer); + if (!IS_INTRESOURCE(ustrRsrc.Buffer)) + HeapFree(GetProcessHeap(), 0, ustrRsrc.Buffer); + return NULL; + } /* NULL-terminate our strings */ - ustrModule.Buffer[ustrModule.Length/sizeof(WCHAR)] = 0; + ustrModule.Buffer[ustrModule.Length/sizeof(WCHAR)] = UNICODE_NULL; if (!IS_INTRESOURCE(ustrRsrc.Buffer)) - ustrRsrc.Buffer[ustrRsrc.Length/sizeof(WCHAR)] = 0; - + ustrRsrc.Buffer[ustrRsrc.Length/sizeof(WCHAR)] = UNICODE_NULL; + + TRACE("Got module %S, resource %p (%S).\n", ustrModule.Buffer, + ustrRsrc.Buffer, IS_INTRESOURCE(ustrRsrc.Buffer) ? L"" : ustrRsrc.Buffer); + /* Get the module handle */ if (!GetModuleHandleExW(0, ustrModule.Buffer, &hModule)) { @@ -1783,7 +1769,8 @@ /* If we're here, that means that the passed icon is shared. Don't destroy it, even if LR_COPYDELETEORG is specified */ leave: HeapFree(GetProcessHeap(), 0, ustrModule.Buffer); - HeapFree(GetProcessHeap(), 0, pvBuf); + if (!IS_INTRESOURCE(ustrRsrc.Buffer)) + HeapFree(GetProcessHeap(), 0, ustrRsrc.Buffer); TRACE("Returning 0x%08x.\n", ret);
10 years, 2 months
1
0
0
0
[dquintana] 64940: [BROWSEUI] * Fix icon leak of the returned old icon from WM_SETICON. [RSHELL] * Add two debug prints (not hit). [FILEBROWSER] [EXPLORER-NEW] * Free PWSTR pointers after exiting.
by dquintana@svn.reactos.org
Author: dquintana Date: Thu Oct 23 19:50:29 2014 New Revision: 64940 URL:
http://svn.reactos.org/svn/reactos?rev=64940&view=rev
Log: [BROWSEUI] * Fix icon leak of the returned old icon from WM_SETICON. [RSHELL] * Add two debug prints (not hit). [FILEBROWSER] [EXPLORER-NEW] * Free PWSTR pointers after exiting. Modified: branches/shell-experiments/base/shell/explorer-new/explorer.c branches/shell-experiments/base/shell/filebrowser/filebrowser.c branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp Modified: branches/shell-experiments/base/shell/explorer-new/explorer.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/ex…
============================================================================== --- branches/shell-experiments/base/shell/explorer-new/explorer.c [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/explorer-new/explorer.c [iso-8859-1] Thu Oct 23 19:50:29 2014 @@ -392,14 +392,22 @@ if (GetShellWindow() == NULL) CreateShellDesktop = TRUE; - /* FIXME - initialize SSO Thread */ - if (!CreateShellDesktop) { EXPLORER_CMDLINE_PARSE_RESULTS parseResults = { 0 }; if (SHExplorerParseCmdLine(&parseResults)) return SHCreateFromDesktop(&parseResults); + + if (parseResults.strPath) + SHFree(parseResults.strPath); + + if (parseResults.pidlPath) + ILFree(parseResults.pidlPath); + + if (parseResults.pidlRoot) + ILFree(parseResults.pidlRoot); + } if (RegOpenKey(HKEY_CURRENT_USER, Modified: branches/shell-experiments/base/shell/filebrowser/filebrowser.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/fi…
============================================================================== --- branches/shell-experiments/base/shell/filebrowser/filebrowser.c [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/filebrowser/filebrowser.c [iso-8859-1] Thu Oct 23 19:50:29 2014 @@ -37,5 +37,14 @@ return SHCreateFromDesktop(&parseResults); } + if (parseResults.strPath) + SHFree(parseResults.strPath); + + if (parseResults.pidlPath) + ILFree(parseResults.pidlPath); + + if (parseResults.pidlRoot) + ILFree(parseResults.pidlRoot); + return 0; } Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] Thu Oct 23 19:50:29 2014 @@ -641,6 +641,16 @@ HRESULT CMenuFocusManager::PlaceHooks() { + if (m_hMsgFilterHook) + { + WARN("GETMESSAGE hook already placed!\n"); + return S_OK; + } + if (m_hMsgFilterHook) + { + WARN("MSGFILTER hook already placed!\n"); + return S_OK; + } if (m_current->type == TrackedMenuEntry) { TRACE("Entering MSGFILTER hook...\n"); Modified: branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] Thu Oct 23 19:50:29 2014 @@ -1078,8 +1078,11 @@ HICON icSmall = ImageList_GetIcon(himlSmall, indexOpen, 0); HICON icLarge = ImageList_GetIcon(himlLarge, indexOpen, 0); - SendMessage(WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(icSmall)); - SendMessage(WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(icLarge)); + HICON oldSmall = (HICON)SendMessage(WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(icSmall)); + HICON oldLarge = (HICON)SendMessage(WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(icLarge)); + + DestroyIcon(oldSmall); + DestroyIcon(oldLarge); } // TODO: Update the window icon
10 years, 2 months
1
0
0
0
[jgardou] 64939: [WIN32K] - Properly free classes small icon handles - Do not use LR_SHARED when copying them from the large icon. There's no reason for them to outlive the class. Should fix remain...
by jgardou@svn.reactos.org
Author: jgardou Date: Thu Oct 23 19:41:52 2014 New Revision: 64939 URL:
http://svn.reactos.org/svn/reactos?rev=64939&view=rev
Log: [WIN32K] - Properly free classes small icon handles - Do not use LR_SHARED when copying them from the large icon. There's no reason for them to outlive the class. Should fix remaining failures in user32:class that I introduced. Modified: trunk/reactos/win32ss/user/ntuser/class.c trunk/reactos/win32ss/user/ntuser/window.c Modified: trunk/reactos/win32ss/user/ntuser/class.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/class.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/class.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/class.c [iso-8859-1] Thu Oct 23 19:41:52 2014 @@ -9,7 +9,6 @@ #include <win32k.h> DBG_DEFAULT_CHANNEL(UserClass); -BOOL FASTCALL IntClassDestroyIcon(HANDLE hCurIcon); static NTSTATUS IntDeregisterClassAtom(IN RTL_ATOM Atom); REGISTER_SYSCLASS DefaultServerClasses[] = @@ -251,7 +250,13 @@ if (Class->spcur) UserDereferenceObject(Class->spcur); if (Class->spicnSm) + { UserDereferenceObject(Class->spicnSm); + /* Destroy the icon if we own it */ + if ((Class->CSF_flags & CSF_CACHEDSMICON) + && !(UserObjectInDestroy(UserHMGetHandle(Class->spicnSm)))) + IntDestroyCurIconObject(Class->spicnSm); + } #else if (Class->hIconSmIntern) IntClassDestroyIcon(Class->hIconSmIntern); @@ -1969,6 +1974,7 @@ { /* We will change the small icon */ UserDereferenceObject(Class->spicnSm); + IntDestroyCurIconObject(Class->spicnSm); Class->spicnSm = NULL; Class->CSF_flags &= ~CSF_CACHEDSMICON; } @@ -1985,7 +1991,7 @@ IMAGE_ICON, UserGetSystemMetrics( SM_CXSMICON ), UserGetSystemMetrics( SM_CYSMICON ), - LR_COPYFROMRESOURCE | LR_SHARED); + LR_COPYFROMRESOURCE); } if (!SmallIconHandle) { @@ -1995,7 +2001,7 @@ IMAGE_ICON, UserGetSystemMetrics( SM_CXSMICON ), UserGetSystemMetrics( SM_CYSMICON ), - LR_SHARED); + 0); } if (SmallIconHandle) { @@ -2062,6 +2068,7 @@ #ifdef NEW_CURSORICON { PCURICON_OBJECT NewSmallIcon = NULL; + BOOLEAN NewIconFromCache = FALSE; if (NewLong) { @@ -2072,10 +2079,54 @@ return 0; } } + else + { + /* Create the new small icon from the large one */ + HICON SmallIconHandle = NULL; + if((Class->spicn->CURSORF_flags & (CURSORF_LRSHARED | CURSORF_FROMRESOURCE)) + == (CURSORF_LRSHARED | CURSORF_FROMRESOURCE)) + { + SmallIconHandle = co_IntCopyImage( + UserHMGetHandle(Class->spicn), + IMAGE_ICON, + UserGetSystemMetrics( SM_CXSMICON ), + UserGetSystemMetrics( SM_CYSMICON ), + LR_COPYFROMRESOURCE); + } + if (!SmallIconHandle) + { + /* Retry without copying from resource */ + SmallIconHandle = co_IntCopyImage( + UserHMGetHandle(Class->spicn), + IMAGE_ICON, + UserGetSystemMetrics( SM_CXSMICON ), + UserGetSystemMetrics( SM_CYSMICON ), + 0); + } + if (SmallIconHandle) + { + /* So use it */ + NewSmallIcon = UserGetCurIconObject(SmallIconHandle); + NewIconFromCache = TRUE; + } + else + { + ERR("Failed getting a small icon for the class.\n"); + } + } if (Class->spicnSm) { - Ret = (ULONG_PTR)UserHMGetHandle(Class->spicnSm); + if (Class->CSF_flags & CSF_CACHEDSMICON) + { + /* We must destroy the icon if we own it */ + IntDestroyCurIconObject(Class->spicnSm); + Ret = 0; + } + else + { + Ret = (ULONG_PTR)UserHMGetHandle(Class->spicnSm); + } UserDereferenceObject(Class->spicnSm); } else @@ -2083,7 +2134,10 @@ Ret = 0; } - Class->CSF_flags &= ~CSF_CACHEDSMICON; + if (NewIconFromCache) + Class->CSF_flags |= CSF_CACHEDSMICON; + else + Class->CSF_flags &= ~CSF_CACHEDSMICON; Class->spicnSm = NewSmallIcon; /* Update the clones */ @@ -2094,7 +2148,10 @@ UserDereferenceObject(Class->spicnSm); if (NewSmallIcon) UserReferenceObject(NewSmallIcon); - Class->CSF_flags &= ~CSF_CACHEDSMICON; + if (NewIconFromCache) + Class->CSF_flags |= CSF_CACHEDSMICON; + else + Class->CSF_flags &= ~CSF_CACHEDSMICON; Class->spicnSm = NewSmallIcon; Class = Class->pclsNext; } Modified: trunk/reactos/win32ss/user/ntuser/window.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/window…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/window.c [iso-8859-1] Thu Oct 23 19:41:52 2014 @@ -1686,7 +1686,7 @@ IMAGE_ICON, UserGetSystemMetrics( SM_CXSMICON ), UserGetSystemMetrics( SM_CYSMICON ), - LR_COPYFROMRESOURCE | LR_SHARED); + LR_COPYFROMRESOURCE); } if (!IconSmHandle) { @@ -1696,7 +1696,7 @@ IMAGE_ICON, UserGetSystemMetrics( SM_CXSMICON ), UserGetSystemMetrics( SM_CYSMICON ), - LR_SHARED); + 0); } if (IconSmHandle)
10 years, 2 months
1
0
0
0
[jgardou] 64938: [WIN32K/USER32] - Simplify an overcomplicated way to get buffer size from win32k - Do not spaghettize between string length and buffer size. - Properly use GetModuleFileName.
by jgardou@svn.reactos.org
Author: jgardou Date: Thu Oct 23 19:41:42 2014 New Revision: 64938 URL:
http://svn.reactos.org/svn/reactos?rev=64938&view=rev
Log: [WIN32K/USER32] - Simplify an overcomplicated way to get buffer size from win32k - Do not spaghettize between string length and buffer size. - Properly use GetModuleFileName. Modified: trunk/reactos/win32ss/user/ntuser/cursoricon_new.c trunk/reactos/win32ss/user/user32/windows/cursoricon_new.c Modified: trunk/reactos/win32ss/user/ntuser/cursoricon_new.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/cursor…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/cursoricon_new.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/cursoricon_new.c [iso-8859-1] Thu Oct 23 19:41:42 2014 @@ -187,7 +187,8 @@ /* We just mark the handle as being destroyed. * Deleting all the stuff will be deferred to the actual struct free. */ - return UserDeleteObject(CurIcon->head.h, TYPE_CURSOR); + UserDeleteObject(CurIcon->head.h, TYPE_CURSOR); + return TRUE; } void @@ -357,16 +358,18 @@ /* Get the module name from the atom table */ _SEH2_TRY { - if (BufLen > (lpModule->MaximumLength * sizeof(WCHAR))) + BufLen += sizeof(WCHAR); + if (BufLen > (lpModule->MaximumLength)) { lpModule->Length = 0; + lpModule->MaximumLength = BufLen; } else { ProbeForWrite(lpModule->Buffer, lpModule->MaximumLength, 1); - BufLen = lpModule->MaximumLength * sizeof(WCHAR); + BufLen = lpModule->MaximumLength; RtlQueryAtomInAtomTable(gAtomTable, CurIcon->atomModName, NULL, NULL, lpModule->Buffer, &BufLen); - lpModule->Length = BufLen/sizeof(WCHAR); + lpModule->Length = BufLen; } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) @@ -395,15 +398,18 @@ { lpResName->Buffer = CurIcon->strName.Buffer; lpResName->Length = 0; + lpResName->MaximumLength = 0; } - else if (lpResName->MaximumLength < CurIcon->strName.Length) + else if (lpResName->MaximumLength < CurIcon->strName.MaximumLength) { lpResName->Length = 0; + lpResName->MaximumLength = CurIcon->strName.MaximumLength; } else { - ProbeForWrite(lpResName->Buffer, lpResName->MaximumLength * sizeof(WCHAR), 1); - RtlCopyMemory(lpResName->Buffer, CurIcon->strName.Buffer, lpResName->Length); + ProbeForWrite(lpResName->Buffer, lpResName->MaximumLength, 1); + RtlCopyMemory(lpResName->Buffer, CurIcon->strName.Buffer, CurIcon->strName.Length); + lpResName->Length = CurIcon->strName.Length; } } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) Modified: trunk/reactos/win32ss/user/user32/windows/cursoricon_new.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/cursoricon_new.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/cursoricon_new.c [iso-8859-1] Thu Oct 23 19:41:42 2014 @@ -1342,27 +1342,37 @@ } else RtlInitUnicodeString(&ustrRsrc, lpszName); - - /* Prepare the module name string */ - ustrModule.Buffer = HeapAlloc(GetProcessHeap(), 0, size*sizeof(WCHAR)); - /* Get it */ - do - { - DWORD ret = GetModuleFileNameW(hinst, ustrModule.Buffer, size); + + /* Get the module name string */ + while (TRUE) + { + DWORD ret; + ustrModule.Buffer = HeapAlloc(GetProcessHeap(), 0, size*sizeof(WCHAR)); + if (!ustrModule.Buffer) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return NULL; + } + ret = GetModuleFileNameW(hinst, ustrModule.Buffer, size); if(ret == 0) { HeapFree(GetProcessHeap(), 0, ustrModule.Buffer); return NULL; } - if(ret < size) + + /* This API is completely broken... */ + if (ret == size) { - ustrModule.Length = ret*sizeof(WCHAR); - ustrModule.MaximumLength = size*sizeof(WCHAR); - break; + HeapFree(GetProcessHeap(), 0, ustrModule.Buffer); + size *= 2; + continue; } - size *= 2; - ustrModule.Buffer = HeapReAlloc(GetProcessHeap(), 0, ustrModule.Buffer, size*sizeof(WCHAR)); - } while(TRUE); + + ustrModule.Buffer[ret] = UNICODE_NULL; + ustrModule.Length = ret * sizeof(WCHAR); + ustrModule.MaximumLength = size * sizeof(WCHAR); + break; + } /* Ask win32k */ param.bIcon = bIcon; @@ -1691,75 +1701,51 @@ /* Get the icon module/resource names */ UNICODE_STRING ustrModule; UNICODE_STRING ustrRsrc; - PVOID pvBuf; HMODULE hModule; - ustrModule.MaximumLength = MAX_PATH * sizeof(WCHAR); - ustrRsrc.MaximumLength = 256; - + ustrModule.MaximumLength = 0; + ustrRsrc.MaximumLength = 0; + + /* Get the buffer size */ + if (!NtUserGetIconInfo(hicon, NULL, &ustrModule, &ustrRsrc, NULL, FALSE)) + { + return NULL; + } + ustrModule.Buffer = HeapAlloc(GetProcessHeap(), 0, ustrModule.MaximumLength); if (!ustrModule.Buffer) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); return NULL; } - /* Keep track of the buffer for the resource, NtUserGetIconInfo might overwrite it */ - pvBuf = HeapAlloc(GetProcessHeap(), 0, ustrRsrc.MaximumLength); - if (!pvBuf) - { - HeapFree(GetProcessHeap(), 0, ustrModule.Buffer); - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return NULL; - } - ustrRsrc.Buffer = pvBuf; - - do - { - if (!NtUserGetIconInfo(hicon, NULL, &ustrModule, &ustrRsrc, NULL, FALSE)) + + if (ustrRsrc.MaximumLength) + { + ustrRsrc.Buffer = HeapAlloc(GetProcessHeap(), 0, ustrRsrc.MaximumLength); + if (!ustrRsrc.Buffer) { HeapFree(GetProcessHeap(), 0, ustrModule.Buffer); - HeapFree(GetProcessHeap(), 0, pvBuf); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); return NULL; } - - if (ustrModule.Length && (ustrRsrc.Length || IS_INTRESOURCE(ustrRsrc.Buffer))) - { - /* Buffers were big enough */ - break; - } - - /* Find which buffer were too small */ - if (!ustrModule.Length) - { - PWSTR newBuffer; - ustrModule.MaximumLength *= 2; - newBuffer = HeapReAlloc(GetProcessHeap(), 0, ustrModule.Buffer, ustrModule.MaximumLength); - if(!ustrModule.Buffer) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto leave; - } - ustrModule.Buffer = newBuffer; - } - - if (!ustrRsrc.Length) - { - ustrRsrc.MaximumLength *= 2; - pvBuf = HeapReAlloc(GetProcessHeap(), 0, ustrRsrc.Buffer, ustrRsrc.MaximumLength); - if (!pvBuf) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - goto leave; - } - ustrRsrc.Buffer = pvBuf; - } - } while(TRUE); + } + + if (!NtUserGetIconInfo(hicon, NULL, &ustrModule, &ustrRsrc, NULL, FALSE)) + { + HeapFree(GetProcessHeap(), 0, ustrModule.Buffer); + if (!IS_INTRESOURCE(ustrRsrc.Buffer)) + HeapFree(GetProcessHeap(), 0, ustrRsrc.Buffer); + return NULL; + } /* NULL-terminate our strings */ - ustrModule.Buffer[ustrModule.Length/sizeof(WCHAR)] = 0; + ustrModule.Buffer[ustrModule.Length/sizeof(WCHAR)] = UNICODE_NULL; if (!IS_INTRESOURCE(ustrRsrc.Buffer)) - ustrRsrc.Buffer[ustrRsrc.Length/sizeof(WCHAR)] = 0; - + ustrRsrc.Buffer[ustrRsrc.Length/sizeof(WCHAR)] = UNICODE_NULL; + + TRACE("Got module %S, resource %p (%S).\n", ustrModule.Buffer, + ustrRsrc.Buffer, IS_INTRESOURCE(ustrRsrc.Buffer) ? L"" : ustrRsrc.Buffer); + /* Get the module handle */ if (!GetModuleHandleExW(0, ustrModule.Buffer, &hModule)) { @@ -1783,7 +1769,8 @@ /* If we're here, that means that the passed icon is shared. Don't destroy it, even if LR_COPYDELETEORG is specified */ leave: HeapFree(GetProcessHeap(), 0, ustrModule.Buffer); - HeapFree(GetProcessHeap(), 0, pvBuf); + if (!IS_INTRESOURCE(ustrRsrc.Buffer)) + HeapFree(GetProcessHeap(), 0, ustrRsrc.Buffer); TRACE("Returning 0x%08x.\n", ret);
10 years, 2 months
1
0
0
0
[akhaldi] 64937: [ADVAPI32] * Introduce a wine folder to group the Wine synced source files. * Use the crypt folder as a starting point. More will follow. CORE-8540
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Oct 23 18:58:35 2014 New Revision: 64937 URL:
http://svn.reactos.org/svn/reactos?rev=64937&view=rev
Log: [ADVAPI32] * Introduce a wine folder to group the Wine synced source files. * Use the crypt folder as a starting point. More will follow. CORE-8540 Added: trunk/reactos/dll/win32/advapi32/wine/ - copied from r64935, trunk/reactos/dll/win32/advapi32/crypt/ Removed: trunk/reactos/dll/win32/advapi32/crypt/ Modified: trunk/reactos/dll/win32/advapi32/CMakeLists.txt trunk/reactos/dll/win32/advapi32/advapi32.h trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/advapi32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/advapi32/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/CMakeLists.txt [iso-8859-1] Thu Oct 23 18:58:35 2014 @@ -17,9 +17,6 @@ ${REACTOS_SOURCE_DIR}/include/reactos/idl/svcctl.idl) list(APPEND SOURCE - crypt/crypt.c - crypt/crypt_des.c - crypt/crypt_lmhash.c misc/dllmain.c misc/efs.c misc/hwprofiles.c @@ -44,6 +41,9 @@ service/sctrl.c token/privilege.c token/token.c + wine/crypt.c + wine/crypt_des.c + wine/crypt_lmhash.c advapi32.h) add_library(advapi32 SHARED Modified: trunk/reactos/dll/win32/advapi32/advapi32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/advapi3…
============================================================================== --- trunk/reactos/dll/win32/advapi32/advapi32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/advapi32/advapi32.h [iso-8859-1] Thu Oct 23 18:58:35 2014 @@ -39,7 +39,7 @@ #include <wine/debug.h> #include <wine/unicode.h> -#include "crypt/crypt.h" +#include "wine/crypt.h" #ifndef HAS_FN_PROGRESSW #define FN_PROGRESSW FN_PROGRESS Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu Oct 23 18:58:35 2014 @@ -256,9 +256,11 @@ reactos/lib/3rdparty/strmbase # Synced to Wine-1.7.27 advapi32 - - reactos/dll/win32/advapi32/crypt/*.c # Synced to Wine-1.7.27 - reactos/dll/win32/advapi32/sec/cred.c # Synced to Wine-1.7.27 - reactos/dll/win32/advapi32/sec/sid.c # Out of Sync + reactos/dll/win32/advapi32/wine/crypt.c # Synced to Wine-1.7.27 + reactos/dll/win32/advapi32/wine/crypt_des.c # Synced to Wine-1.7.27 + reactos/dll/win32/advapi32/wine/crypt_lmhash.c # Synced to Wine-1.7.27 + reactos/dll/win32/advapi32/sec/cred.c # Synced to Wine-1.7.27 + reactos/dll/win32/advapi32/sec/sid.c # Out of Sync gdi32 - reactos/dll/win32/gdi32/objects/linedda.c # Synced at 20090410
10 years, 2 months
1
0
0
0
[akhaldi] 64936: [PCIX] * PciIdPrintfAppend is a vararg too.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Oct 23 18:51:12 2014 New Revision: 64936 URL:
http://svn.reactos.org/svn/reactos?rev=64936&view=rev
Log: [PCIX] * PciIdPrintfAppend is a vararg too. Modified: trunk/reactos/drivers/bus/pcix/pci/id.c Modified: trunk/reactos/drivers/bus/pcix/pci/id.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pci/id.c?…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pci/id.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pci/id.c [iso-8859-1] Thu Oct 23 18:51:12 2014 @@ -153,7 +153,7 @@ } ULONG -NTAPI +__cdecl PciIdPrintfAppend(IN PPCI_ID_BUFFER IdBuffer, IN PCCH Format, ...)
10 years, 2 months
1
0
0
0
[akhaldi] 64935: [PCIX] * PciIdPrintf is a vararg.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Oct 23 18:42:39 2014 New Revision: 64935 URL:
http://svn.reactos.org/svn/reactos?rev=64935&view=rev
Log: [PCIX] * PciIdPrintf is a vararg. Modified: trunk/reactos/drivers/bus/pcix/pci/id.c Modified: trunk/reactos/drivers/bus/pcix/pci/id.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/pcix/pci/id.c?…
============================================================================== --- trunk/reactos/drivers/bus/pcix/pci/id.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/pcix/pci/id.c [iso-8859-1] Thu Oct 23 18:42:39 2014 @@ -118,7 +118,7 @@ } ULONG -NTAPI +__cdecl PciIdPrintf(IN PPCI_ID_BUFFER IdBuffer, IN PCCH Format, ...)
10 years, 2 months
1
0
0
0
[ekohl] 64934: [NET] Implement the first part of the NET USER command.
by ekohl@svn.reactos.org
Author: ekohl Date: Thu Oct 23 18:36:11 2014 New Revision: 64934 URL:
http://svn.reactos.org/svn/reactos?rev=64934&view=rev
Log: [NET] Implement the first part of the NET USER command. Added: trunk/reactos/base/applications/network/net/cmdUser.c (with props) Modified: trunk/reactos/base/applications/network/net/CMakeLists.txt trunk/reactos/base/applications/network/net/lang/en-US.rc trunk/reactos/base/applications/network/net/lang/ro-RO.rc trunk/reactos/base/applications/network/net/lang/ru-RU.rc trunk/reactos/base/applications/network/net/main.c trunk/reactos/base/applications/network/net/net.h Modified: trunk/reactos/base/applications/network/net/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/net/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/net/CMakeLists.txt [iso-8859-1] Thu Oct 23 18:36:11 2014 @@ -10,6 +10,7 @@ cmdPause.c cmdStart.c cmdStop.c + cmdUser.c help.c net.h) Added: trunk/reactos/base/applications/network/net/cmdUser.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/net/cmdUser.c (added) +++ trunk/reactos/base/applications/network/net/cmdUser.c [iso-8859-1] Thu Oct 23 18:36:11 2014 @@ -0,0 +1,348 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS net command + * FILE: + * PURPOSE: + * + * PROGRAMMERS: Eric Kohl + */ + +#include "net.h" + + +static +int +CompareInfo(const void *a, + const void *b) +{ + return _wcsicmp(((PUSER_INFO_0)a)->usri0_name, + ((PUSER_INFO_0)b)->usri0_name); +} + + +static +NET_API_STATUS +EnumerateUsers(VOID) +{ + PUSER_INFO_0 pBuffer = NULL; + PSERVER_INFO_100 pServer = NULL; + DWORD dwRead = 0, dwTotal = 0; + DWORD i; + DWORD_PTR ResumeHandle = 0; + NET_API_STATUS Status; + + Status = NetServerGetInfo(NULL, + 100, + (LPBYTE*)&pServer); + if (Status != NERR_Success) + return Status; + + printf("\nUser accounts for \\\\%S\n\n", pServer->sv100_name); + + NetApiBufferFree(pServer); + + printf("------------------------------------------\n"); + + Status = NetUserEnum(NULL, + 0, + 0, + (LPBYTE*)&pBuffer, + MAX_PREFERRED_LENGTH, + &dwRead, + &dwTotal, + &ResumeHandle); + if (Status != NERR_Success) + return Status; + + qsort(pBuffer, + dwRead, + sizeof(PUSER_INFO_0), + CompareInfo); + +// printf("dwRead: %lu dwTotal: %lu\n", dwRead, dwTotal); + for (i = 0; i < dwRead; i++) + { +// printf("%p\n", pBuffer[i].lgrpi0_name); + if (pBuffer[i].usri0_name) + printf("%S\n", pBuffer[i].usri0_name); + } + + NetApiBufferFree(pBuffer); + + return NERR_Success; +} + + +static +VOID +PrintDateTime(DWORD dwSeconds) +{ + LARGE_INTEGER Time; + FILETIME FileTime; + SYSTEMTIME SystemTime; + WCHAR DateBuffer[80]; + WCHAR TimeBuffer[80]; + + RtlSecondsSince1970ToTime(dwSeconds, &Time); + FileTime.dwLowDateTime = Time.u.LowPart; + FileTime.dwHighDateTime = Time.u.HighPart; + FileTimeToSystemTime(&FileTime, &SystemTime); + + GetDateFormatW(LOCALE_USER_DEFAULT, + DATE_SHORTDATE, + &SystemTime, + NULL, + DateBuffer, + 80); + + GetTimeFormatW(LOCALE_USER_DEFAULT, + TIME_NOSECONDS, + &SystemTime, + NULL, + TimeBuffer, + 80); + + printf("%S %S\n", DateBuffer, TimeBuffer); +} + + +static +NET_API_STATUS +DisplayUser(LPWSTR lpUserName) +{ + PUSER_INFO_4 pUserInfo = NULL; + NET_API_STATUS Status; + + /* Modify the user */ + Status = NetUserGetInfo(NULL, + lpUserName, + 4, + (LPBYTE*)&pUserInfo); + if (Status != NERR_Success) + return Status; + + printf("User name %S\n", pUserInfo->usri4_name); + printf("Full name %S\n", pUserInfo->usri4_full_name); + printf("Comment %S\n", pUserInfo->usri4_comment); + printf("User comment %S\n", pUserInfo->usri4_usr_comment); + printf("Country code %03ld ()\n", pUserInfo->usri4_country_code); + printf("Account active %S\n", (pUserInfo->usri4_flags & UF_ACCOUNTDISABLE)? L"No" : ((pUserInfo->usri4_flags & UF_LOCKOUT) ? L"Locked" : L"Yes")); + printf("Account expires "); + if (pUserInfo->usri4_acct_expires == TIMEQ_FOREVER) + printf("Never\n"); + else + PrintDateTime(pUserInfo->usri4_acct_expires); + + printf("\n"); + printf("Password last set \n"); + printf("Password expires \n"); + printf("Password changeable \n"); + printf("Password required \n"); + printf("User may change password \n"); + printf("\n"); + printf("Workstation allowed %S\n", pUserInfo->usri4_workstations); + printf("Logon script %S\n", pUserInfo->usri4_script_path); + printf("User profile %S\n", pUserInfo->usri4_profile); + printf("Home directory %S\n", pUserInfo->usri4_home_dir); + printf("Last logon "); + if (pUserInfo->usri4_last_logon == 0) + printf("Never\n"); + else + PrintDateTime(pUserInfo->usri4_last_logon); + printf("\n"); + printf("Logon hours allowed \n"); + printf("\n"); + printf("Local group memberships \n"); + printf("Global group memberships \n"); + + if (pUserInfo != NULL) + NetApiBufferFree(pUserInfo); + + return NERR_Success; +} + + +INT +cmdUser( + INT argc, + WCHAR **argv) +{ + INT i, j; + INT result = 0; + BOOL bAdd = FALSE; + BOOL bDelete = FALSE; +#if 0 + BOOL bDomain = FALSE; +#endif + LPWSTR lpUserName = NULL; + LPWSTR lpPassword = NULL; + PUSER_INFO_4 pUserInfo = NULL; + USER_INFO_4 UserInfo; + NET_API_STATUS Status; + + if (argc == 2) + { + Status = EnumerateUsers(); + printf("Status: %lu\n", Status); + return 0; + } + else if (argc == 3) + { + Status = DisplayUser(argv[2]); + printf("Status: %lu\n", Status); + return 0; + } + + i = 2; + if (argv[i][0] != L'/') + { + lpUserName = argv[i]; + printf("User: %S\n", lpUserName); + i++; + } + + if (argv[i][0] != L'/') + { + lpPassword = argv[i]; + printf("Password: %S\n", lpPassword); + i++; + } + + for (j = i; j < argc; j++) + { + if (_wcsicmp(argv[j], L"/help") == 0) + { + PrintResourceString(IDS_USER_HELP); + return 0; + } + else if (_wcsicmp(argv[j], L"/add") == 0) + { + bAdd = TRUE; + } + else if (_wcsicmp(argv[j], L"/delete") == 0) + { + bDelete = TRUE; + } + else if (_wcsicmp(argv[j], L"/domain") == 0) + { + printf("The /DOMAIN option is not supported yet!\n"); +#if 0 + bDomain = TRUE; +#endif + } + } + + if (bAdd && bDelete) + { + result = 1; + goto done; + } + + if (!bAdd && !bDelete) + { + /* Modify the user */ + Status = NetUserGetInfo(NULL, + lpUserName, + 4, + (LPBYTE*)&pUserInfo); + printf("Status: %lu\n", Status); + } + else if (bAdd && !bDelete) + { + /* Add the user */ + ZeroMemory(&UserInfo, sizeof(USER_INFO_4)); + + UserInfo.usri4_name = lpUserName; + UserInfo.usri4_password = lpPassword; + UserInfo.usri4_flags = UF_SCRIPT | UF_NORMAL_ACCOUNT; + + pUserInfo = &UserInfo; + } + + for (j = i; j < argc; j++) + { + if (_wcsnicmp(argv[j], L"/active:", 8) == 0) + { + } + else if (_wcsnicmp(argv[j], L"/comment:", 9) == 0) + { + pUserInfo->usri4_comment = &argv[j][9]; + } + else if (_wcsnicmp(argv[j], L"/countrycode:", 13) == 0) + { + } + else if (_wcsnicmp(argv[j], L"/expires:", 9) == 0) + { + } + else if (_wcsnicmp(argv[j], L"/fullname:", 10) == 0) + { + pUserInfo->usri4_full_name = &argv[j][10]; + } + else if (_wcsnicmp(argv[j], L"/homedir:", 9) == 0) + { + pUserInfo->usri4_home_dir = &argv[j][9]; + } + else if (_wcsnicmp(argv[j], L"/passwordchg:", 13) == 0) + { + } + else if (_wcsnicmp(argv[j], L"/passwordreq:", 13) == 0) + { + } + else if (_wcsnicmp(argv[j], L"/profilepath:", 13) == 0) + { + pUserInfo->usri4_profile = &argv[j][13]; + } + else if (_wcsnicmp(argv[j], L"/scriptpath:", 12) == 0) + { + pUserInfo->usri4_script_path = &argv[j][12]; + } + else if (_wcsnicmp(argv[j], L"/times:", 7) == 0) + { + } + else if (_wcsnicmp(argv[j], L"/usercomment:", 13) == 0) + { + pUserInfo->usri4_usr_comment = &argv[j][13]; + } + else if (_wcsnicmp(argv[j], L"/workstations:", 14) == 0) + { + } + } + + if (!bAdd && !bDelete) + { + /* Modify the user */ + Status = NetUserSetInfo(NULL, + lpUserName, + 4, + (LPBYTE)pUserInfo, + NULL); + printf("Status: %lu\n", Status); + } + else if (bAdd && !bDelete) + { + /* Add the user */ + Status = NetUserAdd(NULL, + 4, + (LPBYTE)pUserInfo, + NULL); + printf("Status: %lu\n", Status); + } + else if (!bAdd && bDelete) + { + /* Delete the user */ + Status = NetUserDel(NULL, + lpUserName); + printf("Status: %lu\n", Status); + } + +done: + if (!bAdd && !bDelete && pUserInfo != NULL) + NetApiBufferFree(pUserInfo); + + if (result != 0) + PrintResourceString(IDS_USER_SYNTAX); + + return result; +} + +/* EOF */ Propchange: trunk/reactos/base/applications/network/net/cmdUser.c ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/base/applications/network/net/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/net/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/net/lang/en-US.rc [iso-8859-1] Thu Oct 23 18:36:11 2014 @@ -44,7 +44,9 @@ IDS_TIME_HELP "TIME\n..." IDS_USE_SYNTAX "Usage:\nNET USE ..." IDS_USE_HELP "USE\n..." - IDS_USER_SYNTAX "Usage:\nNET USER ..." + IDS_USER_SYNTAX "Usage:\nNET USER [username [password | *] [options]] [/DOMAIN]\n\ + username {password | *} /ADD [options] [/DOMAIN]\n\ + username [/DELETE] [/DOMAIN]" IDS_USER_HELP "USER\n..." IDS_VIEW_SYNTAX "Usage:\nNET VIEW ..." IDS_VIEW_HELP "VIEW\n..." Modified: trunk/reactos/base/applications/network/net/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/net/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/net/lang/ro-RO.rc [iso-8859-1] Thu Oct 23 18:36:11 2014 @@ -50,7 +50,9 @@ IDS_TIME_HELP "TIME\n..." IDS_USE_SYNTAX "Utilizare:\nNET USE ..." IDS_USE_HELP "USE\n..." - IDS_USER_SYNTAX "Utilizare:\nNET USER ..." + IDS_USER_SYNTAX "Utilizare:\nNET USER [username [password | *] [options]] [/DOMAIN]\n\ + username {password | *} /ADD [options] [/DOMAIN]\n\ + username [/DELETE] [/DOMAIN]" IDS_USER_HELP "USER\n..." IDS_VIEW_SYNTAX "Utilizare:\nNET VIEW ..." IDS_VIEW_HELP "VIEW\n..." Modified: trunk/reactos/base/applications/network/net/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/net/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/net/lang/ru-RU.rc [iso-8859-1] Thu Oct 23 18:36:11 2014 @@ -45,7 +45,9 @@ IDS_TIME_HELP "TIME\n..." IDS_USE_SYNTAX "ÐÑполÑзование:\nNET USE ..." IDS_USE_HELP "USE\n..." - IDS_USER_SYNTAX "ÐÑполÑзование:\nNET USER ..." + IDS_USER_SYNTAX "ÐÑполÑзование:\nNET USER [username [password | *] [options]] [/DOMAIN]\n\ + username {password | *} /ADD [options] [/DOMAIN]\n\ + username [/DELETE] [/DOMAIN]" IDS_USER_HELP "USER\n..." IDS_VIEW_SYNTAX "ÐÑполÑзование:\nNET VIEW ..." IDS_VIEW_HELP "VIEW\n..." Modified: trunk/reactos/base/applications/network/net/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/net/main.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/net/main.c [iso-8859-1] Thu Oct 23 18:36:11 2014 @@ -40,7 +40,7 @@ {L"stop", cmdStop}, {L"time", unimplemented}, {L"use", unimplemented}, - {L"user", unimplemented}, + {L"user", cmdUser}, {L"view", unimplemented}, {NULL, NULL} }; Modified: trunk/reactos/base/applications/network/net/net.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
============================================================================== --- trunk/reactos/base/applications/network/net/net.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/network/net/net.h [iso-8859-1] Thu Oct 23 18:36:11 2014 @@ -13,6 +13,7 @@ #include <windef.h> #include <winbase.h> +#include <winnls.h> #include <winuser.h> #include <winsvc.h> #include <stdio.h> @@ -39,5 +40,6 @@ INT cmdPause(INT argc, WCHAR **argv); INT cmdStart(INT argc, WCHAR **argv); INT cmdStop(INT argc, WCHAR **argv); +INT cmdUser(INT argc, WCHAR **argv); #endif /* _NET_PCH_ */
10 years, 2 months
1
0
0
0
[akhaldi] 64933: [COMPBATT] * Arch, don't return NTSTATUS instead of PCOMPBATT_BATTERY_DATA!
by akhaldi@svn.reactos.org
Author: akhaldi Date: Thu Oct 23 18:33:21 2014 New Revision: 64933 URL:
http://svn.reactos.org/svn/reactos?rev=64933&view=rev
Log: [COMPBATT] * Arch, don't return NTSTATUS instead of PCOMPBATT_BATTERY_DATA! Modified: trunk/reactos/drivers/bus/acpi/compbatt/comppnp.c Modified: trunk/reactos/drivers/bus/acpi/compbatt/comppnp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/compbatt/…
============================================================================== --- trunk/reactos/drivers/bus/acpi/compbatt/comppnp.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/compbatt/comppnp.c [iso-8859-1] Thu Oct 23 18:33:21 2014 @@ -69,7 +69,7 @@ /* Done */ ExReleaseFastMutex(&DeviceExtension->Lock); if (CompBattDebug & 1) DbgPrint("CompBatt: EXITING RemoveBatteryFromList\n"); - return STATUS_SUCCESS; + return NULL; } BOOLEAN
10 years, 2 months
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
73
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Results per page:
10
25
50
100
200