localspl: Implement DeletePort.
This commit is contained in:
parent
9d0b69d130
commit
ca199009af
|
@ -196,6 +196,39 @@ BOOL WINAPI localmon_ConfigurePortW(LPWSTR pName, HWND hWnd, LPWSTR pPortName)
|
|||
return ROUTER_SUCCESS;
|
||||
}
|
||||
|
||||
/*****************************************************
|
||||
* localmon_DeletePortW [exported through MONITOREX]
|
||||
*
|
||||
* Delete a specific Port
|
||||
*
|
||||
* PARAMS
|
||||
* pName [I] Servername or NULL (local Computer)
|
||||
* hWnd [I] Handle to parent Window
|
||||
* pPortName [I] Name of the Port, that should be deleted
|
||||
*
|
||||
* RETURNS
|
||||
* Success: TRUE
|
||||
* Failure: FALSE
|
||||
*
|
||||
*/
|
||||
BOOL WINAPI localmon_DeletePortW(LPWSTR pName, HWND hWnd, LPWSTR pPortName)
|
||||
{
|
||||
DWORD res;
|
||||
HKEY hroot;
|
||||
|
||||
TRACE("(%s, %p, %s)\n", debugstr_w(pName), hWnd, debugstr_w(pPortName));
|
||||
|
||||
if ((!pPortName) || (!pPortName[0])) return FALSE;
|
||||
|
||||
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_PortsW, &hroot);
|
||||
if (res == ERROR_SUCCESS) {
|
||||
res = RegDeleteValueW(hroot, pPortName);
|
||||
RegCloseKey(hroot);
|
||||
}
|
||||
TRACE("=> %d\n", (res == ERROR_SUCCESS));
|
||||
return (res == ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
/*****************************************************
|
||||
* localmon_EnumPortsW [exported through MONITOREX]
|
||||
*
|
||||
|
@ -290,7 +323,8 @@ LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot)
|
|||
NULL, /* localmon_ClosePortW */
|
||||
NULL, /* localmon_AddPortW */
|
||||
NULL, /* localmon_AddPortExW */
|
||||
localmon_ConfigurePortW
|
||||
localmon_ConfigurePortW,
|
||||
localmon_DeletePortW
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue