Forward CM_Create_DevNode[_Ex]A/W to umpnpmgr.
Modified: trunk/reactos/include/idl/pnp.idl Modified: trunk/reactos/include/wine/cfgmgr32.h Modified: trunk/reactos/lib/cfgmgr32/cfgmgr32.def Modified: trunk/reactos/lib/setupapi/cfgmgr.c Modified: trunk/reactos/lib/setupapi/setupapi.spec Modified: trunk/reactos/services/umpnpmgr/umpnpmgr.c Modified: trunk/reactos/w32api/include/ddk/cfgmgr32.h
--- trunk/reactos/include/idl/pnp.idl 2006-01-22 14:08:06 UTC (rev 20977) +++ trunk/reactos/include/idl/pnp.idl 2006-01-22 14:33:04 UTC (rev 20978) @@ -16,163 +16,170 @@
] interface pnp {
- /* Function 0 */ -// CONFIGRET PNP_Unknown0(handle_t BindingHandle);
+ /* Function 0 */ +// CONFIGRET PNP_Unknown0(handle_t BindingHandle);
- /* Function 1 */ -// CONFIGRET PNP_Unknown1(handle_t BindingHandle);
+ /* Function 1 */ +// CONFIGRET PNP_Unknown1(handle_t BindingHandle);
- /* Function 2 */
- CONFIGRET PNP_GetVersion(handle_t BindingHandle,
- [out] WORD *Version);
+ /* Function 2 */
+ CONFIGRET PNP_GetVersion(handle_t BindingHandle,
+ [out] WORD *Version);
- /* Function 3 */
- CONFIGRET PNP_GetGlobalState(handle_t BindingHandle,
- [out] unsigned long *State,
- [in] unsigned long Flags);
+ /* Function 3 */
+ CONFIGRET PNP_GetGlobalState(handle_t BindingHandle,
+ [out] unsigned long *State,
+ [in] unsigned long Flags);
- /* Function 4 */
- CONFIGRET PNP_InitDetection(handle_t BindingHandle);
+ /* Function 4 */
+ CONFIGRET PNP_InitDetection(handle_t BindingHandle);
- /* Function 5 */
- CONFIGRET PNP_ReportLogOn(handle_t BindingHandle,
- [in] BOOL Admin,
- [in] DWORD ProcessId);
+ /* Function 5 */
+ CONFIGRET PNP_ReportLogOn(handle_t BindingHandle,
+ [in] BOOL Admin,
+ [in] DWORD ProcessId);
- /* Function 6 */
- CONFIGRET PNP_ValidateDeviceInstance(handle_t BindingHandle,
- [in, string] wchar_t *DeviceInstance,
- [in] DWORD Flags);
+ /* Function 6 */
+ CONFIGRET PNP_ValidateDeviceInstance(handle_t BindingHandle,
+ [in, string] wchar_t *DeviceInstance,
+ [in] DWORD Flags);
- /* Function 7 */
- CONFIGRET PNP_GetRootDeviceInstance(handle_t BindingHandle,
- [out, string, size_is(Length)] wchar_t *DeviceInstance,
- [in] DWORD Length);
+ /* Function 7 */
+ CONFIGRET PNP_GetRootDeviceInstance(handle_t BindingHandle,
+ [out, string, size_is(Length)] wchar_t *DeviceInstance,
+ [in] DWORD Length);
- /* Function 8 */
- cpp_quote("#define PNP_DEVICE_PARENT 1")
- cpp_quote("#define PNP_DEVICE_CHILD 2")
- cpp_quote("#define PNP_DEVICE_SIBLING 3")
- CONFIGRET PNP_GetRelatedDeviceInstance(handle_t BindingHandle,
- [in] DWORD Relationship,
- [in, string] wchar_t *DeviceId,
- [out, string, size_is(Length)] wchar_t *RelatedDeviceId,
- [in] DWORD Length,
- [in] DWORD Flags);
+ /* Function 8 */
+ cpp_quote("#define PNP_DEVICE_PARENT 1")
+ cpp_quote("#define PNP_DEVICE_CHILD 2")
+ cpp_quote("#define PNP_DEVICE_SIBLING 3")
+ CONFIGRET PNP_GetRelatedDeviceInstance(handle_t BindingHandle,
+ [in] DWORD Relationship,
+ [in, string] wchar_t *DeviceId,
+ [out, string, size_is(Length)] wchar_t *RelatedDeviceId,
+ [in] DWORD Length,
+ [in] DWORD Flags);
- /* Function 9 */
- 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,
- [out, string, size_is(Length)] wchar_t *Buffer,
- [in] unsigned long Length,
- [out] unsigned long *RequiredLength,
- [in] DWORD Flags);
+ /* Function 9 */
+ 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,
+ [out, string, size_is(Length)] wchar_t *Buffer,
+ [in] unsigned long Length,
+ [out] unsigned long *RequiredLength,
+ [in] DWORD Flags);
- /* Function 10 */ -// CONFIGRET PNP_GetDeviceList(handle_t BindingHandle, -// [in, unique, string] wchar_t *Filter, -// [out, string, size_is(*Length)] unsigned char *Buffer -// [in, out] unsigned long *Length, -// [in] DWORD Flags);
+ /* Function 10 */ +// CONFIGRET PNP_GetDeviceList(handle_t BindingHandle, +// [in, unique, string] wchar_t *Filter, +// [out, string, size_is(*Length)] unsigned char *Buffer +// [in, out] unsigned long *Length, +// [in] DWORD Flags);
- /* Function 11 */
- CONFIGRET PNP_GetDeviceListSize(handle_t BindingHandle,
- [in, unique, string] wchar_t *Filter,
- [out] unsigned long *Length,
- [in] DWORD Flags);
+ /* Function 11 */
+ CONFIGRET PNP_GetDeviceListSize(handle_t BindingHandle,
+ [in, unique, string] wchar_t *Filter,
+ [out] unsigned long *Length,
+ [in] DWORD Flags);
- /* Function 12 */
- CONFIGRET PNP_GetDepth(handle_t BindingHandle,
- [in, string] wchar_t *DeviceInstance,
- [out] unsigned long *Depth,
- [in] DWORD Flags);
+ /* Function 12 */
+ CONFIGRET PNP_GetDepth(handle_t BindingHandle,
+ [in, string] wchar_t *DeviceInstance,
+ [out] unsigned long *Depth,
+ [in] DWORD Flags);
- /* Function 13 */
- CONFIGRET PNP_GetDeviceRegProp(handle_t BindingHandle,
- [in, string] wchar_t *DeviceInstance,
- [in] unsigned long Property,
- [in, out] unsigned long *DataType,
- [out, size_is(*TransferLen)] char *Buffer,
- [in, out] unsigned long *TransferLen,
- [in, out] unsigned long *Length,
- [in] DWORD Flags);
+ /* Function 13 */
+ CONFIGRET PNP_GetDeviceRegProp(handle_t BindingHandle,
+ [in, string] wchar_t *DeviceInstance,
+ [in] unsigned long Property,
+ [in, out] unsigned long *DataType,
+ [out, size_is(*TransferLen)] char *Buffer,
+ [in, out] unsigned long *TransferLen,
+ [in, out] unsigned long *Length,
+ [in] DWORD Flags);
- /* Function 14 */
- CONFIGRET PNP_SetDeviceRegProp(handle_t BindingHandle,
- [in, string] wchar_t *DeviceId,
- [in] unsigned long Property,
- [in] unsigned long DataType,
- [in, size_is(Length)] char *Buffer,
- [in] unsigned long Length,
- [in] unsigned long Flags);
+ /* Function 14 */
+ CONFIGRET PNP_SetDeviceRegProp(handle_t BindingHandle,
+ [in, string] wchar_t *DeviceId,
+ [in] unsigned long Property,
+ [in] unsigned long DataType,
+ [in, size_is(Length)] char *Buffer,
+ [in] unsigned long Length,
+ [in] unsigned long Flags);
- /* Function 15 */
- CONFIGRET PNP_GetClassInstance(handle_t BindingHandle,
- [in, string] wchar_t *DeviceId,
- [out, string, size_is(Length)] wchar_t *Buffer,
- [in] unsigned long Length);
+ /* Function 15 */
+ CONFIGRET PNP_GetClassInstance(handle_t BindingHandle,
+ [in, string] wchar_t *DeviceId,
+ [out, string, size_is(Length)] wchar_t *Buffer,
+ [in] unsigned long Length);
- /* Function 16 */
- CONFIGRET PNP_CreateKey(handle_t BindingHandle,
- [in, string] wchar_t *SubKey,
- [in] unsigned long DesiredAccess,
- [in] unsigned long Flags);
+ /* Function 16 */
+ CONFIGRET PNP_CreateKey(handle_t BindingHandle,
+ [in, string] wchar_t *SubKey,
+ [in] unsigned long DesiredAccess,
+ [in] unsigned long Flags);
- /* Function 17 */
- CONFIGRET PNP_DeleteRegistryKey(handle_t BindingHandle,
- [in, string] wchar_t *DeviceId,
- [in, string] wchar_t *ParentKey,
- [in, string] wchar_t *ChildKey,
- [in] unsigned long Flags);
+ /* Function 17 */
+ CONFIGRET PNP_DeleteRegistryKey(handle_t BindingHandle,
+ [in, string] wchar_t *DeviceId,
+ [in, string] wchar_t *ParentKey,
+ [in, string] wchar_t *ChildKey,
+ [in] unsigned long Flags);
- /* Function 19 */
- CONFIGRET PNP_GetClassName(handle_t BindingHandle,
- [in, string] wchar_t *ClassGuid,
- [out, string, size_is(*Length)] wchar_t *Buffer,
- [in, out] unsigned long *Length,
- [in] unsigned long Flags);
-
- /* Function 20 */
- CONFIGRET PNP_DeleteClassKey(handle_t BindingHandle,
+ /* Function 19 */
+ CONFIGRET PNP_GetClassName(handle_t BindingHandle,
[in, string] wchar_t *ClassGuid,
+ [out, string, size_is(*Length)] wchar_t *Buffer, + [in, out] unsigned long *Length,
[in] unsigned long Flags);
- /* Function 29 */
- CONFIGRET PNP_DeviceInstanceAction(handle_t BindingHandle,
- [in] unsigned long MajorAction,
- [in] unsigned long MinorAction,
- [in, unique, string] wchar_t *DeviceInstance1,
- [in, unique, string] wchar_t *DeviceInstance2);
+ /* Function 20 */
+ CONFIGRET PNP_DeleteClassKey(handle_t BindingHandle,
+ [in, string] wchar_t *ClassGuid,
+ [in] unsigned long Flags);
- /* Function 30 */
- CONFIGRET PNP_GetDeviceStatus(handle_t BindingHandle,
- [in, string] wchar_t *DeviceInstance,
- [out] unsigned long *Status,
- [out] unsigned long *Problem,
- [in] DWORD Flags);
+ /* Function 28 */
+ CONFIGRET PNP_CreateDevInst(handle_t BindingHandle,
+ [in, out, string, size_is(Length)] wchar_t *DeviceId,
+ [in, string] wchar_t *ParentDeviceId,
+ [in] unsigned long Length,
+ [in] unsigned long Flags);
- /* Function 31 */
- CONFIGRET PNP_SetDeviceProblem(handle_t BindingHandle,
- [in, string] wchar_t *DeviceInstance,
- [in] unsigned long Problem,
- [in] DWORD Flags);
+ /* Function 29 */
+ CONFIGRET PNP_DeviceInstanceAction(handle_t BindingHandle,
+ [in] unsigned long MajorAction,
+ [in] unsigned long MinorAction,
+ [in, unique, string] wchar_t *DeviceInstance1,
+ [in, unique, string] wchar_t *DeviceInstance2);
- /* Function 33 */
- CONFIGRET PNP_UninstallDevInst(handle_t BindingHandle,
- [in, string] wchar_t *DeviceInstance,
- [in] DWORD Flags);
+ /* Function 30 */
+ CONFIGRET PNP_GetDeviceStatus(handle_t BindingHandle,
+ [in, string] wchar_t *DeviceInstance,
+ [out] unsigned long *Status,
+ [out] unsigned long *Problem,
+ [in] DWORD Flags);
- /* Function 38 */
- CONFIGRET PNP_IsDockStationPresent(handle_t BindingHandle,
- [out]PBOOL Present);
+ /* Function 31 */
+ CONFIGRET PNP_SetDeviceProblem(handle_t BindingHandle,
+ [in, string] wchar_t *DeviceInstance,
+ [in] unsigned long Problem,
+ [in] DWORD Flags);
- /* Function 39 */
- CONFIGRET PNP_RequestEjectPC(handle_t BindingHandle);
+ /* Function 33 */
+ CONFIGRET PNP_UninstallDevInst(handle_t BindingHandle,
+ [in, string] wchar_t *DeviceInstance,
+ [in] DWORD Flags);
- /* Function 58 */
- CONFIGRET PNP_RunDetection(handle_t BindingHandle,
- [in] unsigned long Flags);
+ /* Function 38 */
+ CONFIGRET PNP_IsDockStationPresent(handle_t BindingHandle,
+ [out]PBOOL Present);
+
+ /* Function 39 */
+ CONFIGRET PNP_RequestEjectPC(handle_t BindingHandle);
+
+ /* Function 58 */
+ CONFIGRET PNP_RunDetection(handle_t BindingHandle,
+ [in] unsigned long Flags);
}
--- trunk/reactos/include/wine/cfgmgr32.h 2006-01-22 14:08:06 UTC (rev 20977) +++ trunk/reactos/include/wine/cfgmgr32.h 2006-01-22 14:33:04 UTC (rev 20978) @@ -163,6 +163,22 @@
#define CM_SETUP_DEVINST_RESET CM_SETUP_DEVNODE_RESET #define CM_SETUP_BITS 0x00000007
+/* ulFlags for CM_Create_DevNode[_Ex]A/W */ +#define CM_CREATE_DEVNODE_NORMAL 0x00000000 +#define CM_CREATE_DEVNODE_NO_WAIT_INSTALL 0x00000001 +#define CM_CREATE_DEVNODE_PHANTOM 0x00000002 +#define CM_CREATE_DEVNODE_GENERATE_ID 0x00000004 +#define CM_CREATE_DEVNODE_DO_NOT_INSTALL 0x00000008 +#define CM_CREATE_DEVNODE_BITS 0x0000000F + +#define CM_CREATE_DEVINST_NORMAL CM_CREATE_DEVNODE_NORMAL +#define CM_CREATE_DEVINST_NO_WAIT_INSTALL CM_CREATE_DEVNODE_NO_WAIT_INSTALL +#define CM_CREATE_DEVINST_PHANTOM CM_CREATE_DEVNODE_PHANTOM +#define CM_CREATE_DEVINST_GENERATE_ID CM_CREATE_DEVNODE_GENERATE_ID +#define CM_CREATE_DEVINST_DO_NOT_INSTALL CM_CREATE_DEVNODE_DO_NOT_INSTALL +#define CM_CREATE_DEVINST_BITS CM_CREATE_DEVNODE_BITS + +
#define CMP_MAGIC 0x01234567 @@ -172,6 +188,12 @@
CONFIGRET WINAPI CM_Connect_MachineA( PCSTR, PHMACHINE ); CONFIGRET WINAPI CM_Connect_MachineW( PCWSTR, PHMACHINE ); #define CM_Connect_Machine WINELIB_NAME_AW(CM_Connect_Machine)
+CONFIGRET WINAPI CM_Create_DevNodeA( PDEVINST, DEVINSTID_A, DEVINST, ULONG ); +CONFIGRET WINAPI CM_Create_DevNodeW( PDEVINST, DEVINSTID_W, DEVINST, ULONG ); +#define CM_Create_DevNode WINELIB_NAME_AW(CM_Create_DevNode) +CONFIGRET WINAPI CM_Create_DevNode_ExA( PDEVINST, DEVINSTID_A, DEVINST, ULONG, HANDLE ); +CONFIGRET WINAPI CM_Create_DevNode_ExW( PDEVINST, DEVINSTID_W, DEVINST, ULONG, HANDLE ); +#define CM_Create_DevNode_Ex WINELIB_NAME_AW(CM_Create_DevNode_Ex)
CONFIGRET WINAPI CM_Delete_Class_Key( LPGUID, ULONG ); CONFIGRET WINAPI CM_Delete_Class_Key_Ex( LPGUID, ULONG, HANDLE ); CONFIGRET WINAPI CM_Disable_DevNode( DEVINST, ULONG );
--- trunk/reactos/lib/cfgmgr32/cfgmgr32.def 2006-01-22 14:08:06 UTC (rev 20977) +++ trunk/reactos/lib/cfgmgr32/cfgmgr32.def 2006-01-22 14:33:04 UTC (rev 20978) @@ -36,10 +36,10 @@
;CM_Add_Res_Des_Ex CM_Connect_MachineA@8=SETUPAPI.CM_Connect_MachineA CM_Connect_MachineW@8=SETUPAPI.CM_Connect_MachineW
-;CM_Create_DevNodeA -;CM_Create_DevNodeW -;CM_Create_DevNode_ExA -;CM_Create_DevNode_ExW
+CM_Create_DevNodeA@16=SETUPAPI.CM_Create_DevNodeA +CM_Create_DevNodeW@16=SETUPAPI.CM_Create_DevNodeW +CM_Create_DevNode_ExA@20=SETUPAPI.CM_Create_DevNode_ExA +CM_Create_DevNode_ExW@20=SETUPAPI.CM_Create_DevNode_ExW
;CM_Create_Range_List CM_Delete_Class_Key@8=SETUPAPI.CM_Delete_Class_Key CM_Delete_Class_Key_Ex@12=SETUPAPI.CM_Delete_Class_Key_Ex @@ -48,12 +48,12 @@
;CM_Delete_Range ;CM_Detect_Resource_Conflict ;CM_Detect_Resource_Conflict_Ex
-;CM_Disable_DevNode -;CM_Disable_DevNode_Ex
+CM_Disable_DevNode@8=SETUPAPI.CM_Disable_DevNode +CM_Disable_DevNode_Ex@12=SETUPAPI.CM_Disable_DevNode_Ex
CM_Disconnect_Machine@4=SETUPAPI.CM_Disconnect_Machine ;CM_Dup_Range_List
-;CM_Enable_DevNode -;CM_Enable_DevNode_Ex
+CM_Enable_DevNode@8=SETUPAPI.CM_Enable_DevNode +CM_Enable_DevNode_Ex@12=SETUPAPI.CM_Enable_DevNode_Ex
CM_Enumerate_Classes@12=SETUPAPI.CM_Enumerate_Classes CM_Enumerate_Classes_Ex@16=SETUPAPI.CM_Enumerate_Classes_Ex CM_Enumerate_EnumeratorsA@16=SETUPAPI.CM_Enumerate_EnumeratorsA @@ -143,8 +143,8 @@
CM_Get_Version_Ex@4=SETUPAPI.CM_Get_Version_Ex ;CM_Intersect_Range_List ;CM_Invert_Range_List
-;CM_Is_Dock_Station_Present -;CM_Is_Dock_Station_Present_Ex
+CM_Is_Dock_Station_Present@4=SETUPAPI.CM_Is_Dock_Station_Present +CM_Is_Dock_Station_Present_Ex@8=SETUPAPI.CM_Is_Dock_Station_Present_Ex
CM_Locate_DevNodeA@12=SETUPAPI.CM_Locate_DevNodeA CM_Locate_DevNodeW@12=SETUPAPI.CM_Locate_DevNodeW CM_Locate_DevNode_ExA@16=SETUPAPI.CM_Locate_DevNode_ExA @@ -181,11 +181,12 @@
;CM_Remove_Unmarked_Children_Ex ;CM_Request_Device_EjectA ;CM_Request_Device_EjectW
-;CM_Request_Eject_PC
+CM_Request_Eject_PC@0=SETUPAPI.CM_Request_Eject_PC
+CM_Request_Eject_PC_Ex@4=SETUPAPI.CM_Request_Eject_PC_Ex
;CM_Reset_Children_Marks ;CM_Reset_Children_Marks_Ex
-;CM_Run_Detection -;CM_Run_Detection_Ex
+CM_Run_Detection@4=SETUPAPI.CM_Run_Detection +CM_Run_Detection_Ex@8=SETUPAPI.CM_Run_Detection_Ex
CM_Set_DevNode_Problem@12=SETUPAPI.CM_Set_DevNode_Problem CM_Set_DevNode_Problem_Ex@16=SETUPAPI.CM_Set_DevNode_Problem_Ex CM_Set_DevNode_Registry_PropertyA@20=SETUPAPI.CM_Set_DevNode_Registry_PropertyA
--- trunk/reactos/lib/setupapi/cfgmgr.c 2006-01-22 14:08:06 UTC (rev 20977) +++ trunk/reactos/lib/setupapi/cfgmgr.c 2006-01-22 14:33:04 UTC (rev 20978) @@ -2,7 +2,7 @@
* Configuration manager functions * * Copyright 2000 James Hatheway
- * Copyright 2005 Eric Kohl
+ * Copyright 2005, 2006 Eric Kohl
* * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -185,6 +185,125 @@
/***********************************************************************
+ * CM_Create_DevNodeA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Create_DevNodeA( + PDEVINST pdnDevInst, DEVINSTID_A pDeviceID, DEVINST dnParent, + ULONG ulFlags) +{ + TRACE("%p %s %p %lx\n", + pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags); + return CM_Create_DevNode_ExA(pdnDevInst, pDeviceID, dnParent, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Create_DevNodeW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Create_DevNodeW( + PDEVINST pdnDevInst, DEVINSTID_W pDeviceID, DEVINST dnParent, + ULONG ulFlags) +{ + TRACE("%p %s %p %lx\n", + pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags); + return CM_Create_DevNode_ExW(pdnDevInst, pDeviceID, dnParent, + ulFlags, NULL); +} + + +/*********************************************************************** + * CM_Create_DevNode_ExA [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Create_DevNode_ExA( + PDEVINST pdnDevInst, DEVINSTID_A pDeviceID, DEVINST dnParent, + ULONG ulFlags, HANDLE hMachine) +{ + DEVINSTID_W pDeviceIDW; + CONFIGRET ret; + + TRACE("%p %s %p %lx %p\n", + pdnDevInst, debugstr_a(pDeviceID), dnParent, ulFlags, hMachine); + + if (CaptureAndConvertAnsiArg(pDeviceID, &pDeviceIDW)) + return CR_INVALID_DATA; + + ret = CM_Create_DevNode_ExW(pdnDevInst, pDeviceIDW, dnParent, ulFlags, + hMachine); + + MyFree(pDeviceIDW); + + return ret; +} + + +/*********************************************************************** + * CM_Create_DevNode_ExW [SETUPAPI.@] + */ +CONFIGRET WINAPI CM_Create_DevNode_ExW( + PDEVINST pdnDevInst, DEVINSTID_W pDeviceID, DEVINST dnParent, + ULONG ulFlags, HANDLE hMachine) +{ + RPC_BINDING_HANDLE BindingHandle = NULL; + HSTRING_TABLE StringTable = NULL; + LPWSTR lpParentDevInst; + CONFIGRET ret = CR_SUCCESS; + + FIXME("%p %s %p %lx %p\n", + pdnDevInst, debugstr_w(pDeviceID), dnParent, ulFlags, hMachine); + + if (!IsUserAdmin()) + return CR_ACCESS_DENIED; + + if (pdnDevInst == NULL) + return CR_INVALID_POINTER; + + if (pDeviceID == NULL || wcslen(pDeviceID) == 0) + return CR_INVALID_DEVICE_ID; + + if (dnParent == 0) + return CR_INVALID_DEVNODE; + + if (ulFlags & ~CM_CREATE_DEVNODE_BITS) + return CR_INVALID_FLAG; + + if (hMachine != NULL) + { + BindingHandle = ((PMACHINE_INFO)hMachine)->BindingHandle; + if (BindingHandle == NULL) + return CR_FAILURE; + + StringTable = ((PMACHINE_INFO)hMachine)->StringTable; + if (StringTable == 0) + return CR_FAILURE; + } + else + { + if (!PnpGetLocalHandles(&BindingHandle, &StringTable)) + return CR_FAILURE; + } + + lpParentDevInst = StringTableStringFromId(StringTable, dnParent); + if (lpParentDevInst == NULL) + return CR_INVALID_DEVNODE; + + ret = PNP_CreateDevInst(BindingHandle, + pDeviceID, + lpParentDevInst, + MAX_DEVICE_ID_LEN, + ulFlags); + if (ret == CR_SUCCESS) + { + *pdnDevInst = StringTableAddString(StringTable, pDeviceID, 1); + if (*pdnDevInst == 0) + ret = CR_NO_SUCH_DEVNODE; + } + + return ret; +} + + +/***********************************************************************
* CM_Delete_Class_Key [SETUPAPI.@] */ CONFIGRET WINAPI CM_Delete_Class_Key(
--- trunk/reactos/lib/setupapi/setupapi.spec 2006-01-22 14:08:06 UTC (rev 20977) +++ trunk/reactos/lib/setupapi/setupapi.spec 2006-01-22 14:33:04 UTC (rev 20978) @@ -20,10 +20,10 @@
@ stub CM_Add_Res_Des_Ex @ stdcall CM_Connect_MachineA(str ptr) @ stdcall CM_Connect_MachineW(wstr ptr)
-@ stub CM_Create_DevNodeA
-@ stub CM_Create_DevNodeW
-@ stub CM_Create_DevNode_ExA
-@ stub CM_Create_DevNode_ExW
+@ stdcall CM_Create_DevNodeA(ptr str long long)
+@ stdcall CM_Create_DevNodeW(ptr wstr long long)
+@ stdcall CM_Create_DevNode_ExA(ptr str long long long)
+@ stdcall CM_Create_DevNode_ExW(ptr wstr long long long)
@ stub CM_Create_Range_List @ stdcall CM_Delete_Class_Key(ptr long) @ stdcall CM_Delete_Class_Key_Ex(ptr long long)
--- trunk/reactos/services/umpnpmgr/umpnpmgr.c 2006-01-22 14:08:06 UTC (rev 20977) +++ trunk/reactos/services/umpnpmgr/umpnpmgr.c 2006-01-22 14:33:04 UTC (rev 20978) @@ -893,6 +893,24 @@
}
+/* Function 28 */ +CONFIGRET +PNP_CreateDevInst(handle_t BindingHandle, + wchar_t *DeviceId, /* [in, out, string, size_is(Length)] */ + wchar_t *ParentDeviceId, /* [in, string] */ + unsigned long Length, /* [in] */ + unsigned long Flags) /* [in] */ +{ + CONFIGRET ret = CR_CALL_NOT_IMPLEMENTED; + + DPRINT1("PNP_CreateDevInst() called\n"); + + DPRINT1("PNP_CreateDevInst() done (returns %lx)\n", ret); + + return ret; +} + +
/* Function 29 */ CONFIGRET PNP_DeviceInstanceAction(handle_t BindingHandle,
--- trunk/reactos/w32api/include/ddk/cfgmgr32.h 2006-01-22 14:08:06 UTC (rev 20977) +++ trunk/reactos/w32api/include/ddk/cfgmgr32.h 2006-01-22 14:33:04 UTC (rev 20978) @@ -736,8 +736,75 @@
#define CM_Connect_Machine CM_Connect_MachineA #endif /* UNICODE */
-/* FIXME: Obsolete CM_Create_DevNode */
-/* FIXME: Obsolete CM_Create_DevNodeEx */
+/* Flags for CM_Create_DevNode[_Ex].ulFlags constants */
+#define CM_CREATE_DEVNODE_NORMAL 0x00000000
+#define CM_CREATE_DEVNODE_NO_WAIT_INSTALL 0x00000001
+#define CM_CREATE_DEVNODE_PHANTOM 0x00000002
+#define CM_CREATE_DEVNODE_GENERATE_ID 0x00000004
+#define CM_CREATE_DEVNODE_DO_NOT_INSTALL 0x00000008
+#define CM_CREATE_DEVNODE_BITS 0x0000000F
+
+#define CM_CREATE_DEVINST_NORMAL CM_CREATE_DEVNODE_NORMAL
+#define CM_CREATE_DEVINST_NO_WAIT_INSTALL CM_CREATE_DEVNODE_NO_WAIT_INSTALL
+#define CM_CREATE_DEVINST_PHANTOM CM_CREATE_DEVNODE_PHANTOM
+#define CM_CREATE_DEVINST_GENERATE_ID CM_CREATE_DEVNODE_GENERATE_ID
+#define CM_CREATE_DEVINST_DO_NOT_INSTALL CM_CREATE_DEVNODE_DO_NOT_INSTALL
+#define CM_CREATE_DEVINST_BITS CM_CREATE_DEVNODE_BITS
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Create_DevNodeA(
+ OUT PDEVINST pdnDevInst,
+ IN DEVINSTID_A pDeviceID,
+ IN DEVINST dnParent,
+ IN ULONG ulFlags);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Create_DevNodeW(
+ OUT PDEVINST pdnDevInst,
+ IN DEVINSTID_W pDeviceID,
+ IN DEVINST dnParent,
+ IN ULONG ulFlags);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Create_DevNode_ExA(
+ OUT PDEVINST pdnDevInst,
+ IN DEVINSTID_A pDeviceID,
+ IN DEVINST dnParent,
+ IN ULONG ulFlags,
+ IN HANDLE hMachine);
+
+CMAPI
+CONFIGRET
+WINAPI
+CM_Create_DevNode_ExW(
+ OUT PDEVINST pdnDevInst,
+ IN DEVINSTID_W pDeviceID,
+ IN DEVINST dnParent,
+ IN ULONG ulFlags,
+ IN HANDLE hMachine);
+
+#define CM_Create_DevInstW CM_Create_DevNodeW
+#define CM_Create_DevInstA CM_Create_DevNodeA
+#define CM_Create_DevInst_ExW CM_Create_DevNode_ExW
+#define CM_Create_DevInst_ExA CM_Create_DevNode_ExA
+#ifdef UNICODE
+#define CM_Create_DevNode CM_Create_DevNodeW
+#define CM_Create_DevInst CM_Create_DevNodeW
+#define CM_Create_DevNode_Ex CM_Create_DevNode_ExW
+#define CM_Create_DevInst_Ex CM_Create_DevInst_ExW
+#else
+#define CM_Create_DevNode CM_Create_DevNodeA
+#define CM_Create_DevInst CM_Create_DevNodeA
+#define CM_Create_DevNode_Ex CM_Create_DevNode_ExA
+#define CM_Create_DevInst_Ex CM_Create_DevNode_ExA
+#endif /* UNICODE */
+
/* FIXME: Obsolete CM_Create_Range_List */ /* Flags for CM_Delete_Class_Key.ulFlags constants */