https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fcba0968bef3e3ec529beb...
commit fcba0968bef3e3ec529bebb5a97445a44c7068ba Author: Stanislav Motylkov x86corez@gmail.com AuthorDate: Mon May 23 23:50:47 2022 +0300 Commit: Stanislav Motylkov x86corez@gmail.com CommitDate: Mon May 23 23:50:47 2022 +0300
[DESK] Add debug prints to pCDevSettings_GetDeviceInstanceId
Addendum to 3900cf88. --- dll/cpl/desk/devsett.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/dll/cpl/desk/devsett.c b/dll/cpl/desk/devsett.c index 27e75d6d349..dc801f4c624 100644 --- a/dll/cpl/desk/devsett.c +++ b/dll/cpl/desk/devsett.c @@ -199,27 +199,40 @@ pCDevSettings_GetDeviceInstanceId(const WCHAR *pszDevice)
DevInfo = SetupDiGetClassDevsW(NULL, pszDevice, NULL, DIGCF_ALLCLASSES | DIGCF_PRESENT); if (DevInfo == INVALID_HANDLE_VALUE) + { + DPRINT1("SetupDiGetClassDevsW("%ws") failed: %d\n", pszDevice, GetLastError()); return NULL; + }
ZeroMemory(&InfoData, sizeof(InfoData)); InfoData.cbSize = sizeof(InfoData);
/* Try to enumerate the first matching device */ if (!SetupDiEnumDeviceInfo(DevInfo, 0, &InfoData)) + { + DPRINT1("SetupDiEnumDeviceInfo failed: %d\n", GetLastError()); return NULL; + }
if (SetupDiGetDeviceInstanceId(DevInfo, &InfoData, NULL, 0, &BufLen) || GetLastError() != ERROR_INSUFFICIENT_BUFFER) + { + DPRINT1("SetupDiGetDeviceInstanceId failed: %d\n", GetLastError()); return NULL; + }
lpDevInstId = LocalAlloc(LMEM_FIXED, (BufLen + 1) * sizeof(WCHAR));
if (lpDevInstId == NULL) + { + DPRINT1("LocalAlloc failed\n"); return NULL; + }
if (!SetupDiGetDeviceInstanceId(DevInfo, &InfoData, lpDevInstId, BufLen, NULL)) { + DPRINT1("SetupDiGetDeviceInstanceId failed: %d\n", GetLastError()); LocalFree((HLOCAL)lpDevInstId); lpDevInstId = NULL; }