--- trunk/reactos/lib/setupapi/cfgmgr.c 2005-09-10 23:50:28 UTC (rev 17791)
+++ trunk/reactos/lib/setupapi/cfgmgr.c 2005-09-11 08:45:02 UTC (rev 17792)
@@ -344,9 +344,42 @@
ULONG ulEnumIndex, PCHAR Buffer, PULONG pulLength, ULONG ulFlags,
HMACHINE hMachine)
{
- FIXME("%lu %p %p %lx %lx\n", ulEnumIndex, Buffer, pulLength, ulFlags,
+ WCHAR szBuffer[MAX_DEVICE_ID_LEN];
+ ULONG ulOrigLength;
+ ULONG ulLength;
+ CONFIGRET ret = CR_SUCCESS;
+
+ TRACE("%lu %p %p %lx %lx\n", ulEnumIndex, Buffer, pulLength, ulFlags,
hMachine);
- return CR_CALL_NOT_IMPLEMENTED;
+
+ if (Buffer == NULL || pulLength == NULL)
+ return CR_INVALID_POINTER;
+
+ if (ulFlags != 0)
+ return CR_INVALID_FLAG;
+
+ ulOrigLength = *pulLength;
+ *pulLength = 0;
+
+ ulLength = MAX_DEVICE_ID_LEN;
+ ret = CM_Enumerate_Enumerators_ExW(ulEnumIndex, szBuffer, &ulLength,
+ ulFlags, hMachine);
+ if (ret == CR_SUCCESS)
+ {
+ if (WideCharToMultiByte(CP_ACP,
+ 0,
+ szBuffer,
+ ulLength,
+ Buffer,
+ ulOrigLength,
+ NULL,
+ NULL) == 0)
+ ret = CR_FAILURE;
+ else
+ *pulLength = lstrlenA(Buffer) + 1;
+ }
+
+ return ret;
}
@@ -359,7 +392,7 @@
{
RPC_BINDING_HANDLE BindingHandle = NULL;
- FIXME("%lu %p %p %lx %lx\n", ulEnumIndex, Buffer, pulLength, ulFlags,
+ TRACE("%lu %p %p %lx %lx\n", ulEnumIndex, Buffer, pulLength, ulFlags,
hMachine);
if (Buffer == NULL || pulLength == NULL)
@@ -368,7 +401,7 @@
if (ulFlags != 0)
return CR_INVALID_FLAG;
- Buffer[0] = (WCHAR)0;
+ *Buffer = UNICODE_NULL;
if (hMachine != NULL)
{