53 DPRINT(
"RpcServerThread() called\n");
64 RegisteredProtSeq =
TRUE;
66 DPRINT1(
"RpcServerUseProtseqEpW() failed (Status %lx)\n",
Status);
75 RegisteredProtSeq =
TRUE;
77 DPRINT1(
"RpcServerUseProtseqEpW() failed (Status %lx)\n",
Status);
80 if (RegisteredProtSeq ==
FALSE)
88 DPRINT1(
"RpcServerRegisterIf() failed (Status %lx)\n",
Status);
102 DPRINT1(
"*** Other devices won't be installed correctly. If something\n");
103 DPRINT1(
"*** doesn't work, try to reboot to get a new chance.\n");
105 DPRINT(
"RpcServerThread() done\n");
164 wcscpy(szLocalDeviceInstanceID, pszDeviceInstanceID);
170 lpEnumerator = szLocalDeviceInstanceID;
186 if (lpEnumerator !=
NULL)
187 wcscpy(pszEnumerator, lpEnumerator);
189 if (lpDevice !=
NULL)
190 wcscpy(pszDevice, lpDevice);
192 if (lpInstance !=
NULL)
193 wcscpy(pszInstance, lpInstance);
208 DPRINT1(
"ClearDeviceStatus(%S 0x%lx 0x%lx)\n",
209 pszDeviceID, ulStatus, ulProblem);
218 (
PVOID)&PlugPlayData,
238 DPRINT(
"GetDeviceStatus(%S %p %p)\n",
239 pszDeviceID, pulStatus, pulProblem);
246 (
PVOID)&PlugPlayData,
273 DPRINT1(
"SetDeviceStatus(%S 0x%lx 0x%lx)\n",
274 pszDeviceID, ulStatus, ulProblem);
283 (
PVOID)&PlugPlayData,
304 DPRINT1(
"DisableDeviceInstance(%S %p %p %lu)\n",
305 pszDeviceInstance, pVetoType, pszVetoName, ulNameLength);
310 QueryRemoveData.
Flags = 0;
312 QueryRemoveData.
VetoName = pszVetoName;
324 if (pVetoType !=
NULL)
325 *pVetoType = QueryRemoveData.
VetoType;
343 INT nPartLength[3] = {0, 0, 0};
347 DPRINT(
"IsValidDeviceInstanceID(%S)\n",
348 pszDeviceInstanceID);
350 if (pszDeviceInstanceID ==
NULL)
352 DPRINT(
"Device instance ID is NULL!\n");
356 p = pszDeviceInstanceID;
364 DPRINT(
"Too many separators: %d\n", nParts);
370 nPartLength[nParts]++;
385 DPRINT(
"Invalid number of separtors: %d\n", nParts);
389 if ((nPartLength[0] == 0) ||
390 (nPartLength[1] == 0) ||
391 (nPartLength[2] == 0))
393 DPRINT(
"Invalid part lengths: %d %d %d\n",
394 nPartLength[0], nPartLength[1], nPartLength[2]);
398 DPRINT(
"Valid device instance ID!\n");
421 DWORD ulStatus, ulProblem;
440 wcscpy(szKeyName,
L"System\\CurrentControlSet\\Enum\\");
441 wcscat(szKeyName, pszDeviceID);
452 switch (ulLogConfType)
456 pszSubKeyName =
L"LogConf";
461 pszSubKeyName =
L"Control";
465 DPRINT1(
"Unsupported configuration type!\n");
501 switch (ulLogConfType)
504 pszValueName =
L"BootConfig";
509 pszValueName =
L"AllocConfig";
514 pszValueName =
L"ForcedConfig";
519 pszValueName =
L"FilteredConfigVector";
524 pszValueName =
L"BasicConfigVector";
529 pszValueName =
L"OverrideConfigVector";
534 DPRINT1(
"Unsupported configuration type!\n");
551 if (*ppBuffer ==
NULL)
591 DPRINT1(
"AllocateAndInitializeSid failed\n");
599 DPRINT1(
"RpcImpersonateClient failed (Status 0x%08lx)\n", RpcStatus);
626 DPRINT1(
"PNP_NOTIFY_HANDLE_rundown(%p)\n", pHandle);
663 DPRINT(
"PNP_GetVersion(%p %p)\n",
682 DPRINT(
"PNP_GetGlobalState(%p %p 0x%08lx)\n",
705 DPRINT(
"PNP_InitDetection(%p)\n",
725 DPRINT(
"PNP_ReportLogOn(%p %u, %u)\n",
781 DPRINT(
"PNP_ValidateDeviceInstance(%p %S 0x%08lx)\n",
793 DPRINT(
"Could not open the Device Key!\n");
801 if (hDeviceKey !=
NULL)
804 DPRINT(
"PNP_ValidateDeviceInstance() done (returns %lx)\n",
ret);
822 DPRINT(
"PNP_GetRootDeviceInstance(%p %S %lu)\n",
841 DPRINT(
"PNP_GetRootDeviceInstance() done (returns %lx)\n",
ret);
852 DWORD ulRelationship,
865 DPRINT(
"PNP_GetRelatedDeviceInstance(%p %lu %S %p %p 0x%lx)\n",
866 hBinding, ulRelationship, pDeviceID, pRelatedDeviceId,
872 if (ulRelationship == PNP_GET_PARENT_DEVICE_INSTANCE)
892 else if (ulRelationship == PNP_GET_SIBLING_DEVICE_INSTANCE)
902 PlugPlayData.
Relation = ulRelationship;
908 (
PVOID)&PlugPlayData,
915 DPRINT(
"PNP_GetRelatedDeviceInstance() done (returns %lx)\n",
ret);
944 DPRINT(
"PNP_EnumerateSubKeys(%p %lu %lu %p %lu %p 0x%08lx)\n",
946 pulRequiredLen, ulFlags);
950 case PNP_ENUMERATOR_SUBKEYS:
954 case PNP_CLASS_SUBKEYS:
962 *pulRequiredLen = ulLength;
980 DPRINT(
"PNP_EnumerateSubKeys() done (returns %lx)\n",
ret);
1019 PlugPlayData.
Buffer = pszBuffer;
1022 (
PVOID)&PlugPlayData,
1044 WCHAR szPathBuffer[512];
1047 DWORD dwValues,
dwSize, dwIndex, dwUsedLength, dwPathLength;
1054 L"System\\CurrentControlSet\\Services",
1060 DPRINT(
"Failed to open the services key (Error %lu)\n", dwError);
1071 DPRINT(
"Failed to open the service key (Error %lu)\n", dwError);
1083 DPRINT(
"Failed to open the service enum key (Error %lu)\n", dwError);
1098 DPRINT(
"RegQueryValueExW failed (Error %lu)\n", dwError);
1102 DPRINT(
"dwValues %lu\n", dwValues);
1107 for (dwIndex = 0; dwIndex < dwValues; dwIndex++)
1111 dwSize =
sizeof(szPathBuffer);
1121 DPRINT(
"Path: %S\n", szPathBuffer);
1123 dwPathLength =
wcslen(szPathBuffer) + 1;
1124 if (dwUsedLength + dwPathLength + 1 > *pulLength)
1130 wcscpy(pPtr, szPathBuffer);
1131 dwUsedLength += dwPathLength;
1132 pPtr += dwPathLength;
1141 if (hServiceKey !=
NULL)
1148 *pulLength = dwUsedLength + 1;
1164 WCHAR szPathBuffer[512];
1166 DWORD dwInstanceLength, dwPathLength, dwUsedLength;
1167 DWORD dwIndex, dwError;
1179 DPRINT(
"Failed to open the device key (Error %lu)\n", dwError);
1186 for (dwIndex = 0; ; dwIndex++)
1200 wsprintf(szPathBuffer,
L"%s\\%s", pszDevice, szInstanceBuffer);
1201 DPRINT(
"Path: %S\n", szPathBuffer);
1203 dwPathLength =
wcslen(szPathBuffer) + 1;
1204 if (dwUsedLength + dwPathLength + 1 > *pulLength)
1210 wcscpy(pPtr, szPathBuffer);
1211 dwUsedLength += dwPathLength;
1212 pPtr += dwPathLength;
1220 *pulLength = dwUsedLength + 1;
1235 WCHAR szPathBuffer[512];
1236 HKEY hEnumeratorKey;
1238 DWORD dwIndex, dwDeviceLength, dwUsedLength, dwRemainingLength, dwPathLength;
1250 DPRINT(
"Failed to open the enumerator key (Error %lu)\n", dwError);
1255 dwRemainingLength = *pulLength;
1258 for (dwIndex = 0; ; dwIndex++)
1272 wsprintf(szPathBuffer,
L"%s\\%s", pszEnumerator, szDeviceBuffer);
1273 DPRINT(
"Path: %S\n", szPathBuffer);
1275 dwPathLength = dwRemainingLength;
1282 dwUsedLength += dwPathLength - 1;
1283 dwRemainingLength -= dwPathLength - 1;
1284 pPtr += dwPathLength - 1;
1290 *pulLength = dwUsedLength + 1;
1306 DWORD dwIndex, dwEnumeratorLength, dwUsedLength, dwRemainingLength, dwPathLength;
1311 dwRemainingLength = *pulLength;
1314 for (dwIndex = 0; ; dwIndex++)
1320 &dwEnumeratorLength,
1325 dwPathLength = dwRemainingLength;
1332 dwUsedLength += dwPathLength - 1;
1333 dwRemainingLength -= dwPathLength - 1;
1334 pPtr += dwPathLength - 1;
1338 *pulLength = dwUsedLength + 1;
1361 DPRINT(
"PNP_GetDeviceList(%p %S %p %p 0x%08lx)\n",
1367 if (pulLength ==
NULL)
1371 (pszFilter ==
NULL))
1456 (
PVOID)&PlugPlayData,
1484 L"System\\CurrentControlSet\\Services",
1490 DPRINT(
"Failed to open the services key (Error %lu)\n", dwError);
1501 DPRINT(
"Failed to open the service key (Error %lu)\n", dwError);
1513 DPRINT(
"Failed to open the service enum key (Error %lu)\n", dwError);
1528 DPRINT(
"RegQueryValueExW failed (Error %lu)\n", dwError);
1547 DPRINT(
"RegQueryInfoKeyW failed (Error %lu)\n", dwError);
1551 DPRINT(
"dwValues %lu dwMaxValueLength %lu\n", dwValues, dwMaxValueLength /
sizeof(
WCHAR));
1554 *pulLength = dwValues * dwMaxValueLength /
sizeof(
WCHAR) + 2;
1560 if (hServiceKey !=
NULL)
1577 DWORD dwSubKeys, dwMaxSubKeyLength;
1588 DPRINT(
"Failed to open the device key (Error %lu)\n", dwError);
1607 DPRINT(
"RegQueryInfoKeyW failed (Error %lu)\n", dwError);
1609 dwMaxSubKeyLength = 0;
1616 *pulLength = dwSubKeys * (
wcslen(pszDevice) + 1 + dwMaxSubKeyLength + 1);
1629 WCHAR szPathBuffer[512];
1630 HKEY hEnumeratorKey;
1631 DWORD dwIndex, dwDeviceLength, dwBufferLength;
1645 DPRINT(
"Failed to open the enumerator key (Error %lu)\n", dwError);
1649 for (dwIndex = 0; ; dwIndex++)
1663 wsprintf(szPathBuffer,
L"%s\\%s", pszEnumerator, szDeviceBuffer);
1664 DPRINT(
"Path: %S\n", szPathBuffer);
1673 *pulLength += dwBufferLength;
1689 DWORD dwIndex, dwEnumeratorLength, dwBufferLength;
1693 for (dwIndex = 0; ; dwIndex++)
1699 &dwEnumeratorLength,
1710 *pulLength += dwBufferLength;
1731 DPRINT(
"PNP_GetDeviceListSize(%p %S %p 0x%08lx)\n",
1732 hBinding, pszFilter, pulLength, ulFlags);
1737 if (pulLength ==
NULL)
1741 (pszFilter ==
NULL))
1808 DPRINT(
"PNP_GetDepth(%p %S %p 0x%08lx)\n",
1809 hBinding, pszDeviceID, pulDepth, ulFlags);
1818 (
PVOID)&PlugPlayData,
1822 *pulDepth = PlugPlayData.
Depth;
1829 DPRINT(
"PNP_GetDepth() done (returns %lx)\n",
ret);
1842 DWORD *pulRegDataType,
1857 DPRINT(
"PNP_GetDeviceRegProp(%p %S %lu %p %p %p %p 0x%08lx)\n",
1859 pulTransferLen, pulLength, ulFlags);
1861 if (pulTransferLen ==
NULL || pulLength ==
NULL)
1880 if (*pulLength < *pulTransferLen)
1881 *pulLength = *pulTransferLen;
1883 *pulTransferLen = 0;
1888 lpValueName =
L"DeviceDesc";
1892 lpValueName =
L"HardwareID";
1896 lpValueName =
L"CompatibleIDs";
1900 lpValueName =
L"Service";
1904 lpValueName =
L"Class";
1908 lpValueName =
L"ClassGUID";
1912 lpValueName =
L"Driver";
1916 lpValueName =
L"ConfigFlags";
1920 lpValueName =
L"Mfg";
1924 lpValueName =
L"FriendlyName";
1928 lpValueName =
L"LocationInformation";
1933 *pulRegDataType =
REG_SZ;
1937 lpValueName =
L"Capabilities";
1945 lpValueName =
L"UpperFilters";
1949 lpValueName =
L"LowerFilters";
1969 *pulRegDataType =
REG_SZ;
1973 lpValueName =
L"Security";
1977 lpValueName =
L"DeviceType";
1981 lpValueName =
L"Exclusive";
1985 lpValueName =
L"DeviceCharacteristics";
1994 lpValueName =
L"UINumberDescFormat";
2013 lpValueName =
L"RemovalPolicy";
2022#if (WINVER >= _WIN32_WINNT_WS03)
2029#if (WINVER >= _WIN32_WINNT_WIN7)
2032 *pulRegDataType =
REG_SZ;
2041 DPRINT(
"Value name: %S\n", lpValueName);
2087 (
PVOID)&PlugPlayData,
2091 *pulLength = PlugPlayData.BufferSize;
2106 DPRINT(
"PNP_GetDeviceRegProp() done (returns %lx)\n",
ret);
2131 DPRINT(
"PNP_SetDeviceRegProp(%p %S %lu %lu %p %lu 0x%08lx)\n",
2141 lpValueName =
L"DeviceDesc";
2145 lpValueName =
L"HardwareID";
2149 lpValueName =
L"CompatibleIDs";
2153 lpValueName =
L"Service";
2157 lpValueName =
L"Class";
2161 lpValueName =
L"ClassGUID";
2165 lpValueName =
L"Driver";
2169 lpValueName =
L"ConfigFlags";
2173 lpValueName =
L"Mfg";
2177 lpValueName =
L"FriendlyName";
2181 lpValueName =
L"LocationInformation";
2185 lpValueName =
L"UpperFilters";
2189 lpValueName =
L"LowerFilters";
2193 lpValueName =
L"Security";
2197 lpValueName =
L"DeviceType";
2201 lpValueName =
L"Exclusive";
2205 lpValueName =
L"DeviceCharacteristics";
2209 lpValueName =
L"UINumberDescFormat";
2213 lpValueName =
L"RemovalPolicy";
2220 DPRINT(
"Value name: %S\n", lpValueName);
2248 DPRINT(
"PNP_SetDeviceRegProp() done (returns %lx)\n",
ret);
2263 WCHAR szClassGuid[40];
2264 WCHAR szClassInstance[5];
2266 HKEY hClassInstanceKey;
2267 ULONG ulTransferLength, ulDataLength;
2268 DWORD dwDataType, dwDisposition,
i;
2272 DPRINT(
"PNP_GetClassInstance(%p %S %p %lu)\n",
2273 hBinding, pDeviceId, pszClassInstance, ulLength);
2278 ulTransferLength = ulLength;
2283 (
BYTE *)pszClassInstance,
2290 ulTransferLength =
sizeof(szClassGuid);
2291 ulDataLength =
sizeof(szClassGuid);
2296 (
BYTE *)szClassGuid,
2302 DPRINT1(
"PNP_GetDeviceRegProp() failed (Error %lu)\n",
ret);
2313 DPRINT1(
"RegOpenKeyExW() failed (Error %lu)\n", dwError);
2318 for (
i = 0;
i < 10000;
i++)
2342 ulDataLength = (
wcslen(pszClassInstance) + 1) *
sizeof(
WCHAR);
2347 (
BYTE *)pszClassInstance,
2352 DPRINT1(
"PNP_SetDeviceRegProp() failed (Error %lu)\n",
ret);
2363 if (hDeviceClassKey !=
NULL)
2386 DPRINT(
"PNP_CreateKey(%p %S 0x%lx 0x%08lx)\n",
2387 hBinding, pszSubKey, samDesired, ulFlags);
2407 L"Device Parameters",
2424 if (hParametersKey !=
NULL)
2427 if (hDeviceKey !=
NULL)
2454 DWORD *pulClassCount,
2463 DPRINT(
"PNP_GetClassCount(%p %p 0x%08lx)\n",
2512 DPRINT(
"PNP_GetClassName(%p %S %p %p 0x%08lx)\n",
2515 lstrcpyW(szKeyName,
L"System\\CurrentControlSet\\Control\\Class\\");
2546 DPRINT(
"PNP_GetClassName() done (returns %lx)\n",
ret);
2564 DPRINT(
"PNP_DeleteClassKey(%p %S 0x%08lx)\n",
2578 DPRINT(
"PNP_DeleteClassKey() done (returns %lx)\n",
ret);
2589 LPWSTR pszInterfaceDevice,
2590 GUID *AliasInterfaceGuid,
2591 LPWSTR pszAliasInterfaceDevice,
2618 DPRINT(
"PNP_GetInterfaceDeviceList(%p %p %S %p %p 0x%08lx)\n",
2627 PlugPlayData.
Flags = ulFlags;
2633 (
PVOID)&PlugPlayData,
2644 DPRINT(
"PNP_GetInterfaceDeviceList() done (returns %lx)\n",
ret);
2665 DPRINT(
"PNP_GetInterfaceDeviceListSize(%p %p %p %S 0x%08lx)\n",
2677 PlugPlayData.
Flags = ulFlags;
2680 (
PVOID)&PlugPlayData,
2691 DPRINT(
"PNP_GetInterfaceDeviceListSize() done (returns %lx)\n",
ret);
2719 LPWSTR pszInterfaceDevice,
2734 DWORD *pulRegDataType,
2748 DPRINT(
"PNP_GetClassRegProp(%p %S %lu %p %p %p %p 0x%08lx)\n",
2749 hBinding, pszClassGuid, ulProperty, pulRegDataType,
2750 Buffer, pulTransferLen, pulLength, ulFlags);
2752 if (pulTransferLen ==
NULL || pulLength ==
NULL)
2764 if (*pulLength < *pulTransferLen)
2765 *pulLength = *pulTransferLen;
2767 *pulTransferLen = 0;
2772 lpValueName =
L"Security";
2776 lpValueName =
L"DeviceType";
2780 lpValueName =
L"Exclusive";
2784 lpValueName =
L"DeviceCharacteristics";
2792 DPRINT(
"Value name: %S\n", lpValueName);
2839 *pulTransferLen = *pulLength;
2841 if (hPropKey !=
NULL)
2844 if (hInstKey !=
NULL)
2847 DPRINT(
"PNP_GetClassRegProp() done (returns %lx)\n",
ret);
2873 DPRINT(
"PNP_SetClassRegProp(%p %S %lu %lu %p %lu 0x%08lx)\n",
2874 hBinding, pszClassGuid, ulProperty, ulDataType,
2875 Buffer, ulLength, ulFlags);
2883 lpValueName =
L"Security";
2887 lpValueName =
L"DeviceType";
2891 lpValueName =
L"Exclusive";
2895 lpValueName =
L"DeviceCharacteristics";
2947 if (hPropKey !=
NULL)
2950 if (hInstKey !=
NULL)
2966 HKEY hKeyEnumerator;
3020 DPRINT1(
"Instance %S already exists!\n", szInstance);
3047 DWORD dwPhantomValue = 1;
3052 (
PBYTE)&dwPhantomValue,
3053 sizeof(dwPhantomValue));
3085 DWORD dwInstanceNumber;
3094 dwInstanceNumber = 0;
3097 if (dwInstanceNumber >= 10000)
3100 swprintf(szGeneratedInstance,
L"Root\\%ls\\%04lu",
3101 pszDeviceID, dwInstanceNumber);
3113 if (
wcslen(szGeneratedInstance) > ulLength)
3119 wcscpy(pszDeviceID, szGeneratedInstance);
3132 LPWSTR pszParentDeviceID,
3142 DPRINT(
"PNP_CreateDevInst(%p %S %S %lu 0x%08lx)\n",
3143 hBinding, pszParentDeviceID, pszDeviceID, ulLength, ulFlags);
3148 if (pszDeviceID ==
NULL || pszParentDeviceID ==
NULL)
3201 sizeof(ControlData));
3224 DPRINT(
"PNP_CreateDevInst() done (returns %lx)\n",
ret);
3238 DWORD ulStatus, ulProblem;
3243 DPRINT1(
"SetupDeviceInstance(%S 0x%08lx)\n",
3244 pszDeviceInstance, ulMinorAction);
3264 dwSize =
sizeof(dwDisableCount);
3272 (dwDisableCount > 0))
3306 if (hDeviceKey !=
NULL)
3321 DPRINT(
"Enable device instance %S\n", pszDeviceInstance);
3341 DPRINT1(
"ReenumerateDeviceInstance(%S 0x%08lx)\n",
3342 pszDeviceInstance, ulMinorAction);
3349 DPRINT1(
"CM_REENUMERATE_RETRY_INSTALLATION not implemented!\n");
3354 EnumerateDeviceData.
Flags = 0;
3357 &EnumerateDeviceData,
3371 DWORD ulMajorAction,
3372 DWORD ulMinorAction,
3373 LPWSTR pszDeviceInstance1,
3374 LPWSTR pszDeviceInstance2)
3380 DPRINT(
"PNP_DeviceInstanceAction(%p %lu 0x%08lx %S %S)\n",
3381 hBinding, ulMajorAction, ulMinorAction,
3382 pszDeviceInstance1, pszDeviceInstance2);
3384 switch (ulMajorAction)
3386 case PNP_DEVINST_SETUP:
3391 case PNP_DEVINST_ENABLE:
3395 case PNP_DEVINST_REENUMERATE:
3401 DPRINT1(
"Unknown device action %lu: not implemented\n", ulMajorAction);
3405 DPRINT(
"PNP_DeviceInstanceAction() done (returns %lx)\n",
ret);
3421 DWORD ulDataType, ulTransferLength, ulLength;
3422 DWORD ulCapabilities, ulConfigFlags;
3428 DPRINT(
"PNP_GetDeviceStatus(%p %S %p %p 0x%08lx)\n",
3429 hBinding, pDeviceID, pulStatus, pulProblem, ulFlags);
3434 if ((pulStatus ==
NULL) || (pulProblem ==
NULL))
3445 ulTransferLength =
sizeof(ulCapabilities);
3446 ulLength =
sizeof(ulCapabilities);
3451 (
PBYTE)&ulCapabilities,
3462 ulTransferLength =
sizeof(ulConfigFlags);
3463 ulLength =
sizeof(ulConfigFlags);
3468 (
PBYTE)&ulConfigFlags,
3498 ULONG ulOldStatus, ulOldProblem;
3503 DPRINT1(
"PNP_SetDeviceProblem(%p %S %lu 0x%08lx)\n",
3504 hBinding, pDeviceID, ulProblem, ulFlags);
3519 (ulOldProblem != 0) &&
3520 (ulOldProblem != ulProblem))
3555 DPRINT1(
"PNP_DisableDevInst(%p %S %p %p %lu 0x%08lx)\n",
3556 hBinding, pDeviceID, pVetoType, pszVetoName, ulNameLength, ulFlags);
3592 lpPtr = lpDeviceIdList;
3596 if (0 ==
_wcsicmp(lpPtr, lpDeviceId))
3614 dwLen =
wcslen(lpDeviceId);
3615 dwPos = (*lpDeviceIdListSize /
sizeof(
WCHAR)) - 1;
3617 wcscpy(&lpDeviceIdList[dwPos], lpDeviceId);
3619 dwPos += (dwLen + 1);
3621 lpDeviceIdList[dwPos] = 0;
3623 *lpDeviceIdListSize = dwPos *
sizeof(
WCHAR);
3639 DWORD dwDeviceIdListSize;
3640 DWORD dwNewDeviceIdSize;
3645 DPRINT(
"PNP_AddID(%p %S %S 0x%08lx)\n",
3646 hBinding, pszDeviceID, pszID, ulFlags);
3654 DPRINT(
"Failed to open the device key!\n");
3667 DPRINT(
"Failed to query the desired ID string!\n");
3672 dwNewDeviceIdSize =
lstrlenW(pszDeviceID);
3673 if (!dwNewDeviceIdSize)
3679 dwDeviceIdListSize += (dwNewDeviceIdSize + 2) *
sizeof(
WCHAR);
3682 if (!pszDeviceIdList)
3684 DPRINT(
"Failed to allocate memory for the desired ID string!\n");
3696 DPRINT(
"Failed to query the desired ID string!\n");
3704 DPRINT(
"Device ID was found in the ID string!\n");
3719 DPRINT(
"Failed to set the desired ID string!\n");
3725 if (pszDeviceIdList)
3728 DPRINT(
"PNP_AddID() done (returns %lx)\n",
ret);
3742 DPRINT(
"PNP_RegisterDriver(%p %S 0x%lx)\n",
3772 DPRINT1(
"PNP_QueryRemove(%p %S %p %p %lu 0x%lx)\n",
3773 hBinding, pszDeviceID, pVetoType, pszVetoName,
3774 ulNameLength, ulFlags);
3783 if (pVetoType !=
NULL)
3786 if (pszVetoName !=
NULL && ulNameLength > 0)
3792 PlugPlayData.
VetoName = pszVetoName;
3798 sizeof(PlugPlayData));
3821 DPRINT1(
"PNP_RequestDeviceEject(%p %S %p %p %lu 0x%lx)\n",
3822 hBinding, pszDeviceID, pVetoType, pszVetoName,
3823 ulNameLength, ulFlags);
3831 if (pVetoType !=
NULL)
3834 if (pszVetoName !=
NULL && ulNameLength > 0)
3840 PlugPlayData.
VetoName = pszVetoName;
3846 sizeof(PlugPlayData));
3869 DPRINT1(
"PNP_IsDockStationPresent(%p %p)\n",
3898 else if (dwValue != 0)
3904 DPRINT1(
"PNP_IsDockStationPresent() done (returns %lx)\n",
ret);
3934 szDockDeviceInstance,
3964 DPRINT(
"PNP_HwProfFlags() called\n");
3972 L"System\\CurrentControlSet\\HardwareProfiles\\Current\\System\\CurrentControlSet\\Enum");
3977 L"System\\CurrentControlSet\\HardwareProfiles\\%04lu\\System\\CurrentControlSet\\Enum",
3988 if (ulAction == PNP_GET_HWPROFFLAGS)
4014 else if (ulAction == PNP_SET_HWPROFFLAGS)
4033 DWORD ulProfileInfoSize,
4036 WCHAR szProfileName[5];
4040 DWORD dwDisposition;
4047 DPRINT(
"PNP_GetHwProfInfo() called\n");
4049 if (ulProfileInfoSize == 0)
4068 L"System\\CurrentControlSet\\Control\\IDConfigDB",
4084 L"Hardware Profiles",
4098 if (ulIndex == (
ULONG)-1)
4148 if (hKeyProfile !=
NULL)
4151 if (hKeyProfiles !=
NULL)
4154 if (hKeyConfig !=
NULL)
4168 DWORD *pulLogConfTag,
4182 DWORD ulLogConfType,
4197 DWORD ulLogConfType,
4198 DWORD *pulLogConfTag,
4202 DWORD RegDataType = 0;
4203 ULONG ulDataSize = 0;
4207 DPRINT(
"PNP_GetFirstLogConf(%p %S %lu %p 0x%08lx)\n",
4208 hBinding, pDeviceID, ulLogConfType, pulLogConfTag, ulFlags);
4210 if (pulLogConfTag ==
NULL)
4213 *pulLogConfTag = (
DWORD)0;
4226 DPRINT1(
"OpenConfigurationKey() failed (Error %lu)\n",
ret);
4238 DPRINT1(
"GetConfigurationData() failed (Error %lu)\n",
ret);
4243 DPRINT1(
"Data size %lu\n", ulDataSize);
4244 if (ulDataSize == 0 || lpData ==
NULL)
4246 DPRINT1(
"No config data available!\n");
4259 DPRINT1(
"No resource descriptors!\n");
4266 DPRINT(
"REG_RESOURCE_REQUIREMENTS_LIST->AlternativeLists %lu\n",
4281 if (hConfigKey !=
NULL)
4284 DPRINT(
"PNP_GetFirstLogConf() returns %lu\n",
ret);
4296 DWORD ulLogConfType,
4302 DWORD RegDataType = 0;
4303 ULONG ulDataSize = 0;
4307 DPRINT(
"PNP_GetNextLogConf(%p %S %lu %ul %p 0x%08lx)\n",
4308 hBinding, pDeviceID, ulLogConfType, ulCurrentTag, pulNextTag, ulFlags);
4310 if (pulNextTag ==
NULL)
4313 *pulNextTag = (
DWORD)0;
4326 DPRINT1(
"OpenConfigurationKey() failed (Error %lu)\n",
ret);
4338 DPRINT1(
"GetConfigurationData() failed (Error %lu)\n",
ret);
4343 DPRINT(
"Data size %lu\n", ulDataSize);
4345 if (ulDataSize == 0 || lpData ==
NULL)
4347 DPRINT1(
"No config data available!\n");
4373 DPRINT(
"REG_RESOURCE_REQUIREMENTS_LIST->AlternativeLists %lu\n",
4392 *pulNextTag = ulCurrentTag + 1;
4398 if (hConfigKey !=
NULL)
4401 DPRINT(
"PNP_GetNextLogConf() returns %lu\n",
ret);
4430 DWORD ulLogConfType,
4432 DWORD *pulResourceTag,
4449 DWORD ulLogConfType,
4451 DWORD ulResourceTag,
4452 DWORD *pulPreviousResType,
4453 DWORD *pulPreviousResTag,
4468 DWORD ulLogConfType,
4470 DWORD ulResourceTag,
4471 DWORD *pulNextResType,
4472 DWORD *pulNextResTag,
4476 DWORD RegDataType = 0;
4477 ULONG ulDataSize = 0;
4481 DPRINT1(
"PNP_GetNextResDes(%p %S 0x%lx %lu %lu %ul %p %p 0x%08lx)\n",
4482 hBinding, pDeviceID, ulLogConfTag, ulLogConfType, ResourceID,
4483 ulResourceTag, pulNextResType, pulNextResTag, ulFlags);
4485 if (pulNextResType ==
NULL)
4488 *pulNextResType = 0;
4501 DPRINT1(
"OpenConfigurationKey() failed (Error %lu)\n",
ret);
4513 DPRINT1(
"GetConfigurationData() failed (Error %lu)\n",
ret);
4518 DPRINT1(
"Data size %lu\n", ulDataSize);
4520 if (ulDataSize == 0 || lpData ==
NULL)
4522 DPRINT1(
"No config data available!\n");
4530 DPRINT1(
"FIXME: REG_RESOURCE_LIST\n");
4537 DPRINT1(
"FIXME: REG_RESOURCE_REQUIREMENTS_LIST\n");
4547 if (hConfigKey !=
NULL)
4550 DPRINT1(
"PNP_GetNextResDes() returns %lu\n",
ret);
4563 DWORD ulLogConfType,
4565 DWORD ulResourceTag,
4582 DWORD ulLogConfType,
4584 DWORD ulResourceTag,
4600 DWORD ulLogConfType,
4603 DWORD ulResourceTag,
4622 BOOL *pbConflictDetected,
4625 DPRINT(
"PNP_DetectResourceConflict()\n");
4627 if (pbConflictDetected !=
NULL)
4628 *pbConflictDetected =
FALSE;
4657 DWORD ulHardwareProfile,
4714 BYTE *pNotificationFilter,
4715 DWORD ulNotificationFilterSize,
4725 DPRINT1(
"PNP_RegisterNotification(%p %p '%S' %p %lu 0x%lx %p %lx %p)\n",
4726 hBinding, hRecipient, pszName, pNotificationFilter,
4727 ulNotificationFilterSize, ulFlags, pNotifyHandle, ulProcessId, pulUnknown9);
4729 if (pNotifyHandle ==
NULL)
4732 *pNotifyHandle =
NULL;
4734 if (pNotificationFilter ==
NULL ||
4735 pulUnknown9 ==
NULL)
4747 DPRINT1(
"DBT_DEVTYP_DEVICEINTERFACE\n");
4755 if (pNotifyData ==
NULL)
4758 if (pszName !=
NULL)
4773 DPRINT(
"pNotifyData: %p\n", pNotifyData);
4778 DPRINT1(
"DBT_DEVTYP_HANDLE\n");
4785 if (ulFlags & DEVICE_NOTIFY_ALL_INTERFACE_CLASSES)
4807 DPRINT1(
"PNP_UnregisterNotification(%p %p)\n",
4818 *pNotifyHandle =
NULL;
4831 DWORD *pulRegDataType,
4844 DPRINT(
"PNP_GetCustomDevProp() called\n");
4846 if (pulTransferLen ==
NULL || pulLength ==
NULL)
4861 if (*pulLength < *pulTransferLen)
4862 *pulLength = *pulTransferLen;
4864 *pulTransferLen = 0;
4878 L"Device Parameters",
4909 *pulTransferLen = *pulLength;
4911 if (hParamKey !=
NULL)
4914 if (hDeviceKey !=
NULL)
4917 DPRINT(
"PNP_GetCustomDevProp() done (returns %lx)\n",
ret);
4957 DWORD *pulSSDIFlags,
4962 DPRINT1(
"PNP_GetServerSideDeviceInstallFlags(%p %p %lu)\n",
4965 if (pulSSDIFlags ==
NULL)
4985 LPWSTR PropertyCultureName,
5003 LPWSTR PropertyCultureName,
5023 LPWSTR PropertyCultureName,