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
November 2017
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
22 participants
186 discussions
Start a n
N
ew thread
[reactos] 01/01: [SETUPAPI] GetDeviceInstanceKeyPath: Implement the CM_REGISTRY_SOFTWARE | CM_REGISTRY_CONFIG part.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8e850d19bceb0a73147ee…
commit 8e850d19bceb0a73147ee09c282adeb10850358a Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sun Nov 5 09:39:44 2017 +0100 [SETUPAPI] GetDeviceInstanceKeyPath: Implement the CM_REGISTRY_SOFTWARE | CM_REGISTRY_CONFIG part. --- dll/win32/setupapi/cfgmgr.c | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c index 362d34e14e..e67db054c9 100644 --- a/dll/win32/setupapi/cfgmgr.c +++ b/dll/win32/setupapi/cfgmgr.c @@ -210,7 +210,36 @@ GetDeviceInstanceKeyPath( if (ulFlags & CM_REGISTRY_SOFTWARE) { /* Software Key Path */ - ret = CR_CALL_NOT_IMPLEMENTED; + + if (ulFlags & CM_REGISTRY_CONFIG) + { + SplitDeviceInstanceId(pszDeviceInst, + pszBuffer, + pszInstancePath); + + if (ulHardwareProfile == 0) + { + wsprintfW(pszKeyPath, + L"%s\\%s\\%s\\%s", + L"System\\CurrentControlSet\\Hardware Profiles", + L"Current", + L"System\\CurrentControlSet\\Control\\Enum", + pszBuffer); + } + else + { + wsprintfW(pszKeyPath, + L"%s\\%04lu\\%s\\%s", + L"System\\CurrentControlSet\\Hardware Profiles", + ulHardwareProfile, + L"System\\CurrentControlSet\\Control\\Enum", + pszBuffer); + } + } + else + { + ret = CR_CALL_NOT_IMPLEMENTED; + } } else {
7 years, 1 month
1
0
0
0
[reactos] 01/01: [CDFS] Addendum to 03a9d8c: check for volume state (locked?) before opening a file CORE-13957
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a2ed758a205cedcafbc83…
commit a2ed758a205cedcafbc836e4ca5ac6b87d60c2e6 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sat Nov 4 21:31:35 2017 +0100 [CDFS] Addendum to 03a9d8c: check for volume state (locked?) before opening a file CORE-13957 --- drivers/filesystems/cdfs/create.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/filesystems/cdfs/create.c b/drivers/filesystems/cdfs/create.c index 09a054bf1b..dde7a2404d 100644 --- a/drivers/filesystems/cdfs/create.c +++ b/drivers/filesystems/cdfs/create.c @@ -222,6 +222,11 @@ CdfsCreateFile(PDEVICE_OBJECT DeviceObject, return STATUS_ACCESS_DENIED; } + if (BooleanFlagOn(DeviceExt->Flags, VCB_VOLUME_LOCKED)) + { + return STATUS_ACCESS_DENIED; + } + Status = CdfsOpenFile(DeviceExt, FileObject, &FileObject->FileName);
7 years, 1 month
1
0
0
0
[reactos] 01/01: [CDFS] Implement volume un/locking. CORE-13957
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=03a9d8c7ca880006b4aa3…
commit 03a9d8c7ca880006b4aa37098e885206ddc106cc Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sat Nov 4 21:29:51 2017 +0100 [CDFS] Implement volume un/locking. CORE-13957 --- drivers/filesystems/cdfs/cdfs.h | 4 +++ drivers/filesystems/cdfs/fsctl.c | 69 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/drivers/filesystems/cdfs/cdfs.h b/drivers/filesystems/cdfs/cdfs.h index f5a8185834..b23846f647 100644 --- a/drivers/filesystems/cdfs/cdfs.h +++ b/drivers/filesystems/cdfs/cdfs.h @@ -153,6 +153,8 @@ typedef struct _CDINFO } CDINFO, *PCDINFO; +#define VCB_VOLUME_LOCKED 0x0001 + typedef struct { ERESOURCE VcbResource; @@ -165,6 +167,8 @@ typedef struct PDEVICE_OBJECT StorageDevice; PFILE_OBJECT StreamFileObject; + ULONG Flags; + CDINFO CdInfo; /* Notifications */ diff --git a/drivers/filesystems/cdfs/fsctl.c b/drivers/filesystems/cdfs/fsctl.c index 44ad59cf22..925819fb8e 100644 --- a/drivers/filesystems/cdfs/fsctl.c +++ b/drivers/filesystems/cdfs/fsctl.c @@ -23,6 +23,7 @@ * PURPOSE: CDROM (ISO 9660) filesystem driver * PROGRAMMER: Art Yerkes * Eric Kohl +* Pierre Schweitzer */ /* INCLUDES *****************************************************************/ @@ -549,6 +550,64 @@ CdfsVerifyVolume( } +static +NTSTATUS +CdfsLockOrUnlockVolume( + IN PCDFS_IRP_CONTEXT IrpContext, + IN BOOLEAN LockVolume) +{ + PFCB Fcb; + PVPB Vpb; + PFILE_OBJECT FileObject; + PDEVICE_EXTENSION DeviceExt; + + FileObject = IrpContext->FileObject; + Fcb = FileObject->FsContext; + DeviceExt = IrpContext->DeviceObject->DeviceExtension; + Vpb = DeviceExt->StreamFileObject->Vpb; + + /* Only allow locking with the volume open */ + if (!BooleanFlagOn(Fcb->Flags, FCB_IS_VOLUME_STREAM)) + { + return STATUS_ACCESS_DENIED; + } + + /* Bail out if it's already in the demanded state */ + if ((BooleanFlagOn(DeviceExt->Flags, VCB_VOLUME_LOCKED) && LockVolume) || + (!BooleanFlagOn(DeviceExt->Flags, VCB_VOLUME_LOCKED) && !LockVolume)) + { + return STATUS_ACCESS_DENIED; + } + + /* Bail out if it's already in the demanded state */ + if ((BooleanFlagOn(Vpb->Flags, VPB_LOCKED) && LockVolume) || + (!BooleanFlagOn(Vpb->Flags, VPB_LOCKED) && !LockVolume)) + { + return STATUS_ACCESS_DENIED; + } + + /* Deny locking if we're not alone */ + if (LockVolume && DeviceExt->OpenHandleCount != 1) + { + return STATUS_ACCESS_DENIED; + } + + /* Finally, proceed */ + if (LockVolume) + { + DeviceExt->Flags |= VCB_VOLUME_LOCKED; + Vpb->Flags |= VPB_LOCKED; + } + else + { + DeviceExt->Flags &= ~VCB_VOLUME_LOCKED; + Vpb->Flags &= ~VPB_LOCKED; + } + + return STATUS_SUCCESS; +} + + NTSTATUS NTAPI CdfsSetCompression( @@ -604,6 +663,16 @@ CdfsFileSystemControl( Status = CdfsSetCompression(DeviceObject, Irp); break; + case FSCTL_LOCK_VOLUME: + DPRINT("CDFS: IRP_MN_USER_FS_REQUEST / FSCTL_LOCK_VOLUME\n"); + Status = CdfsLockOrUnlockVolume(IrpContext, TRUE); + break; + + case FSCTL_UNLOCK_VOLUME: + DPRINT("CDFS: IRP_MN_USER_FS_REQUEST / FSCTL_UNLOCK_VOLUME\n"); + Status = CdfsLockOrUnlockVolume(IrpContext, FALSE); + break; + default: DPRINT1("CDFS: IRP_MN_USER_FS_REQUEST / Unknown IoControlCode 0x%x\n", Stack->Parameters.DeviceIoControl.IoControlCode);
7 years, 1 month
1
0
0
0
[reactos] 01/01: [CDFS] Don't use uninit var. Fixes MSVC build (good boy :-))
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b30670ba43ec5b8901ddb…
commit b30670ba43ec5b8901ddbc98aff11f0f8be5d70d Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sat Nov 4 21:23:11 2017 +0100 [CDFS] Don't use uninit var. Fixes MSVC build (good boy :-)) --- drivers/filesystems/cdfs/create.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/filesystems/cdfs/create.c b/drivers/filesystems/cdfs/create.c index de53b1e74a..09a054bf1b 100644 --- a/drivers/filesystems/cdfs/create.c +++ b/drivers/filesystems/cdfs/create.c @@ -268,6 +268,7 @@ CdfsCreate( ASSERT(IrpContext); DeviceObject = IrpContext->DeviceObject; + DeviceExt = DeviceObject->DeviceExtension; if (DeviceObject == CdfsGlobalData->CdFsDeviceObject || DeviceObject == CdfsGlobalData->HddFsDeviceObject) { /* DeviceObject represents FileSystem instead of logical volume */ @@ -277,8 +278,6 @@ CdfsCreate( return STATUS_SUCCESS; } - DeviceExt = DeviceObject->DeviceExtension; - KeEnterCriticalRegion(); ExAcquireResourceExclusiveLite(&DeviceExt->DirResource, TRUE);
7 years, 1 month
1
0
0
0
[reactos] 01/01: [SETUPAPI] CM_Open_DevNode_Key_Ex: Add support for remote registry access and the Disposition parameter.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=06f9e1220f87a5ec1a662…
commit 06f9e1220f87a5ec1a66230609c01533129846c1 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat Nov 4 20:00:54 2017 +0100 [SETUPAPI] CM_Open_DevNode_Key_Ex: Add support for remote registry access and the Disposition parameter. --- dll/win32/setupapi/cfgmgr.c | 58 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 12 deletions(-) diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c index b45e6dec7a..362d34e14e 100644 --- a/dll/win32/setupapi/cfgmgr.c +++ b/dll/win32/setupapi/cfgmgr.c @@ -5002,9 +5002,10 @@ CM_Open_Class_Key_ExW( } else { - if (RegConnectRegistryW(((PMACHINE_INFO)hMachine)->szMachineName, - HKEY_LOCAL_MACHINE, &hKey)) - return CR_REGISTRY_ERROR; + if (RegConnectRegistryW(((PMACHINE_INFO)hMachine)->szMachineName, + HKEY_LOCAL_MACHINE, + &hKey)) + return CR_REGISTRY_ERROR; } if (ulFlags & CM_OPEN_CLASS_KEY_INTERFACE) @@ -5097,6 +5098,8 @@ CM_Open_DevNode_Key_Ex( HSTRING_TABLE StringTable = NULL; LPWSTR pszDevInst, pszKeyPath = NULL, pszInstancePath = NULL; LONG lError; + DWORD dwDisposition; + HKEY hRootKey = NULL; CONFIGRET ret = CR_CALL_NOT_IMPLEMENTED; FIXME("CM_Open_DevNode_Key_Ex(%lx %lx %lu %lx %p %lx %lx)\n", @@ -5138,14 +5141,14 @@ CM_Open_DevNode_Key_Ex( TRACE("pszDevInst: %S\n", pszDevInst); - pszKeyPath = MyMalloc(1024); + pszKeyPath = MyMalloc(512 * sizeof(WCHAR)); if (pszKeyPath == NULL) { ret = CR_OUT_OF_MEMORY; goto done; } - pszInstancePath = MyMalloc(1024); + pszInstancePath = MyMalloc(512 * sizeof(WCHAR)); if (pszInstancePath == NULL) { ret = CR_OUT_OF_MEMORY; @@ -5169,14 +5172,42 @@ CM_Open_DevNode_Key_Ex( TRACE("pszKeyPath: %S\n", pszKeyPath); - // FIXME: Disposition - // FIXME: hMachine + if (hMachine == NULL) + { + hRootKey = HKEY_LOCAL_MACHINE; + } + else + { + if (RegConnectRegistryW(((PMACHINE_INFO)hMachine)->szMachineName, + HKEY_LOCAL_MACHINE, + &hRootKey)) + { + ret = CR_REGISTRY_ERROR; + goto done; + } + } + + if (Disposition == RegDisposition_OpenAlways) + { + lError = RegCreateKeyExW(hRootKey, + pszKeyPath, + 0, + NULL, + 0, + samDesired, + NULL, + phkDevice, + &dwDisposition); + } + else + { + lError = RegOpenKeyExW(hRootKey, + pszKeyPath, + 0, + samDesired, + phkDevice); + } - lError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, - pszKeyPath, - 0, - samDesired, - phkDevice); if (lError != ERROR_SUCCESS) { *phkDevice = NULL; @@ -5184,6 +5215,9 @@ CM_Open_DevNode_Key_Ex( } done: + if ((hRootKey != NULL) && (hRootKey != HKEY_LOCAL_MACHINE)) + RegCloseKey(hRootKey); + if (pszInstancePath != NULL) MyFree(pszInstancePath);
7 years, 1 month
1
0
0
0
[reactos] 01/01: [CDFS] Implement open handle count
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=95447d2fd11604eeea487…
commit 95447d2fd11604eeea4870ed7a6e9b3610eb1173 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sat Nov 4 21:14:50 2017 +0100 [CDFS] Implement open handle count --- drivers/filesystems/cdfs/cdfs.h | 3 +++ drivers/filesystems/cdfs/cleanup.c | 2 ++ drivers/filesystems/cdfs/create.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/drivers/filesystems/cdfs/cdfs.h b/drivers/filesystems/cdfs/cdfs.h index dff86cec2e..f5a8185834 100644 --- a/drivers/filesystems/cdfs/cdfs.h +++ b/drivers/filesystems/cdfs/cdfs.h @@ -170,6 +170,9 @@ typedef struct /* Notifications */ LIST_ENTRY NotifyList; PNOTIFY_SYNC NotifySync; + + /* Incremented on IRP_MJ_CREATE, decremented on IRP_MJ_CLEANUP */ + ULONG OpenHandleCount; } DEVICE_EXTENSION, *PDEVICE_EXTENSION, VCB, *PVCB; diff --git a/drivers/filesystems/cdfs/cleanup.c b/drivers/filesystems/cdfs/cleanup.c index 5ee39b1616..10d7704636 100644 --- a/drivers/filesystems/cdfs/cleanup.c +++ b/drivers/filesystems/cdfs/cleanup.c @@ -55,6 +55,8 @@ CdfsCleanupFile(PCDFS_IRP_CONTEXT IrpContext, return STATUS_SUCCESS; } + DeviceExt->OpenHandleCount--; + /* Notify about the cleanup */ FsRtlNotifyCleanup(DeviceExt->NotifySync, &(DeviceExt->NotifyList), diff --git a/drivers/filesystems/cdfs/create.c b/drivers/filesystems/cdfs/create.c index 6271893b67..de53b1e74a 100644 --- a/drivers/filesystems/cdfs/create.c +++ b/drivers/filesystems/cdfs/create.c @@ -241,6 +241,8 @@ CdfsCreateFile(PDEVICE_OBJECT DeviceObject, CdfsCloseFile (DeviceExt, FileObject); return STATUS_NOT_A_DIRECTORY; } + + DeviceExt->OpenHandleCount++; } /* @@ -271,6 +273,7 @@ CdfsCreate( /* DeviceObject represents FileSystem instead of logical volume */ DPRINT("Opening file system\n"); IrpContext->Irp->IoStatus.Information = FILE_OPENED; + DeviceExt->OpenHandleCount++; return STATUS_SUCCESS; }
7 years, 1 month
1
0
0
0
[reactos] 01/01: [CDFS] Remove the VPB field from the VCB. Not only it was never set, but the only times it was used was broken!
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fa0327d6c5f28d59838b2…
commit fa0327d6c5f28d59838b240f3e363f82a90606ee Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sat Nov 4 19:46:01 2017 +0100 [CDFS] Remove the VPB field from the VCB. Not only it was never set, but the only times it was used was broken! --- drivers/filesystems/cdfs/cdfs.h | 1 - drivers/filesystems/cdfs/fsctl.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/filesystems/cdfs/cdfs.h b/drivers/filesystems/cdfs/cdfs.h index 3d77e5b645..dff86cec2e 100644 --- a/drivers/filesystems/cdfs/cdfs.h +++ b/drivers/filesystems/cdfs/cdfs.h @@ -161,7 +161,6 @@ typedef struct KSPIN_LOCK FcbListLock; LIST_ENTRY FcbListHead; - PVPB Vpb; PDEVICE_OBJECT VolumeDevice; PDEVICE_OBJECT StorageDevice; PFILE_OBJECT StreamFileObject; diff --git a/drivers/filesystems/cdfs/fsctl.c b/drivers/filesystems/cdfs/fsctl.c index f153077017..44ad59cf22 100644 --- a/drivers/filesystems/cdfs/fsctl.c +++ b/drivers/filesystems/cdfs/fsctl.c @@ -419,7 +419,7 @@ CdfsMountVolume( DeviceExt->StreamFileObject->FsContext2 = Ccb; DeviceExt->StreamFileObject->SectionObjectPointer = &Fcb->SectionObjectPointers; DeviceExt->StreamFileObject->PrivateCacheMap = NULL; - DeviceExt->StreamFileObject->Vpb = DeviceExt->Vpb; + DeviceExt->StreamFileObject->Vpb = DeviceToMount->Vpb; Ccb->PtrFileObject = DeviceExt->StreamFileObject; Fcb->FileObject = DeviceExt->StreamFileObject; Fcb->DevExt = (PDEVICE_EXTENSION)DeviceExt->StorageDevice;
7 years, 1 month
1
0
0
0
[reactos] 01/01: [SETUPAPI] Update some functions to the current coding style, add annotations and add function names to the TRACE calls.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f86e78d00b4eedc34d2ee…
commit f86e78d00b4eedc34d2ee94108be8c958d02e917 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat Nov 4 19:01:28 2017 +0100 [SETUPAPI] Update some functions to the current coding style, add annotations and add function names to the TRACE calls. --- dll/win32/setupapi/cfgmgr.c | 200 +++++++++++++++++++++++++++++++------------- 1 file changed, 142 insertions(+), 58 deletions(-) diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c index a578615e3b..b45e6dec7a 100644 --- a/dll/win32/setupapi/cfgmgr.c +++ b/dll/win32/setupapi/cfgmgr.c @@ -4440,10 +4440,13 @@ CM_Invert_Range_List( /*********************************************************************** * CM_Is_Dock_Station_Present [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Is_Dock_Station_Present( - PBOOL pbPresent) +CONFIGRET +WINAPI +CM_Is_Dock_Station_Present( + _Out_ PBOOL pbPresent) { - TRACE("%p\n", pbPresent); + TRACE("CM_Is_Dock_Station_Present(%p)\n", + pbPresent); return CM_Is_Dock_Station_Present_Ex(pbPresent, NULL); } @@ -4451,13 +4454,17 @@ CONFIGRET WINAPI CM_Is_Dock_Station_Present( /*********************************************************************** * CM_Is_Dock_Station_Present_Ex [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Is_Dock_Station_Present_Ex( - PBOOL pbPresent, HMACHINE hMachine) +CONFIGRET +WINAPI +CM_Is_Dock_Station_Present_Ex( + _Out_ PBOOL pbPresent, + _In_opt_ HMACHINE hMachine) { RPC_BINDING_HANDLE BindingHandle = NULL; CONFIGRET ret; - TRACE("%p %lx\n", pbPresent, hMachine); + TRACE("CM_Is_Dock_Station_Present_Ex(%p %lx)\n", + pbPresent, hMachine); if (pbPresent == NULL) return CR_INVALID_POINTER; @@ -4494,10 +4501,13 @@ CONFIGRET WINAPI CM_Is_Dock_Station_Present_Ex( /*********************************************************************** * CM_Is_Version_Available_Ex [SETUPAPI.@] */ -BOOL WINAPI CM_Is_Version_Available( - WORD wVersion) +BOOL +WINAPI +CM_Is_Version_Available( + _In_ WORD wVersion) { - TRACE("%hu\n", wVersion); + TRACE("CM_Is_Version_Available(%hu)\n", + wVersion); return CM_Is_Version_Available_Ex(wVersion, NULL); } @@ -4505,14 +4515,18 @@ BOOL WINAPI CM_Is_Version_Available( /*********************************************************************** * CM_Is_Version_Available_Ex [SETUPAPI.@] */ -BOOL WINAPI CM_Is_Version_Available_Ex( - WORD wVersion, HMACHINE hMachine) +BOOL +WINAPI +CM_Is_Version_Available_Ex( + _In_ WORD wVersion, + _In_opt_ HMACHINE hMachine) { RPC_BINDING_HANDLE BindingHandle = NULL; WORD wServerVersion; CONFIGRET ret; - TRACE("%hu %lx\n", wVersion, hMachine); + TRACE("CM_Is_Version_Available_Ex(%hu %lx)\n", + wVersion, hMachine); if (wVersion <= 0x400) return TRUE; @@ -4549,10 +4563,15 @@ BOOL WINAPI CM_Is_Version_Available_Ex( /*********************************************************************** * CM_Locate_DevNodeA [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Locate_DevNodeA( - PDEVINST pdnDevInst, DEVINSTID_A pDeviceID, ULONG ulFlags) +CONFIGRET +WINAPI +CM_Locate_DevNodeA( + _Out_ PDEVINST pdnDevInst, + _In_opt_ DEVINSTID_A pDeviceID, + _In_ ULONG ulFlags) { - TRACE("%p %s %lu\n", pdnDevInst, pDeviceID, ulFlags); + TRACE("CM_Locate_DevNodeA(%p %s %lu)\n", + pdnDevInst, pDeviceID, ulFlags); return CM_Locate_DevNode_ExA(pdnDevInst, pDeviceID, ulFlags, NULL); } @@ -4560,10 +4579,15 @@ CONFIGRET WINAPI CM_Locate_DevNodeA( /*********************************************************************** * CM_Locate_DevNodeW [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Locate_DevNodeW( - PDEVINST pdnDevInst, DEVINSTID_W pDeviceID, ULONG ulFlags) +CONFIGRET +WINAPI +CM_Locate_DevNodeW( + _Out_ PDEVINST pdnDevInst, + _In_opt_ DEVINSTID_W pDeviceID, + _In_ ULONG ulFlags) { - TRACE("%p %s %lu\n", pdnDevInst, debugstr_w(pDeviceID), ulFlags); + TRACE("CM_Locate_DevNodeW(%p %s %lu)\n", + pdnDevInst, debugstr_w(pDeviceID), ulFlags); return CM_Locate_DevNode_ExW(pdnDevInst, pDeviceID, ulFlags, NULL); } @@ -4571,13 +4595,19 @@ CONFIGRET WINAPI CM_Locate_DevNodeW( /*********************************************************************** * CM_Locate_DevNode_ExA [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Locate_DevNode_ExA( - PDEVINST pdnDevInst, DEVINSTID_A pDeviceID, ULONG ulFlags, HMACHINE hMachine) +CONFIGRET +WINAPI +CM_Locate_DevNode_ExA( + _Out_ PDEVINST pdnDevInst, + _In_opt_ DEVINSTID_A pDeviceID, + _In_ ULONG ulFlags, + _In_opt_ HMACHINE hMachine) { DEVINSTID_W pDevIdW = NULL; CONFIGRET ret = CR_SUCCESS; - TRACE("%p %s %lu %lx\n", pdnDevInst, pDeviceID, ulFlags, hMachine); + TRACE("CM_Locate_DevNode_ExA(%p %s %lu %lx)\n", + pdnDevInst, pDeviceID, ulFlags, hMachine); if (pDeviceID != NULL) { @@ -4597,15 +4627,21 @@ CONFIGRET WINAPI CM_Locate_DevNode_ExA( /*********************************************************************** * CM_Locate_DevNode_ExW [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Locate_DevNode_ExW( - PDEVINST pdnDevInst, DEVINSTID_W pDeviceID, ULONG ulFlags, HMACHINE hMachine) +CONFIGRET +WINAPI +CM_Locate_DevNode_ExW( + _Out_ PDEVINST pdnDevInst, + _In_opt_ DEVINSTID_W pDeviceID, + _In_ ULONG ulFlags, + _In_opt_ HMACHINE hMachine) { WCHAR DeviceIdBuffer[MAX_DEVICE_ID_LEN]; RPC_BINDING_HANDLE BindingHandle = NULL; HSTRING_TABLE StringTable = NULL; CONFIGRET ret = CR_SUCCESS; - TRACE("%p %s %lu %lx\n", pdnDevInst, debugstr_w(pDeviceID), ulFlags, hMachine); + TRACE("CM_Locate_DevNode_ExW(%p %s %lu %lx)\n", + pdnDevInst, debugstr_w(pDeviceID), ulFlags, hMachine); if (pdnDevInst == NULL) return CR_INVALID_POINTER; @@ -4697,11 +4733,18 @@ CM_Merge_Range_List( /*********************************************************************** * CM_Modify_Res_Des [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Modify_Res_Des( - PRES_DES prdResDes, RES_DES rdResDes, RESOURCEID ResourceID, - PCVOID ResourceData, ULONG ResourceLen, ULONG ulFlags) +CONFIGRET +WINAPI +CM_Modify_Res_Des( + _Out_ PRES_DES prdResDes, + _In_ RES_DES rdResDes, + _In_ RESOURCEID ResourceID, + _In_ PCVOID ResourceData, + _In_ ULONG ResourceLen, + _In_ ULONG ulFlags) { - TRACE("%p %p %lx %p %lu %lx", prdResDes, rdResDes, ResourceID, ResourceData, + TRACE("CM_Modify_Res_Des(%p %p %lx %p %lu %lx)\n", + prdResDes, rdResDes, ResourceID, ResourceData, ResourceLen, ulFlags); return CM_Modify_Res_Des_Ex(prdResDes, rdResDes, ResourceID, ResourceData, ResourceLen, ulFlags, NULL); @@ -4711,11 +4754,19 @@ CONFIGRET WINAPI CM_Modify_Res_Des( /*********************************************************************** * CM_Modify_Res_Des_Ex [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Modify_Res_Des_Ex( - PRES_DES prdResDes, RES_DES rdResDes, RESOURCEID ResourceID, PCVOID ResourceData, - ULONG ResourceLen, ULONG ulFlags, HMACHINE hMachine) +CONFIGRET +WINAPI +CM_Modify_Res_Des_Ex( + _Out_ PRES_DES prdResDes, + _In_ RES_DES rdResDes, + _In_ RESOURCEID ResourceID, + _In_ PCVOID ResourceData, + _In_ ULONG ResourceLen, + _In_ ULONG ulFlags, + _In_opt_ HMACHINE hMachine) { - FIXME("%p %p %lx %p %lu %lx %lx", prdResDes, rdResDes, ResourceID, ResourceData, + FIXME("CM_Modify_Res_Des_Ex(%p %p %lx %p %lu %lx %lx)\n", + prdResDes, rdResDes, ResourceID, ResourceData, ResourceLen, ulFlags, hMachine); return CR_CALL_NOT_IMPLEMENTED; } @@ -4724,10 +4775,15 @@ CONFIGRET WINAPI CM_Modify_Res_Des_Ex( /*********************************************************************** * CM_Move_DevNode [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Move_DevNode( - DEVINST dnFromDevInst, DEVINST dnToDevInst, ULONG ulFlags) +CONFIGRET +WINAPI +CM_Move_DevNode( + _In_ DEVINST dnFromDevInst, + _In_ DEVINST dnToDevInst, + _In_ ULONG ulFlags) { - TRACE("%lx %lx %lx\n", dnFromDevInst, dnToDevInst, ulFlags); + TRACE("CM_Move_DevNode(%lx %lx %lx)\n", + dnFromDevInst, dnToDevInst, ulFlags); return CM_Move_DevNode_Ex(dnFromDevInst, dnToDevInst, ulFlags, NULL); } @@ -4735,9 +4791,13 @@ CONFIGRET WINAPI CM_Move_DevNode( /*********************************************************************** * CM_Move_DevNode_Ex [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Move_DevNode_Ex( - DEVINST dnFromDevInst, DEVINST dnToDevInst, ULONG ulFlags, - HMACHINE hMachine) +CONFIGRET +WINAPI +CM_Move_DevNode_Ex( + _In_ DEVINST dnFromDevInst, + _In_ DEVINST dnToDevInst, + _In_ ULONG ulFlags, + _In_opt_ HMACHINE hMachine) { RPC_BINDING_HANDLE BindingHandle = NULL; HSTRING_TABLE StringTable = NULL; @@ -4745,7 +4805,7 @@ CONFIGRET WINAPI CM_Move_DevNode_Ex( LPWSTR lpToDevInst; CONFIGRET ret; - FIXME("%lx %lx %lx %lx\n", + FIXME("CM_Move_DevNode_Ex(%lx %lx %lx %lx)\n", dnFromDevInst, dnToDevInst, ulFlags, hMachine); if (!pSetupIsUserAdmin()) @@ -4819,11 +4879,17 @@ CM_Next_Range( /*********************************************************************** * CM_Open_Class_KeyA [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Open_Class_KeyA( - LPGUID pClassGuid, LPCSTR pszClassName, REGSAM samDesired, - REGDISPOSITION Disposition, PHKEY phkClass, ULONG ulFlags) +CONFIGRET +WINAPI +CM_Open_Class_KeyA( + _In_opt_ LPGUID pClassGuid, + _In_opt_ LPCSTR pszClassName, + _In_ REGSAM samDesired, + _In_ REGDISPOSITION Disposition, + _Out_ PHKEY phkClass, + _In_ ULONG ulFlags) { - TRACE("%p %s %lx %lx %p %lx\n", + TRACE("CM_Open_Class_KeyA(%p %s %lx %lx %p %lx)\n", debugstr_guid(pClassGuid), pszClassName, samDesired, Disposition, phkClass, ulFlags); @@ -4835,11 +4901,17 @@ CONFIGRET WINAPI CM_Open_Class_KeyA( /*********************************************************************** * CM_Open_Class_KeyW [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Open_Class_KeyW( - LPGUID pClassGuid, LPCWSTR pszClassName, REGSAM samDesired, - REGDISPOSITION Disposition, PHKEY phkClass, ULONG ulFlags) +CONFIGRET +WINAPI +CM_Open_Class_KeyW( + _In_opt_ LPGUID pClassGuid, + _In_opt_ LPCWSTR pszClassName, + _In_ REGSAM samDesired, + _In_ REGDISPOSITION Disposition, + _Out_ PHKEY phkClass, + _In_ ULONG ulFlags) { - TRACE("%p %s %lx %lx %p %lx\n", + TRACE("CM_Open_Class_KeyW%p %s %lx %lx %p %lx)\n", debugstr_guid(pClassGuid), debugstr_w(pszClassName), samDesired, Disposition, phkClass, ulFlags); @@ -4851,15 +4923,21 @@ CONFIGRET WINAPI CM_Open_Class_KeyW( /*********************************************************************** * CM_Open_Class_Key_ExA [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Open_Class_Key_ExA( - LPGUID pClassGuid, LPCSTR pszClassName, REGSAM samDesired, - REGDISPOSITION Disposition, PHKEY phkClass, ULONG ulFlags, - HMACHINE hMachine) +CONFIGRET +WINAPI +CM_Open_Class_Key_ExA( + _In_opt_ LPGUID pClassGuid, + _In_opt_ LPCSTR pszClassName, + _In_ REGSAM samDesired, + _In_ REGDISPOSITION Disposition, + _Out_ PHKEY phkClass, + _In_ ULONG ulFlags, + _In_opt_ HMACHINE hMachine) { LPWSTR pszClassNameW = NULL; CONFIGRET ret; - TRACE("%p %s %lx %lx %p %lx %lx\n", + TRACE("CM_Open_Class_Key_ExA(%p %s %lx %lx %p %lx %lx)\n", debugstr_guid(pClassGuid), pszClassName, samDesired, Disposition, phkClass, ulFlags, hMachine); @@ -4882,10 +4960,16 @@ CONFIGRET WINAPI CM_Open_Class_Key_ExA( /*********************************************************************** * CM_Open_Class_Key_ExW [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Open_Class_Key_ExW( - LPGUID pClassGuid, LPCWSTR pszClassName, REGSAM samDesired, - REGDISPOSITION Disposition, PHKEY phkClass, ULONG ulFlags, - HMACHINE hMachine) +CONFIGRET +WINAPI +CM_Open_Class_Key_ExW( + _In_opt_ LPGUID pClassGuid, + _In_opt_ LPCWSTR pszClassName, + _In_ REGSAM samDesired, + _In_ REGDISPOSITION Disposition, + _Out_ PHKEY phkClass, + _In_ ULONG ulFlags, + _In_opt_ HMACHINE hMachine) { WCHAR szKeyName[MAX_PATH]; LPWSTR lpGuidString; @@ -4893,7 +4977,7 @@ CONFIGRET WINAPI CM_Open_Class_Key_ExW( DWORD dwError; HKEY hKey; - TRACE("%p %s %lx %lx %p %lx %lx\n", + TRACE("CM_Open_Class_Key_ExW(%p %s %lx %lx %p %lx %lx)\n", debugstr_guid(pClassGuid), debugstr_w(pszClassName), samDesired, Disposition, phkClass, ulFlags, hMachine); @@ -5007,7 +5091,7 @@ CM_Open_DevNode_Key_Ex( _In_ REGDISPOSITION Disposition, _Out_ PHKEY phkDevice, _In_ ULONG ulFlags, - _In_ HMACHINE hMachine) + _In_opt_ HMACHINE hMachine) { RPC_BINDING_HANDLE BindingHandle = NULL; HSTRING_TABLE StringTable = NULL;
7 years, 1 month
1
0
0
0
[reactos] 01/01: [SETUPAPI] Start the implementation of CM_Open_DevNode_Key_Ex().
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=78cf2a04a5ac284d237a5…
commit 78cf2a04a5ac284d237a5aeb8573dbca506580dc Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat Nov 4 17:26:38 2017 +0100 [SETUPAPI] Start the implementation of CM_Open_DevNode_Key_Ex(). --- dll/win32/setupapi/cfgmgr.c | 253 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 241 insertions(+), 12 deletions(-) diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c index f2ad0d7f04..a578615e3b 100644 --- a/dll/win32/setupapi/cfgmgr.c +++ b/dll/win32/setupapi/cfgmgr.c @@ -164,6 +164,129 @@ GetRegistryPropertyType( } +static +VOID +SplitDeviceInstanceId( + _In_ PWSTR pszDeviceInstanceId, + _Out_ PWSTR pszDeviceId, + _Out_ PWSTR pszInstanceId) +{ + PWCHAR ptr; + + wcscpy(pszDeviceId, pszDeviceInstanceId); + + ptr = wcschr(pszDeviceId, L'\\'); + if (ptr != NULL) + { + *ptr = UNICODE_NULL; + ptr++; + + wcscpy(pszInstanceId, ptr); + } + else + { + *pszInstanceId = UNICODE_NULL; + } +} + + +static +CONFIGRET +GetDeviceInstanceKeyPath( + _In_ RPC_BINDING_HANDLE BindingHandle, + _In_ PWSTR pszDeviceInst, + _Out_ PWSTR pszKeyPath, + _Out_ PWSTR pszInstancePath, + _In_ ULONG ulHardwareProfile, + _In_ ULONG ulFlags) +{ + PWSTR pszBuffer = NULL; + ULONG ulType = 0; + ULONG ulTransferLength, ulLength; + CONFIGRET ret = CR_SUCCESS; + + TRACE("GetDeviceInstanceKeyPath()\n"); + + if (ulFlags & CM_REGISTRY_SOFTWARE) + { + /* Software Key Path */ + ret = CR_CALL_NOT_IMPLEMENTED; + } + else + { + /* Hardware Key Path */ + + ulTransferLength = 300 * sizeof(WCHAR); + ulLength = 300 * sizeof(WCHAR); + + pszBuffer = MyMalloc(ulTransferLength); + if (pszBuffer == NULL) + { + ERR("MyMalloc() failed\n"); + ret = CR_OUT_OF_MEMORY; + goto done; + } + + ret = PNP_GetDeviceRegProp(BindingHandle, + pszDeviceInst, + CM_DRP_DRIVER, + &ulType, + (PVOID)pszBuffer, + &ulTransferLength, + &ulLength, + 0); + if (ret != CR_SUCCESS) + { + ERR("PNP_GetDeviceRegProp() failed (Error %lu)\n", ret); + goto done; + } + + TRACE("szBuffer: %S\n", pszBuffer); + + SplitDeviceInstanceId(pszBuffer, + pszBuffer, + pszInstancePath); + + TRACE("szBuffer: %S\n", pszBuffer); + + if (ulFlags & CM_REGISTRY_CONFIG) + { + if (ulHardwareProfile == 0) + { + wsprintfW(pszKeyPath, + L"%s\\%s\\%s\\%s", + L"System\\CurrentControlSet\\Hardware Profiles", + L"Current", + L"System\\CurrentControlSet\\Control\\Class", + pszBuffer); + } + else + { + wsprintfW(pszKeyPath, + L"%s\\%04lu\\%s\\%s", + L"System\\CurrentControlSet\\Hardware Profiles", + ulHardwareProfile, + L"System\\CurrentControlSet\\Control\\Class", + pszBuffer); + } + } + else + { + wsprintfW(pszKeyPath, + L"%s\\%s", + L"System\\CurrentControlSet\\Control\\Class", + pszBuffer); + } + } + +done: + if (pszBuffer != NULL) + MyFree(pszBuffer); + + return ret; +} + + /*********************************************************************** * CMP_GetBlockedDriverInfo [SETUPAPI.@] */ @@ -4855,12 +4978,18 @@ CONFIGRET WINAPI CM_Open_Class_Key_ExW( /*********************************************************************** * CM_Open_DevNode_Key [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Open_DevNode_Key( - DEVINST dnDevNode, REGSAM samDesired, ULONG ulHardwareProfile, - REGDISPOSITION Disposition, PHKEY phkDevice, ULONG ulFlags) +CONFIGRET +WINAPI +CM_Open_DevNode_Key( + _In_ DEVINST dnDevNode, + _In_ REGSAM samDesired, + _In_ ULONG ulHardwareProfile, + _In_ REGDISPOSITION Disposition, + _Out_ PHKEY phkDevice, + _In_ ULONG ulFlags) { - TRACE("%lx %lx %lu %lx %p %lx\n", dnDevNode, samDesired, - ulHardwareProfile, Disposition, phkDevice, ulFlags); + TRACE("CM_Open_DevNode_Key(%lx %lx %lu %lx %p %lx)\n", + dnDevNode, samDesired, ulHardwareProfile, Disposition, phkDevice, ulFlags); return CM_Open_DevNode_Key_Ex(dnDevNode, samDesired, ulHardwareProfile, Disposition, phkDevice, ulFlags, NULL); } @@ -4869,15 +4998,115 @@ CONFIGRET WINAPI CM_Open_DevNode_Key( /*********************************************************************** * CM_Open_DevNode_Key_Ex [SETUPAPI.@] */ -CONFIGRET WINAPI CM_Open_DevNode_Key_Ex( - DEVINST dnDevNode, REGSAM samDesired, ULONG ulHardwareProfile, - REGDISPOSITION Disposition, PHKEY phkDevice, ULONG ulFlags, - HMACHINE hMachine) +CONFIGRET +WINAPI +CM_Open_DevNode_Key_Ex( + _In_ DEVINST dnDevNode, + _In_ REGSAM samDesired, + _In_ ULONG ulHardwareProfile, + _In_ REGDISPOSITION Disposition, + _Out_ PHKEY phkDevice, + _In_ ULONG ulFlags, + _In_ HMACHINE hMachine) { - FIXME("%lx %lx %lu %lx %p %lx %lx\n", dnDevNode, samDesired, - ulHardwareProfile, Disposition, phkDevice, ulFlags, hMachine); + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + LPWSTR pszDevInst, pszKeyPath = NULL, pszInstancePath = NULL; + LONG lError; + CONFIGRET ret = CR_CALL_NOT_IMPLEMENTED; - return CR_CALL_NOT_IMPLEMENTED; + FIXME("CM_Open_DevNode_Key_Ex(%lx %lx %lu %lx %p %lx %lx)\n", + dnDevNode, samDesired, ulHardwareProfile, Disposition, phkDevice, ulFlags, hMachine); + + if (phkDevice == NULL) + return CR_INVALID_POINTER; + + *phkDevice = NULL; + + if (dnDevNode == 0) + return CR_INVALID_DEVNODE; + + if (ulFlags & ~CM_REGISTRY_BITS) + return CR_INVALID_FLAG; + + if (Disposition & ~RegDisposition_Bits) + return CR_INVALID_DATA; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + + StringTable = ((PMACHINE_INFO)hMachine)->StringTable; + if (StringTable == 0) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, &StringTable)) + return CR_FAILURE; + } + + pszDevInst = pSetupStringTableStringFromId(StringTable, dnDevNode); + if (pszDevInst == NULL) + return CR_INVALID_DEVNODE; + + TRACE("pszDevInst: %S\n", pszDevInst); + + pszKeyPath = MyMalloc(1024); + if (pszKeyPath == NULL) + { + ret = CR_OUT_OF_MEMORY; + goto done; + } + + pszInstancePath = MyMalloc(1024); + if (pszInstancePath == NULL) + { + ret = CR_OUT_OF_MEMORY; + goto done; + } + + ret = GetDeviceInstanceKeyPath(BindingHandle, + pszDevInst, + pszKeyPath, + pszInstancePath, + ulHardwareProfile, + ulFlags); + if (ret != CR_SUCCESS) + goto done; + + TRACE("pszKeyPath: %S\n", pszKeyPath); + TRACE("pszInstancePath: %S\n", pszInstancePath); + + wcscat(pszKeyPath, L"\\"); + wcscat(pszKeyPath, pszInstancePath); + + TRACE("pszKeyPath: %S\n", pszKeyPath); + + // FIXME: Disposition + // FIXME: hMachine + + lError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + pszKeyPath, + 0, + samDesired, + phkDevice); + if (lError != ERROR_SUCCESS) + { + *phkDevice = NULL; + ret = CR_NO_SUCH_REGISTRY_KEY; + } + +done: + if (pszInstancePath != NULL) + MyFree(pszInstancePath); + + if (pszKeyPath != NULL) + MyFree(pszKeyPath); + + return ret; }
7 years, 1 month
1
0
0
0
[reactos] 01/01: [WIN32K] Check if the window being destroyed is currently tracked. (#103)
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9e4d2f1f9e9529bc1e8b9…
commit 9e4d2f1f9e9529bc1e8b9d8c3ab2e0b398fbf2b5 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sat Nov 4 15:00:54 2017 +0100 [WIN32K] Check if the window being destroyed is currently tracked. (#103) * [WIN32K] Check if the window being destroyed is currently tracked. CORE-13619 --- win32ss/user/ntuser/mouse.c | 20 ++++++++++++++++++++ win32ss/user/ntuser/window.c | 12 ++++++++++++ 2 files changed, 32 insertions(+) diff --git a/win32ss/user/ntuser/mouse.c b/win32ss/user/ntuser/mouse.c index fc3827e345..46dfcfdd4f 100644 --- a/win32ss/user/ntuser/mouse.c +++ b/win32ss/user/ntuser/mouse.c @@ -342,6 +342,26 @@ UserSendMouseInput(MOUSEINPUT *pmi, BOOL bInjected) return TRUE; } +VOID +FASTCALL +IntRemoveTrackMouseEvent( + PDESKTOP pDesk) +{ + /* Generate a leave message */ + if (pDesk->dwDTFlags & DF_TME_LEAVE) + { + UINT uMsg = (pDesk->htEx != HTCLIENT) ? WM_NCMOUSELEAVE : WM_MOUSELEAVE; + UserPostMessage(UserHMGetHandle(pDesk->spwndTrack), uMsg, 0, 0); + } + /* Kill the timer */ + if (pDesk->dwDTFlags & DF_TME_HOVER) + IntKillTimer(pDesk->spwndTrack, ID_EVENT_SYSTIMER_MOUSEHOVER, TRUE); + + /* Reset state */ + pDesk->dwDTFlags &= ~(DF_TME_LEAVE|DF_TME_HOVER); + pDesk->spwndTrack = NULL; +} + BOOL FASTCALL IntQueryTrackMouseEvent( diff --git a/win32ss/user/ntuser/window.c b/win32ss/user/ntuser/window.c index b8a3b59bfe..9c7627cece 100644 --- a/win32ss/user/ntuser/window.c +++ b/win32ss/user/ntuser/window.c @@ -381,6 +381,12 @@ DWORD FASTCALL IntGetWindowContextHelpId( PWND pWnd ) return HelpId; } + +VOID +FASTCALL +IntRemoveTrackMouseEvent( + PDESKTOP pDesk); + /*********************************************************************** * IntSendDestroyMsg */ @@ -422,6 +428,12 @@ static void IntSendDestroyMsg(HWND hWnd) { co_IntDestroyCaret(ti); } + + /* If the window being destroyed is currently tracked... */ + if (ti->rpdesk->spwndTrack == Window) + { + IntRemoveTrackMouseEvent(ti->rpdesk); + } } /* If the window being destroyed is the current clipboard owner... */
7 years, 1 month
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Results per page:
10
25
50
100
200