Skip to content

Commit

Permalink
Remove vJoy device node tree even when some devnodes are isabled
Browse files Browse the repository at this point in the history
  • Loading branch information
shauleiz committed Feb 3, 2016
1 parent 7c4a60b commit fb08c17
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions apps/vJoyInstall/vJoyInstallLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,11 @@ int RemoveAllDevices(DEVINST hDevInst, BOOL isRoot, BOOL DelInf)
if (!hDevInst)
return 0;

// Enable vJoy device node because the removal works only on enabled devices
cr = CM_Enable_DevNode(hDevInst, 0);
if (cr != CR_SUCCESS)
return -1010;

// If this is a root device - get the first child.
// If this is NOT the root device - get the next sibling.
if (isRoot)
Expand All @@ -886,19 +891,12 @@ int RemDev(DEVINST hDevInst, BOOL DelInf)
CONFIGRET cr;


// Enable vJoy device node because the removal works only on enabled devices
cr = CM_Enable_DevNode(hDevInst, 0);
if (cr != CR_SUCCESS)
return -1010;


// Creating a clean Device Info Set
HDEVINFO DeviceInfoSet = hlp_CreateDeviceInfoList();
if (DeviceInfoSet == INVALID_HANDLE_VALUE)
return -101;



// Obtains Device ID from Device Handle
int iRet = hlp_DeviceHandle2ID(hDevInst, &DeviceInstanceId);
if (iRet)
Expand Down

0 comments on commit fb08c17

Please sign in to comment.