RpcTryExcept
{
dwErrorCode = _RpcEnumPrinters(Flags, Name, Level, pPrinterEnum, cbBuf, pcbNeeded, pcReturned);
- if (dwErrorCode)
- {
- ERR("_RpcEnumPrinters failed with error %lu!\n", dwErrorCode);
- }
-
+ SetLastError(dwErrorCode);
bReturnValue = (dwErrorCode == ERROR_SUCCESS);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)
RpcTryExcept
{
dwErrorCode = _RpcOpenPrinter(pPrinterName, phPrinter, pDatatype, pDevModeContainer, AccessRequired);
- if (dwErrorCode)
- {
- ERR("_RpcOpenPrinter failed with error %lu!\n", dwErrorCode);
- }
-
+ SetLastError(dwErrorCode);
bReturnValue = (dwErrorCode == ERROR_SUCCESS);
}
RpcExcept(EXCEPTION_EXECUTE_HANDLER)