Author: ekohl
Date: Mon Oct 27 14:26:37 2008
New Revision: 37028
URL:
http://svn.reactos.org/svn/reactos?rev=37028&view=rev
Log:
SEH protect all calls to the UM-PNP-Manager.
Modified:
trunk/reactos/dll/win32/setupapi/cfgmgr.c
Modified: trunk/reactos/dll/win32/setupapi/cfgmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/cfgmgr.…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/cfgmgr.c [iso-8859-1] Mon Oct 27 14:26:37 2008
@@ -76,6 +76,13 @@
}
+static CONFIGRET
+RpcStatusToCmStatus(RPC_STATUS Status)
+{
+ return CR_FAILURE;
+}
+
+
/***********************************************************************
* CMP_WaitNoPendingInstallEvents [SETUPAPI.@]
*/
@@ -102,6 +109,7 @@
DWORD dwMagic)
{
RPC_BINDING_HANDLE BindingHandle = NULL;
+ CONFIGRET ret;
TRACE("%lu\n", dwMagic);
@@ -111,7 +119,17 @@
if (!PnpGetLocalHandles(&BindingHandle, NULL))
return CR_FAILURE;
- return PNP_InitDetection(BindingHandle);
+ _SEH_TRY
+ {
+ ret = PNP_InitDetection(BindingHandle);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -139,9 +157,18 @@
for (i = 0; i < 30; i++)
{
- ret = PNP_ReportLogOn(BindingHandle,
- bAdmin,
- dwProcessId);
+ _SEH_TRY
+ {
+ ret = PNP_ReportLogOn(BindingHandle,
+ bAdmin,
+ dwProcessId);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
if (ret == CR_SUCCESS)
break;
@@ -217,7 +244,17 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- ret = PNP_AddEmptyLogConf(BindingHandle, lpDevInst, Priority, &ulLogConfTag,
ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_AddEmptyLogConf(BindingHandle, lpDevInst, Priority,
+ &ulLogConfTag, ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
if (ret == CR_SUCCESS)
{
pLogConfInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(LOG_CONF_INFO));
@@ -295,6 +332,7 @@
RPC_BINDING_HANDLE BindingHandle = NULL;
HSTRING_TABLE StringTable = NULL;
LPWSTR lpDevInst;
+ CONFIGRET ret;
TRACE("%p %s %lx %p\n", dnDevInst, debugstr_w(pszID), ulFlags, hMachine);
@@ -330,10 +368,20 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- return PNP_AddID(BindingHandle,
- lpDevInst,
- pszID,
- ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_AddID(BindingHandle,
+ lpDevInst,
+ pszID,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -530,11 +578,20 @@
if (lpParentDevInst == NULL)
return CR_INVALID_DEVNODE;
- ret = PNP_CreateDevInst(BindingHandle,
- pDeviceID,
- lpParentDevInst,
- MAX_DEVICE_ID_LEN,
- ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_CreateDevInst(BindingHandle,
+ pDeviceID,
+ lpParentDevInst,
+ MAX_DEVICE_ID_LEN,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
if (ret == CR_SUCCESS)
{
*pdnDevInst = StringTableAddString(StringTable, pDeviceID, 1);
@@ -565,6 +622,7 @@
{
WCHAR szGuidString[MAX_GUID_STRING_LEN];
RPC_BINDING_HANDLE BindingHandle = NULL;
+ CONFIGRET ret;
TRACE("%p %lx %lx\n", ClassGuid, ulFlags, hMachine);
@@ -589,10 +647,21 @@
return CR_FAILURE;
}
- return PNP_DeleteClassKey(BindingHandle,
- szGuidString,
- ulFlags);
-}
+ _SEH_TRY
+ {
+ ret = PNP_DeleteClassKey(BindingHandle,
+ szGuidString,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
+}
+
/***********************************************************************
* CM_Delete_DevNode_Key [SETUPAPI.@]
@@ -605,6 +674,7 @@
NULL);
}
+
/***********************************************************************
* CM_Delete_DevNode_Key_Ex [SETUPAPI.@]
*/
@@ -639,6 +709,7 @@
RPC_BINDING_HANDLE BindingHandle = NULL;
HSTRING_TABLE StringTable = NULL;
LPWSTR lpDevInst;
+ CONFIGRET ret;
FIXME("%p %lx %p\n", dnDevInst, ulFlags, hMachine);
@@ -671,11 +742,21 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- return PNP_DeviceInstanceAction(BindingHandle,
- 5,
- ulFlags,
- lpDevInst,
- NULL);
+ _SEH_TRY
+ {
+ ret = PNP_DeviceInstanceAction(BindingHandle,
+ 5,
+ ulFlags,
+ lpDevInst,
+ NULL);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -727,6 +808,7 @@
RPC_BINDING_HANDLE BindingHandle = NULL;
HSTRING_TABLE StringTable = NULL;
LPWSTR lpDevInst;
+ CONFIGRET ret;
FIXME("%p %lx %p\n", dnDevInst, ulFlags, hMachine);
@@ -759,11 +841,21 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- return PNP_DeviceInstanceAction(BindingHandle,
- 4,
- ulFlags,
- lpDevInst,
- NULL);
+ _SEH_TRY
+ {
+ ret = PNP_DeviceInstanceAction(BindingHandle,
+ 4,
+ ulFlags,
+ lpDevInst,
+ NULL);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -809,13 +901,22 @@
return CR_FAILURE;
}
- ret = PNP_EnumerateSubKeys(BindingHandle,
- PNP_CLASS_SUBKEYS,
- ulClassIndex,
- szBuffer,
- MAX_GUID_STRING_LEN,
- &ulLength,
- ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_EnumerateSubKeys(BindingHandle,
+ PNP_CLASS_SUBKEYS,
+ ulClassIndex,
+ szBuffer,
+ MAX_GUID_STRING_LEN,
+ &ulLength,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
if (ret == CR_SUCCESS)
{
/* Remove the {} */
@@ -908,6 +1009,7 @@
HMACHINE hMachine)
{
RPC_BINDING_HANDLE BindingHandle = NULL;
+ CONFIGRET ret;
TRACE("%lu %p %p %lx %lx\n", ulEnumIndex, Buffer, pulLength, ulFlags,
hMachine);
@@ -932,13 +1034,23 @@
return CR_FAILURE;
}
- return PNP_EnumerateSubKeys(BindingHandle,
- PNP_ENUMERATOR_SUBKEYS,
- ulEnumIndex,
- Buffer,
- *pulLength,
- pulLength,
- ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_EnumerateSubKeys(BindingHandle,
+ PNP_ENUMERATOR_SUBKEYS,
+ ulEnumIndex,
+ Buffer,
+ *pulLength,
+ pulLength,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -963,6 +1075,7 @@
HSTRING_TABLE StringTable = NULL;
LPWSTR lpDevInst;
PLOG_CONF_INFO pLogConfInfo;
+ CONFIGRET ret;
TRACE("%lx %lx %lx\n", lcLogConfToBeFreed, ulFlags, hMachine);
@@ -996,8 +1109,18 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- return PNP_FreeLogConf(BindingHandle, lpDevInst, pLogConfInfo->ulFlags,
- pLogConfInfo->ulTag, 0);
+ _SEH_TRY
+ {
+ ret = PNP_FreeLogConf(BindingHandle, lpDevInst, pLogConfInfo->ulFlags,
+ pLogConfInfo->ulTag, 0);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -1078,12 +1201,21 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- ret = PNP_GetRelatedDeviceInstance(BindingHandle,
- PNP_GET_CHILD_DEVICE_INSTANCE,
- lpDevInst,
- szRelatedDevInst,
- &dwLength,
- 0);
+ _SEH_TRY
+ {
+ ret = PNP_GetRelatedDeviceInstance(BindingHandle,
+ PNP_GET_CHILD_DEVICE_INSTANCE,
+ lpDevInst,
+ szRelatedDevInst,
+ &dwLength,
+ 0);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
if (ret != CR_SUCCESS)
return ret;
@@ -1276,6 +1408,7 @@
{
WCHAR szGuidString[MAX_GUID_STRING_LEN];
RPC_BINDING_HANDLE BindingHandle = NULL;
+ CONFIGRET ret;
TRACE("%p %p %p %lx %lx\n",
ClassGuid, Buffer, pulLength, ulFlags, hMachine);
@@ -1303,11 +1436,21 @@
return CR_FAILURE;
}
- return PNP_GetClassName(BindingHandle,
- szGuidString,
- Buffer,
- pulLength,
- ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_GetClassName(BindingHandle,
+ szGuidString,
+ Buffer,
+ pulLength,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -1331,6 +1474,7 @@
RPC_BINDING_HANDLE BindingHandle = NULL;
HSTRING_TABLE StringTable = NULL;
LPWSTR lpDevInst;
+ CONFIGRET ret;
TRACE("%p %lx %lx %lx\n",
pulDepth, dnDevInst, ulFlags, hMachine);
@@ -1364,10 +1508,20 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- return PNP_GetDepth(BindingHandle,
- lpDevInst,
- pulDepth,
- ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_GetDepth(BindingHandle,
+ lpDevInst,
+ pulDepth,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -1532,14 +1686,24 @@
return CR_INVALID_DEVNODE;
ulTransferLength = *pulLength;
- ret = PNP_GetDeviceRegProp(BindingHandle,
- lpDevInst,
- ulProperty,
- &ulDataType,
- Buffer,
- &ulTransferLength,
- pulLength,
- ulFlags);
+
+ _SEH_TRY
+ {
+ ret = PNP_GetDeviceRegProp(BindingHandle,
+ lpDevInst,
+ ulProperty,
+ &ulDataType,
+ Buffer,
+ &ulTransferLength,
+ pulLength,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
if (ret == CR_SUCCESS)
{
if (pulRegDataType != NULL)
@@ -1575,6 +1739,7 @@
RPC_BINDING_HANDLE BindingHandle = NULL;
HSTRING_TABLE StringTable = NULL;
LPWSTR lpDevInst;
+ CONFIGRET ret;
TRACE("%p %p %lx %lx %lx\n",
pulStatus, pulProblemNumber, dnDevInst, ulFlags, hMachine);
@@ -1608,11 +1773,21 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- return PNP_GetDeviceStatus(BindingHandle,
- lpDevInst,
- pulStatus,
- pulProblemNumber,
- ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_GetDeviceStatus(BindingHandle,
+ lpDevInst,
+ pulStatus,
+ pulProblemNumber,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -1883,6 +2058,7 @@
PULONG pulLen, PCWSTR pszFilter, ULONG ulFlags, HMACHINE hMachine)
{
RPC_BINDING_HANDLE BindingHandle = NULL;
+ CONFIGRET ret;
FIXME("%p %s %ld %lx\n", pulLen, debugstr_w(pszFilter), ulFlags,
hMachine);
@@ -1906,10 +2082,20 @@
*pulLen = 0;
- return PNP_GetDeviceListSize(BindingHandle,
- (LPWSTR)pszFilter,
- pulLen,
- ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_GetDeviceListSize(BindingHandle,
+ (LPWSTR)pszFilter,
+ pulLen,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -2024,11 +2210,20 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- ret = PNP_GetFirstLogConf(BindingHandle,
- lpDevInst,
- ulFlags,
- &ulTag,
- ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_GetFirstLogConf(BindingHandle,
+ lpDevInst,
+ ulFlags,
+ &ulTag,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
if (ret != CR_SUCCESS)
return ret;
@@ -2065,6 +2260,7 @@
PULONG pulState, ULONG ulFlags, HMACHINE hMachine)
{
RPC_BINDING_HANDLE BindingHandle = NULL;
+ CONFIGRET ret;
TRACE("%p %lx %lx\n", pulState, ulFlags, hMachine);
@@ -2086,7 +2282,17 @@
return CR_FAILURE;
}
- return PNP_GetGlobalState(BindingHandle, pulState, ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_GetGlobalState(BindingHandle, pulState, ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -2157,6 +2363,7 @@
ULONG ulFlags, HMACHINE hMachine)
{
RPC_BINDING_HANDLE BindingHandle = NULL;
+ CONFIGRET ret;
FIXME("%s %lu %p %lx %lx\n", debugstr_w(szDevInstName),
ulHardwareProfile, pulValue, ulFlags, hMachine);
@@ -2181,8 +2388,18 @@
return CR_FAILURE;
}
- return PNP_HwProfFlags(BindingHandle, PNP_GET_HWPROFFLAGS, szDevInstName,
- ulHardwareProfile, pulValue, NULL, NULL, 0, 0);
+ _SEH_TRY
+ {
+ ret = PNP_HwProfFlags(BindingHandle, PNP_GET_HWPROFFLAGS, szDevInstName,
+ ulHardwareProfile, pulValue, NULL, NULL, 0, 0);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -2208,6 +2425,7 @@
HSTRING_TABLE StringTable = NULL;
PLOG_CONF_INFO pLogConfInfo;
LPWSTR lpDevInst;
+ CONFIGRET ret;
FIXME("%p %p %lx %lx\n", lcLogConf, pPriority, ulFlags, hMachine);
@@ -2241,12 +2459,22 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- return PNP_GetLogConfPriority(BindingHandle,
- lpDevInst,
- pLogConfInfo->ulFlags,
- pLogConfInfo->ulTag,
- pPriority,
- 0);
+ _SEH_TRY
+ {
+ ret = PNP_GetLogConfPriority(BindingHandle,
+ lpDevInst,
+ pLogConfInfo->ulFlags,
+ pLogConfInfo->ulTag,
+ pPriority,
+ 0);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -2308,12 +2536,21 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- ret = PNP_GetNextLogConf(BindingHandle,
- lpDevInst,
- pLogConfInfo->ulFlags,
- pLogConfInfo->ulTag,
- &ulNewTag,
- 0);
+ _SEH_TRY
+ {
+ ret = PNP_GetNextLogConf(BindingHandle,
+ lpDevInst,
+ pLogConfInfo->ulFlags,
+ pLogConfInfo->ulTag,
+ &ulNewTag,
+ 0);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
if (ret != CR_SUCCESS)
return ret;
@@ -2392,12 +2629,21 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- ret = PNP_GetRelatedDeviceInstance(BindingHandle,
- PNP_GET_PARENT_DEVICE_INSTANCE,
- lpDevInst,
- szRelatedDevInst,
- &dwLength,
- 0);
+ _SEH_TRY
+ {
+ ret = PNP_GetRelatedDeviceInstance(BindingHandle,
+ PNP_GET_PARENT_DEVICE_INSTANCE,
+ lpDevInst,
+ szRelatedDevInst,
+ &dwLength,
+ 0);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
if (ret != CR_SUCCESS)
return ret;
@@ -2470,12 +2716,21 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- ret = PNP_GetRelatedDeviceInstance(BindingHandle,
- PNP_GET_SIBLING_DEVICE_INSTANCE,
- lpDevInst,
- szRelatedDevInst,
- &dwLength,
- 0);
+ _SEH_TRY
+ {
+ ret = PNP_GetRelatedDeviceInstance(BindingHandle,
+ PNP_GET_SIBLING_DEVICE_INSTANCE,
+ lpDevInst,
+ szRelatedDevInst,
+ &dwLength,
+ 0);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
if (ret != CR_SUCCESS)
return ret;
@@ -2508,6 +2763,7 @@
{
RPC_BINDING_HANDLE BindingHandle = NULL;
WORD Version = 0;
+ CONFIGRET ret;
TRACE("%lx\n", hMachine);
@@ -2523,7 +2779,17 @@
return CR_FAILURE;
}
- if (PNP_GetVersion(BindingHandle, &Version) != CR_SUCCESS)
+ _SEH_TRY
+ {
+ ret = PNP_GetVersion(BindingHandle, &Version);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ if (ret != CR_SUCCESS)
return 0;
return Version;
@@ -2548,6 +2814,7 @@
PBOOL pbPresent, HMACHINE hMachine)
{
RPC_BINDING_HANDLE BindingHandle = NULL;
+ CONFIGRET ret;
TRACE("%p %lx\n", pbPresent, hMachine);
@@ -2568,8 +2835,18 @@
return CR_FAILURE;
}
- return PNP_IsDockStationPresent(BindingHandle,
- pbPresent);
+ _SEH_TRY
+ {
+ ret = PNP_IsDockStationPresent(BindingHandle,
+ pbPresent);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -2662,19 +2939,37 @@
}
else
{
- /* Get the root device ID */
- ret = PNP_GetRootDeviceInstance(BindingHandle,
- DeviceIdBuffer,
- MAX_DEVICE_ID_LEN);
+ _SEH_TRY
+ {
+ /* Get the root device ID */
+ ret = PNP_GetRootDeviceInstance(BindingHandle,
+ DeviceIdBuffer,
+ MAX_DEVICE_ID_LEN);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
if (ret != CR_SUCCESS)
return CR_FAILURE;
}
TRACE("DeviceIdBuffer: %s\n", debugstr_w(DeviceIdBuffer));
- /* Validate the device ID */
- ret = PNP_ValidateDeviceInstance(BindingHandle,
- DeviceIdBuffer,
- ulFlags);
+ _SEH_TRY
+ {
+ /* Validate the device ID */
+ ret = PNP_ValidateDeviceInstance(BindingHandle,
+ DeviceIdBuffer,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
if (ret == CR_SUCCESS)
{
*pdnDevInst = StringTableAddString(StringTable, DeviceIdBuffer, 1);
@@ -2708,6 +3003,7 @@
HSTRING_TABLE StringTable = NULL;
LPWSTR lpFromDevInst;
LPWSTR lpToDevInst;
+ CONFIGRET ret;
FIXME("%lx %lx %lx %lx\n",
dnFromDevInst, dnToDevInst, ulFlags, hMachine);
@@ -2745,11 +3041,21 @@
if (lpToDevInst == NULL)
return CR_INVALID_DEVNODE;
- return PNP_DeviceInstanceAction(BindingHandle,
- 2,
- ulFlags,
- lpFromDevInst,
- lpToDevInst);
+ _SEH_TRY
+ {
+ ret = PNP_DeviceInstanceAction(BindingHandle,
+ 2,
+ ulFlags,
+ lpFromDevInst,
+ lpToDevInst);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -2962,6 +3268,7 @@
RPC_BINDING_HANDLE BindingHandle = NULL;
HSTRING_TABLE StringTable = NULL;
LPWSTR lpDevInst;
+ CONFIGRET ret;
FIXME("%lx %lx %lx\n", dnDevInst, ulFlags, hMachine);
@@ -2991,11 +3298,21 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- return PNP_DeviceInstanceAction(BindingHandle,
- 7,
- ulFlags,
- lpDevInst,
- NULL);
+ _SEH_TRY
+ {
+ ret = PNP_DeviceInstanceAction(BindingHandle,
+ 7,
+ ulFlags,
+ lpDevInst,
+ NULL);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -3016,6 +3333,7 @@
HMACHINE hMachine)
{
RPC_BINDING_HANDLE BindingHandle = NULL;
+ CONFIGRET ret;
TRACE("%lx\n", hMachine);
@@ -3031,7 +3349,17 @@
return CR_FAILURE;
}
- return PNP_RequestEjectPC(BindingHandle);
+ _SEH_TRY
+ {
+ ret = PNP_RequestEjectPC(BindingHandle);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -3053,6 +3381,7 @@
ULONG ulFlags, HMACHINE hMachine)
{
RPC_BINDING_HANDLE BindingHandle = NULL;
+ CONFIGRET ret;
TRACE("%lx %lx\n", ulFlags, hMachine);
@@ -3074,8 +3403,18 @@
return CR_FAILURE;
}
- return PNP_RunDetection(BindingHandle,
- ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_RunDetection(BindingHandle,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -3099,6 +3438,7 @@
RPC_BINDING_HANDLE BindingHandle = NULL;
HSTRING_TABLE StringTable = NULL;
LPWSTR lpDevInst;
+ CONFIGRET ret;
TRACE("%lx %lx %lx %lx\n", dnDevInst, ulProblem, ulFlags, hMachine);
@@ -3128,10 +3468,20 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- return PNP_SetDeviceProblem(BindingHandle,
- lpDevInst,
- ulProblem,
- ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_SetDeviceProblem(BindingHandle,
+ lpDevInst,
+ ulProblem,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -3309,6 +3659,7 @@
HSTRING_TABLE StringTable = NULL;
LPWSTR lpDevInst;
ULONG ulType;
+ CONFIGRET ret;
TRACE("%lx %lu %p %lx %lx %lx\n",
dnDevInst, ulProperty, Buffer, ulLength, ulFlags, hMachine);
@@ -3403,13 +3754,23 @@
return CR_INVALID_PROPERTY;
}
- return PNP_SetDeviceRegProp(BindingHandle,
- lpDevInst,
- ulProperty,
- ulType,
- (BYTE *)Buffer,
- ulLength,
- ulFlags);
+ _SEH_TRY
+ {
+ ret = PNP_SetDeviceRegProp(BindingHandle,
+ lpDevInst,
+ ulProperty,
+ ulType,
+ (BYTE *)Buffer,
+ ulLength,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -3478,6 +3839,7 @@
ULONG ulFlags, HMACHINE hMachine)
{
RPC_BINDING_HANDLE BindingHandle = NULL;
+ CONFIGRET ret;
FIXME("%s %lu %lu %lx %lx\n", debugstr_w(szDevInstName),
ulConfig, ulValue, ulFlags, hMachine);
@@ -3502,8 +3864,18 @@
return CR_FAILURE;
}
- return PNP_HwProfFlags(BindingHandle, PNP_SET_HWPROFFLAGS, szDevInstName,
- ulConfig, &ulValue, NULL, NULL, 0, 0);
+ _SEH_TRY
+ {
+ ret = PNP_HwProfFlags(BindingHandle, PNP_SET_HWPROFFLAGS, szDevInstName,
+ ulConfig, &ulValue, NULL, NULL, 0, 0);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -3527,6 +3899,7 @@
RPC_BINDING_HANDLE BindingHandle = NULL;
HSTRING_TABLE StringTable = NULL;
LPWSTR lpDevInst;
+ CONFIGRET ret;
FIXME("%lx %lx %lx\n", dnDevInst, ulFlags, hMachine);
@@ -3559,11 +3932,21 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- return PNP_DeviceInstanceAction(BindingHandle,
- 3,
- ulFlags,
- lpDevInst,
- NULL);
+ _SEH_TRY
+ {
+ ret = PNP_DeviceInstanceAction(BindingHandle,
+ 3,
+ ulFlags,
+ lpDevInst,
+ NULL);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
}
@@ -3587,6 +3970,7 @@
RPC_BINDING_HANDLE BindingHandle = NULL;
HSTRING_TABLE StringTable = NULL;
LPWSTR lpDevInst;
+ CONFIGRET ret;
TRACE("%lx %lx %lx\n", dnPhantom, ulFlags, hMachine);
@@ -3616,7 +4000,17 @@
if (lpDevInst == NULL)
return CR_INVALID_DEVNODE;
- return PNP_UninstallDevInst(BindingHandle,
- lpDevInst,
- ulFlags);
-}
+ _SEH_TRY
+ {
+ ret = PNP_UninstallDevInst(BindingHandle,
+ lpDevInst,
+ ulFlags);
+ }
+ _SEH_HANDLE
+ {
+ ret = RpcStatusToCmStatus(RpcExceptionCode());
+ }
+ _SEH_END;
+
+ return ret;
+}