- Implement CM_Enumerate_Enumerators[_Ex]A/W

- Fix PNP_EnumerateSubKeys

svn path=/trunk/; revision=17785
This commit is contained in:
Eric Kohl 2005-09-10 19:01:44 +00:00
parent 9162d35b10
commit f913bdb378
5 changed files with 100 additions and 13 deletions

View file

@ -39,6 +39,8 @@ interface pnp
[in] DWORD Length,
[in] DWORD Flags);
cpp_quote("#define PNP_BRANCH_ENUM 1")
cpp_quote("#define PNP_BRANCH_CLASS 2")
CONFIGRET PNP_EnumerateSubKeys(handle_t BindingHandle,
[in] unsigned long Branch,
[in] unsigned long Index,

View file

@ -137,6 +137,12 @@ CONFIGRET WINAPI CM_Delete_Class_Key_Ex( LPGUID, ULONG, HANDLE );
CONFIGRET WINAPI CM_Disconnect_Machine( HMACHINE );
CONFIGRET WINAPI CM_Enumerate_Classes( ULONG, LPGUID, ULONG );
CONFIGRET WINAPI CM_Enumerate_Classes_Ex( ULONG, LPGUID, ULONG, HMACHINE );
CONFIGRET WINAPI CM_Enumerate_EnumeratorsA( ULONG, PCHAR, PULONG, ULONG );
CONFIGRET WINAPI CM_Enumerate_EnumeratorsW( ULONG, PWCHAR, PULONG, ULONG );
#define CM_Enumerate_Enumerators WINELIB_NAME_AW(CM_Enumerate_Enumerators)
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExA( ULONG, PCHAR, PULONG, ULONG, HMACHINE );
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExW( ULONG, PWCHAR, PULONG, ULONG, HMACHINE );
#define CM_Enumerate_Enumerators_Ex WINELIB_NAME_AW(CM_Enumerate_Enumerators_Ex)
CONFIGRET WINAPI CM_Get_Child( PDEVINST, DEVINST, ULONG );
CONFIGRET WINAPI CM_Get_Child_Ex( PDEVINST, DEVINST, ULONG, HMACHINE );
CONFIGRET WINAPI CM_Get_Class_Key_NameA( LPGUID, LPSTR, PULONG, ULONG );

View file

@ -313,6 +313,85 @@ CONFIGRET WINAPI CM_Enumerate_Classes_Ex(
}
/***********************************************************************
* CM_Enumerate_EnumeratorsA [SETUPAPI.@]
*/
CONFIGRET WINAPI CM_Enumerate_EnumeratorsA(
ULONG ulEnumIndex, PCHAR Buffer, PULONG pulLength, ULONG ulFlags)
{
TRACE("%lu %p %p %lx\n", ulEnumIndex, Buffer, pulLength, ulFlags);
return CM_Enumerate_Enumerators_ExA(ulEnumIndex, Buffer, pulLength,
ulFlags, NULL);
}
/***********************************************************************
* CM_Enumerate_EnumeratorsW [SETUPAPI.@]
*/
CONFIGRET WINAPI CM_Enumerate_EnumeratorsW(
ULONG ulEnumIndex, PWCHAR Buffer, PULONG pulLength, ULONG ulFlags)
{
TRACE("%lu %p %p %lx\n", ulEnumIndex, Buffer, pulLength, ulFlags);
return CM_Enumerate_Enumerators_ExW(ulEnumIndex, Buffer, pulLength,
ulFlags, NULL);
}
/***********************************************************************
* CM_Enumerate_Enumerators_ExA [SETUPAPI.@]
*/
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExA(
ULONG ulEnumIndex, PCHAR Buffer, PULONG pulLength, ULONG ulFlags,
HMACHINE hMachine)
{
FIXME("%lu %p %p %lx %lx\n", ulEnumIndex, Buffer, pulLength, ulFlags,
hMachine);
return CR_CALL_NOT_IMPLEMENTED;
}
/***********************************************************************
* CM_Enumerate_Enumerators_ExW [SETUPAPI.@]
*/
CONFIGRET WINAPI CM_Enumerate_Enumerators_ExW(
ULONG ulEnumIndex, PWCHAR Buffer, PULONG pulLength, ULONG ulFlags,
HMACHINE hMachine)
{
RPC_BINDING_HANDLE BindingHandle = NULL;
FIXME("%lu %p %p %lx %lx\n", ulEnumIndex, Buffer, pulLength, ulFlags,
hMachine);
if (Buffer == NULL || pulLength == NULL)
return CR_INVALID_POINTER;
if (ulFlags != 0)
return CR_INVALID_FLAG;
Buffer[0] = (WCHAR)0;
if (hMachine != NULL)
{
BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle;
if (BindingHandle == NULL)
return CR_FAILURE;
}
else
{
if (!PnpGetLocalHandles(&BindingHandle, NULL))
return CR_FAILURE;
}
return PNP_EnumerateSubKeys(BindingHandle,
PNP_BRANCH_ENUM,
ulEnumIndex,
Buffer,
*pulLength,
pulLength,
ulFlags);
}
/***********************************************************************
* CM_Get_Child [SETUPAPI.@]
*/

View file

@ -40,10 +40,10 @@
@ stub CM_Enable_DevNode_Ex
@ stdcall CM_Enumerate_Classes(long ptr long)
@ stdcall CM_Enumerate_Classes_Ex(long ptr long ptr)
@ stub CM_Enumerate_EnumeratorsA
@ stub CM_Enumerate_EnumeratorsW
@ stub CM_Enumerate_Enumerators_ExA
@ stub CM_Enumerate_Enumerators_ExW
@ stdcall CM_Enumerate_EnumeratorsA(long str ptr long)
@ stdcall CM_Enumerate_EnumeratorsW(long wstr ptr long)
@ stdcall CM_Enumerate_Enumerators_ExA(long str ptr long long)
@ stdcall CM_Enumerate_Enumerators_ExW(long wstr ptr long long)
@ stub CM_Find_Range
@ stub CM_First_Range
@ stub CM_Free_Log_Conf

View file

@ -262,15 +262,15 @@ PNP_EnumerateSubKeys(handle_t BindingHandle,
HKEY hKey;
DWORD dwError;
DPRINT1("PNP_EnumerateSubKeys() called\n");
DPRINT("PNP_EnumerateSubKeys() called\n");
switch (Branch)
{
case 1:
case PNP_BRANCH_ENUM:
hKey = hEnumKey;
break;
case 2:
case PNP_BRANCH_CLASS:
hKey = hClassKey;
break;
@ -289,14 +289,14 @@ PNP_EnumerateSubKeys(handle_t BindingHandle,
NULL);
if (dwError != ERROR_SUCCESS)
{
ret = CR_FAILURE;
ret = (dwError == ERROR_NO_MORE_ITEMS) ? CR_NO_SUCH_VALUE : CR_FAILURE;
}
else
{
*RequiredLength++;
}
DPRINT1("PNP_EnumerateSubKeys() done (returns %lx)\n", ret);
if (ret == CR_SUCCESS)
{
DPRINT1("Sub key: %S\n", Buffer);
}
DPRINT("PNP_EnumerateSubKeys() done (returns %lx)\n", ret);
return ret;
}