winehq.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
2025
February
January
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
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
September 2007
----- 2025 -----
February 2025
January 2025
----- 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
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
7 participants
787 discussions
Start a n
N
ew thread
Mikolaj Zalewski : winex11.drv/wintab32: Make wintab strings in winex11. drv Unicode, implement WTInfoW.
by Alexandre Julliard
21 Sep '07
21 Sep '07
Module: wine Branch: master Commit: 29a634728d8968cf296ee77e7a2ab4e2b33ec4e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=29a634728d8968cf296ee77e7…
Author: Mikolaj Zalewski <mikolajz(a)google.com> Date: Thu Sep 20 13:01:06 2007 -0700 winex11.drv/wintab32: Make wintab strings in winex11.drv Unicode, implement WTInfoW. --- dlls/winex11.drv/winex11.drv.spec | 2 +- dlls/winex11.drv/wintab.c | 93 +++++++++++++++++++++++++----------- dlls/wintab32/context.c | 85 +++++++++++++++++++++++++++------- dlls/wintab32/wintab32.c | 4 +- dlls/wintab32/wintab_internal.h | 2 +- 5 files changed, 136 insertions(+), 50 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=29a634728d8968cf296ee…
1
0
0
0
Alexandre Julliard : setupapi: Simplify the SetupDiGetClassDescriptionExA/ W implementation.
by Alexandre Julliard
21 Sep '07
21 Sep '07
Module: wine Branch: master Commit: 5d0dc4819336dd99537206a151e3f79285136b71 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5d0dc4819336dd99537206a15…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Fri Sep 21 12:21:17 2007 +0200 setupapi: Simplify the SetupDiGetClassDescriptionExA/W implementation. --- dlls/setupapi/devinst.c | 70 +++++++---------------------------------------- 1 files changed, 10 insertions(+), 60 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index dc92431..bc51c2a 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -1373,6 +1373,7 @@ BOOL WINAPI SetupDiGetClassDescriptionExA( { HKEY hKey; DWORD dwLength; + BOOL ret; hKey = SetupDiOpenClassRegKeyExA(ClassGuid, KEY_ALL_ACCESS, @@ -1385,38 +1386,12 @@ BOOL WINAPI SetupDiGetClassDescriptionExA( return FALSE; } - if (RequiredSize != NULL) - { - dwLength = 0; - if (RegQueryValueExA(hKey, - NULL, - NULL, - NULL, - NULL, - &dwLength)) - { - RegCloseKey(hKey); - return FALSE; - } - - *RequiredSize = dwLength; - } - dwLength = ClassDescriptionSize; - if (RegQueryValueExA(hKey, - NULL, - NULL, - NULL, - (LPBYTE)ClassDescription, - &dwLength)) - { - RegCloseKey(hKey); - return FALSE; - } - + ret = !RegQueryValueExA( hKey, NULL, NULL, NULL, + (LPBYTE)ClassDescription, &dwLength ); + if (RequiredSize) *RequiredSize = dwLength; RegCloseKey(hKey); - - return TRUE; + return ret; } /*********************************************************************** @@ -1432,6 +1407,7 @@ BOOL WINAPI SetupDiGetClassDescriptionExW( { HKEY hKey; DWORD dwLength; + BOOL ret; hKey = SetupDiOpenClassRegKeyExW(ClassGuid, KEY_ALL_ACCESS, @@ -1444,38 +1420,12 @@ BOOL WINAPI SetupDiGetClassDescriptionExW( return FALSE; } - if (RequiredSize != NULL) - { - dwLength = 0; - if (RegQueryValueExW(hKey, - NULL, - NULL, - NULL, - NULL, - &dwLength)) - { - RegCloseKey(hKey); - return FALSE; - } - - *RequiredSize = dwLength / sizeof(WCHAR); - } - dwLength = ClassDescriptionSize * sizeof(WCHAR); - if (RegQueryValueExW(hKey, - NULL, - NULL, - NULL, - (LPBYTE)ClassDescription, - &dwLength)) - { - RegCloseKey(hKey); - return FALSE; - } - + ret = !RegQueryValueExW( hKey, NULL, NULL, NULL, + (LPBYTE)ClassDescription, &dwLength ); + if (RequiredSize) *RequiredSize = dwLength / sizeof(WCHAR); RegCloseKey(hKey); - - return TRUE; + return ret; } /***********************************************************************
1
0
0
0
Juan Lang : setupapi: Implement SetupDiGetClassDevsW.
by Alexandre Julliard
21 Sep '07
21 Sep '07
Module: wine Branch: master Commit: f841667cac1558d2131543c5dc9baba1c6418b01 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f841667cac1558d2131543c5d…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Sep 20 09:16:45 2007 -0700 setupapi: Implement SetupDiGetClassDevsW. --- dlls/setupapi/devinst.c | 274 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 272 insertions(+), 2 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=f841667cac1558d213154…
1
0
0
0
Juan Lang : setupapi: Implement SetupDiRegisterDeviceInfo.
by Alexandre Julliard
21 Sep '07
21 Sep '07
Module: wine Branch: master Commit: f4b9bc2454b6c996ea601a2ae3d3ce80b8225273 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f4b9bc2454b6c996ea601a2ae…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Sep 20 09:16:25 2007 -0700 setupapi: Implement SetupDiRegisterDeviceInfo. --- dlls/setupapi/devinst.c | 28 ++++++++++++++++++++++++++-- dlls/setupapi/tests/devinst.c | 5 ----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 4d06c5c..e070c6b 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -1060,11 +1060,35 @@ BOOL WINAPI SetupDiRegisterDeviceInfo( PVOID CompareContext, PSP_DEVINFO_DATA DupDeviceInfoData) { + struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet; + struct DeviceInfo *devInfo; + TRACE("%p %p %08x %p %p %p\n", DeviceInfoSet, DeviceInfoData, Flags, CompareProc, CompareContext, DupDeviceInfoData); - FIXME("\n"); - return FALSE; + if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (set->magic != SETUP_DEVICE_INFO_SET_MAGIC) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + if (!DeviceInfoData || DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA) + || !DeviceInfoData->Reserved) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + devInfo = (struct DeviceInfo *)DeviceInfoData->Reserved; + if (devInfo->phantom) + { + devInfo->phantom = FALSE; + RegDeleteValueW(devInfo->key, Phantom); + } + return TRUE; } /*********************************************************************** diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index a18f91a..0ef9047 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -289,7 +289,6 @@ static void testRegisterDeviceInfo(void) } SetLastError(0xdeadbeef); ret = pSetupDiRegisterDeviceInfo(NULL, NULL, 0, NULL, NULL, NULL); - todo_wine ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); ret = pSetupDiRegisterDeviceInfo(NULL, NULL, 0, NULL, NULL, NULL); @@ -301,18 +300,15 @@ static void testRegisterDeviceInfo(void) SetLastError(0xdeadbeef); ret = pSetupDiRegisterDeviceInfo(set, NULL, 0, NULL, NULL, NULL); - todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); SetLastError(0xdeadbeef); ret = pSetupDiRegisterDeviceInfo(set, &devInfo, 0, NULL, NULL, NULL); - todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); devInfo.cbSize = sizeof(devInfo); SetLastError(0xdeadbeef); ret = pSetupDiRegisterDeviceInfo(set, &devInfo, 0, NULL, NULL, NULL); - todo_wine ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); ret = pSetupDiCreateDeviceInfoA(set, "USB\\BOGUS\\0000", &guid, @@ -324,7 +320,6 @@ static void testRegisterDeviceInfo(void) /* If it already existed, registering it again will fail */ ret = pSetupDiRegisterDeviceInfo(set, &devInfo, 0, NULL, NULL, NULL); - todo_wine ok(ret, "SetupDiCreateDeviceInfoA failed: %d\n", GetLastError()); } /* FIXME: On Win2K+ systems, this is now persisted to registry in
1
0
0
0
Juan Lang : setupapi: Add tests for SetupDiRegisterDeviceInfo.
by Alexandre Julliard
21 Sep '07
21 Sep '07
Module: wine Branch: master Commit: a57a17d3fc012dd97b9931de68bc0a118a0bb868 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a57a17d3fc012dd97b9931de6…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Sep 20 09:16:01 2007 -0700 setupapi: Add tests for SetupDiRegisterDeviceInfo. --- dlls/setupapi/tests/devinst.c | 65 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 65 insertions(+), 0 deletions(-) diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index c88ad24..a18f91a 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -40,6 +40,7 @@ static BOOL (WINAPI *pSetupDiEnumDeviceInfo)(HDEVINFO, DWORD, PSP_DEVINFO_DA static HKEY (WINAPI *pSetupDiOpenClassRegKeyExA)(GUID*,REGSAM,DWORD,PCSTR,PVOID); static BOOL (WINAPI *pSetupDiCreateDeviceInfoA)(HDEVINFO, PCSTR, GUID *, PCSTR, HWND, DWORD, PSP_DEVINFO_DATA); static BOOL (WINAPI *pSetupDiGetDeviceInstanceIdA)(HDEVINFO, PSP_DEVINFO_DATA, PSTR, DWORD, PDWORD); +static BOOL (WINAPI *pSetupDiRegisterDeviceInfo)(HDEVINFO, PSP_DEVINFO_DATA, DWORD, PSP_DETSIG_CMPPROC, PVOID, PSP_DEVINFO_DATA); static void init_function_pointers(void) { @@ -52,6 +53,7 @@ static void init_function_pointers(void) pSetupDiEnumDeviceInfo = (void *)GetProcAddress(hSetupAPI, "SetupDiEnumDeviceInfo"); pSetupDiGetDeviceInstanceIdA = (void *)GetProcAddress(hSetupAPI, "SetupDiGetDeviceInstanceIdA"); pSetupDiOpenClassRegKeyExA = (void *)GetProcAddress(hSetupAPI, "SetupDiOpenClassRegKeyExA"); + pSetupDiRegisterDeviceInfo = (void *)GetProcAddress(hSetupAPI, "SetupDiRegisterDeviceInfo"); } static void test_SetupDiCreateDeviceInfoListEx(void) @@ -272,6 +274,68 @@ static void testGetDeviceInstanceId(void) } } +static void testRegisterDeviceInfo(void) +{ + BOOL ret; + GUID guid = {0x6a55b5a4, 0x3f65, 0x11db, {0xb7,0x04, + 0x00,0x11,0x95,0x5c,0x2b,0xdb}}; + HDEVINFO set; + + if (!pSetupDiCreateDeviceInfoList || !pSetupDiDestroyDeviceInfoList || + !pSetupDiRegisterDeviceInfo) + { + skip("No SetupDiRegisterDeviceInfo\n"); + return; + } + SetLastError(0xdeadbeef); + ret = pSetupDiRegisterDeviceInfo(NULL, NULL, 0, NULL, NULL, NULL); + todo_wine + ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, + "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); + ret = pSetupDiRegisterDeviceInfo(NULL, NULL, 0, NULL, NULL, NULL); + set = pSetupDiCreateDeviceInfoList(&guid, NULL); + ok(set != NULL, "SetupDiCreateDeviceInfoList failed: %d\n", GetLastError()); + if (set) + { + SP_DEVINFO_DATA devInfo = { 0 }; + + SetLastError(0xdeadbeef); + ret = pSetupDiRegisterDeviceInfo(set, NULL, 0, NULL, NULL, NULL); + todo_wine + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + SetLastError(0xdeadbeef); + ret = pSetupDiRegisterDeviceInfo(set, &devInfo, 0, NULL, NULL, NULL); + todo_wine + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + devInfo.cbSize = sizeof(devInfo); + SetLastError(0xdeadbeef); + ret = pSetupDiRegisterDeviceInfo(set, &devInfo, 0, NULL, NULL, NULL); + todo_wine + ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ret = pSetupDiCreateDeviceInfoA(set, "USB\\BOGUS\\0000", &guid, + NULL, NULL, 0, &devInfo); + ok(ret || GetLastError() == ERROR_DEVINST_ALREADY_EXISTS, + "SetupDiCreateDeviceInfoA failed: %d\n", GetLastError()); + if (ret) + { + /* If it already existed, registering it again will fail */ + ret = pSetupDiRegisterDeviceInfo(set, &devInfo, 0, NULL, NULL, + NULL); + todo_wine + ok(ret, "SetupDiCreateDeviceInfoA failed: %d\n", GetLastError()); + } + /* FIXME: On Win2K+ systems, this is now persisted to registry in + * HKLM\System\CCS\Enum\USB\Bogus\0000. I don't check because the + * Win9x location is different. + * FIXME: the key also becomes undeletable. How to get rid of it? + */ + pSetupDiDestroyDeviceInfoList(set); + } +} + START_TEST(devinst) { init_function_pointers(); @@ -287,4 +351,5 @@ START_TEST(devinst) skip("SetupDiOpenClassRegKeyExA is not available\n"); testCreateDeviceInfo(); testGetDeviceInstanceId(); + testRegisterDeviceInfo(); }
1
0
0
0
Juan Lang : setupapi: Add stub for SetupDiRegisterDeviceInfo.
by Alexandre Julliard
21 Sep '07
21 Sep '07
Module: wine Branch: master Commit: 3a2a99474e23c40a0fb302382cec744ecaef7ccc URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a2a99474e23c40a0fb302382…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Sep 20 09:15:32 2007 -0700 setupapi: Add stub for SetupDiRegisterDeviceInfo. --- dlls/setupapi/devinst.c | 18 ++++++++++++++++++ dlls/setupapi/setupapi.spec | 2 +- 2 files changed, 19 insertions(+), 1 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 10bf481..4d06c5c 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -1050,6 +1050,24 @@ BOOL WINAPI SetupDiCreateDeviceInfoW( } /*********************************************************************** + * SetupDiRegisterDeviceInfo (SETUPAPI.@) + */ +BOOL WINAPI SetupDiRegisterDeviceInfo( + HDEVINFO DeviceInfoSet, + PSP_DEVINFO_DATA DeviceInfoData, + DWORD Flags, + PSP_DETSIG_CMPPROC CompareProc, + PVOID CompareContext, + PSP_DEVINFO_DATA DupDeviceInfoData) +{ + TRACE("%p %p %08x %p %p %p\n", DeviceInfoSet, DeviceInfoData, Flags, + CompareProc, CompareContext, DupDeviceInfoData); + + FIXME("\n"); + return FALSE; +} + +/*********************************************************************** * SetupDiEnumDeviceInfo (SETUPAPI.@) */ BOOL WINAPI SetupDiEnumDeviceInfo( diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec index 6b93af3..7f8b3dd 100644 --- a/dlls/setupapi/setupapi.spec +++ b/dlls/setupapi/setupapi.spec @@ -365,7 +365,7 @@ @ stdcall SetupDiOpenDeviceInterfaceA(ptr str long ptr) @ stub SetupDiOpenDeviceInterfaceRegKey @ stdcall SetupDiOpenDeviceInterfaceW(ptr wstr long ptr) -@ stub SetupDiRegisterDeviceInfo +@ stdcall SetupDiRegisterDeviceInfo(ptr ptr long ptr ptr ptr) @ stub SetupDiRemoveDevice @ stub SetupDiRemoveDeviceInterface @ stub SetupDiSelectDevice
1
0
0
0
Juan Lang : setupapi: Implement SetupDiGetClassDescriptionExA.
by Alexandre Julliard
21 Sep '07
21 Sep '07
Module: wine Branch: master Commit: 6b50538f123d0b62e773f749dd32a18bd8e3157f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6b50538f123d0b62e773f749d…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Sep 20 09:15:16 2007 -0700 setupapi: Implement SetupDiGetClassDescriptionExA. --- dlls/setupapi/devinst.c | 48 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 46 insertions(+), 2 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 9476ee2..10bf481 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -1325,8 +1325,52 @@ BOOL WINAPI SetupDiGetClassDescriptionExA( PCSTR MachineName, PVOID Reserved) { - FIXME("\n"); - return FALSE; + HKEY hKey; + DWORD dwLength; + + hKey = SetupDiOpenClassRegKeyExA(ClassGuid, + KEY_ALL_ACCESS, + DIOCR_INSTALLER, + MachineName, + Reserved); + if (hKey == INVALID_HANDLE_VALUE) + { + WARN("SetupDiOpenClassRegKeyExA() failed (Error %u)\n", GetLastError()); + return FALSE; + } + + if (RequiredSize != NULL) + { + dwLength = 0; + if (RegQueryValueExA(hKey, + NULL, + NULL, + NULL, + NULL, + &dwLength)) + { + RegCloseKey(hKey); + return FALSE; + } + + *RequiredSize = dwLength; + } + + dwLength = ClassDescriptionSize; + if (RegQueryValueExA(hKey, + NULL, + NULL, + NULL, + (LPBYTE)ClassDescription, + &dwLength)) + { + RegCloseKey(hKey); + return FALSE; + } + + RegCloseKey(hKey); + + return TRUE; } /***********************************************************************
1
0
0
0
Juan Lang : setupapi: Devices created by SetupDiCreateDeviceInfo are " phantoms", and are deleted from the registry when the set that contains them is closed .
by Alexandre Julliard
21 Sep '07
21 Sep '07
Module: wine Branch: master Commit: 80be1fe74007ff207480036ee8596809eb3dae5d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=80be1fe74007ff207480036ee…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Sep 20 09:14:53 2007 -0700 setupapi: Devices created by SetupDiCreateDeviceInfo are "phantoms", and are deleted from the registry when the set that contains them is closed. --- dlls/setupapi/devinst.c | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 3c8715c..9476ee2 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -83,6 +83,7 @@ static const WCHAR Capabilities[] = {'C','a','p','a','b','i','l','i','t','i','e' static const WCHAR UINumber[] = {'U','I','N','u','m','b','e','r',0}; static const WCHAR UpperFilters[] = {'U','p','p','e','r','F','i','l','t','e','r','s',0}; static const WCHAR LowerFilters[] = {'L','o','w','e','r','F','i','l','t','e','r','s',0}; +static const WCHAR Phantom[] = {'P','h','a','n','t','o','m',0}; /* is used to identify if a DeviceInfoSet pointer is valid or not */ @@ -101,10 +102,12 @@ struct DeviceInfoSet struct DeviceInfo { HKEY key; + BOOL phantom; LPWSTR instanceId; }; -static struct DeviceInfo *SETUPDI_AllocateDeviceInfo(LPCWSTR instanceId) +static struct DeviceInfo *SETUPDI_AllocateDeviceInfo(LPCWSTR instanceId, + BOOL phantom) { struct DeviceInfo *devInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(struct DeviceInfo)); @@ -119,6 +122,7 @@ static struct DeviceInfo *SETUPDI_AllocateDeviceInfo(LPCWSTR instanceId) LONG l; devInfo->key = INVALID_HANDLE_VALUE; + devInfo->phantom = phantom; lstrcpyW(devInfo->instanceId, instanceId); struprW(devInfo->instanceId); l = RegCreateKeyExW(HKEY_LOCAL_MACHINE, Enum, 0, NULL, 0, @@ -127,6 +131,9 @@ static struct DeviceInfo *SETUPDI_AllocateDeviceInfo(LPCWSTR instanceId) { RegCreateKeyExW(enumKey, devInfo->instanceId, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &devInfo->key, NULL); + if (phantom) + RegSetValueExW(devInfo->key, Phantom, 0, REG_DWORD, + (LPBYTE)&phantom, sizeof(phantom)); RegCloseKey(enumKey); } } @@ -143,6 +150,19 @@ static void SETUPDI_FreeDeviceInfo(struct DeviceInfo *devInfo) { if (devInfo->key != INVALID_HANDLE_VALUE) RegCloseKey(devInfo->key); + if (devInfo->phantom) + { + HKEY enumKey; + LONG l; + + l = RegCreateKeyExW(HKEY_LOCAL_MACHINE, Enum, 0, NULL, 0, + KEY_ALL_ACCESS, NULL, &enumKey, NULL); + if (!l) + { + RegDeleteTreeW(enumKey, devInfo->instanceId); + RegCloseKey(enumKey); + } + } HeapFree(GetProcessHeap(), 0, devInfo->instanceId); HeapFree(GetProcessHeap(), 0, devInfo); } @@ -161,17 +181,19 @@ static void SETUPDI_GuidToString(const GUID *guid, LPWSTR guidStr) /* Adds a device with GUID guid and identifer devInst to set. Allocates a * struct DeviceInfo, and points the returned device info's Reserved member - * to it. + * to it. "Phantom" devices are deleted from the registry when closed. * Returns a pointer to the newly allocated device info. */ static BOOL SETUPDI_AddDeviceToSet(struct DeviceInfoSet *set, const GUID *guid, DWORD devInst, LPCWSTR instanceId, + BOOL phantom, SP_DEVINFO_DATA **dev) { BOOL ret = FALSE; - struct DeviceInfo *devInfo = SETUPDI_AllocateDeviceInfo(instanceId); + struct DeviceInfo *devInfo = SETUPDI_AllocateDeviceInfo(instanceId, + phantom); if (devInfo) { @@ -1002,7 +1024,7 @@ BOOL WINAPI SetupDiCreateDeviceInfoW( SP_DEVINFO_DATA *dev = NULL; ret = SETUPDI_AddDeviceToSet(set, ClassGuid, 0 /* FIXME: DevInst */, - instanceId, &dev); + instanceId, TRUE, &dev); if (ret) { if (DeviceDescription)
1
0
0
0
Juan Lang : setupapi: Save class GUID to registry when creating a device.
by Alexandre Julliard
21 Sep '07
21 Sep '07
Module: wine Branch: master Commit: 00ef2e3269a51e5817121ee47b3e18d9e58e77d5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=00ef2e3269a51e5817121ee47…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Sep 20 09:14:27 2007 -0700 setupapi: Save class GUID to registry when creating a device. --- dlls/setupapi/devinst.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 0a3e599..3c8715c 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -183,11 +183,17 @@ static BOOL SETUPDI_AddDeviceToSet(struct DeviceInfoSet *set, sizeof(SP_DEVINFO_DATA)); if (set->devices) { + WCHAR classGuidStr[39]; + *dev = &set->devices[set->cDevices++]; (*dev)->cbSize = sizeof(SP_DEVINFO_DATA); memcpy(&(*dev)->ClassGuid, guid, sizeof(GUID)); (*dev)->DevInst = devInst; (*dev)->Reserved = (ULONG_PTR)devInfo; + SETUPDI_GuidToString(guid, classGuidStr); + SetupDiSetDeviceRegistryPropertyW((HDEVINFO)set, + *dev, SPDRP_CLASSGUID, (const BYTE *)classGuidStr, + lstrlenW(classGuidStr) * sizeof(WCHAR)); ret = TRUE; } else
1
0
0
0
Juan Lang : setupapi: Save device description to registry when creating a device.
by Alexandre Julliard
21 Sep '07
21 Sep '07
Module: wine Branch: master Commit: 8985a62a340a7f1fdd44c91c878d0c94a0af5474 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8985a62a340a7f1fdd44c91c8…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Thu Sep 20 09:13:00 2007 -0700 setupapi: Save device description to registry when creating a device. --- dlls/setupapi/devinst.c | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 3a4c130..0a3e599 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -997,15 +997,22 @@ BOOL WINAPI SetupDiCreateDeviceInfoW( ret = SETUPDI_AddDeviceToSet(set, ClassGuid, 0 /* FIXME: DevInst */, instanceId, &dev); - if (ret && DeviceInfoData) + if (ret) { - if (DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA)) + if (DeviceDescription) + SetupDiSetDeviceRegistryPropertyW(DeviceInfoSet, + dev, SPDRP_DEVICEDESC, (const BYTE *)DeviceDescription, + lstrlenW(DeviceDescription) * sizeof(WCHAR)); + if (DeviceInfoData) { - SetLastError(ERROR_INVALID_USER_BUFFER); - ret = FALSE; + if (DeviceInfoData->cbSize != sizeof(SP_DEVINFO_DATA)) + { + SetLastError(ERROR_INVALID_USER_BUFFER); + ret = FALSE; + } + else + memcpy(DeviceInfoData, dev, sizeof(SP_DEVINFO_DATA)); } - else - memcpy(DeviceInfoData, dev, sizeof(SP_DEVINFO_DATA)); } } if (allocatedInstanceId)
1
0
0
0
← Newer
1
...
20
21
22
23
24
25
26
...
79
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Results per page:
10
25
50
100
200