Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

783 lines
24 KiB

  1. /*++
  2. Copyright (C) 2000 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. ldfuncs.cxx
  6. Abstract:
  7. This file contains the implementation of all the RPC methods
  8. supported by the surrogate process and that can be called from a client app.
  9. Author:
  10. Khaled Sedky (khaleds) 18-Jan-2000
  11. Revision History:
  12. --*/
  13. #include "precomp.h"
  14. #pragma hdrstop
  15. #ifndef __LDFUNCS_HPP__
  16. #include "ldfuncs.hpp"
  17. #endif
  18. #ifndef __LDMGR_HPP__
  19. #include "ldmgr.hpp"
  20. #endif
  21. #ifndef __LDINTERFACES_HPP__
  22. #include "ldintrfcs.hpp"
  23. #endif
  24. extern TLoad64BitDllsMgr *pGLdrObj;
  25. /*++
  26. Function Name:
  27. RPCSplWOW64RefreshLifeSpan
  28. Description:
  29. Closing down the window between a client connecting and the server
  30. dieing
  31. Parameters:
  32. None
  33. Return Value
  34. Always 0
  35. --*/
  36. DWORD
  37. RPCSplWOW64RefreshLifeSpan(
  38. )
  39. {
  40. pGLdrObj->RefreshLifeSpan();
  41. return 0;
  42. }
  43. DWORD
  44. RPCSplWOW64GetProcessID(
  45. )
  46. {
  47. return GetCurrentProcessId();
  48. }
  49. /*++
  50. Function Name:
  51. RPCSplWOW64GetProcessHndl
  52. Description:
  53. This function returns the process handle of the surrogate
  54. process to winspool.drv (client in this case). The handle
  55. is important for the client to monitor the server process
  56. and know when it dies
  57. Parameters:
  58. ProcessId : The process id of the client
  59. ErrorCode : contains the error code in case of failure
  60. Return Value
  61. return the Server Process Handle relative to the client
  62. process
  63. --*/
  64. ULONG_PTR
  65. RPCSplWOW64GetProcessHndl(
  66. IN DWORD ProcessId,
  67. OUT PDWORD pErrorCode
  68. )
  69. {
  70. HANDLE hTargetProcess;
  71. HANDLE hDup = NULL;
  72. *pErrorCode = ERROR_SUCCESS;
  73. pGLdrObj->RefreshLifeSpan();
  74. if(hTargetProcess = OpenProcess(PROCESS_DUP_HANDLE,
  75. TRUE,
  76. (DWORD)ProcessId))
  77. {
  78. if(!DuplicateHandle(GetCurrentProcess(),
  79. GetCurrentProcess(),
  80. hTargetProcess,
  81. &hDup,
  82. 0,
  83. FALSE,
  84. DUPLICATE_SAME_ACCESS))
  85. {
  86. *pErrorCode = GetLastError();
  87. }
  88. CloseHandle(hTargetProcess);
  89. }
  90. else
  91. {
  92. *pErrorCode = GetLastError();
  93. }
  94. return (ULONG_PTR)hDup;
  95. }
  96. /*++
  97. Function Name:
  98. RPCSplWOW64AddPort
  99. Description:
  100. Parameters:
  101. Return Value
  102. --*/
  103. BOOL
  104. RPCSplWOW64AddPort(
  105. IN ULONG_PTR hWnd,
  106. IN LPWSTR pszServerName,
  107. IN LPWSTR pszUIDllName,
  108. IN LPWSTR pszMonitorName,
  109. OUT PDWORD pErrorCode
  110. )
  111. {
  112. return(pGLdrObj->ExecuteMonitorOperation(hWnd,
  113. pszServerName,
  114. pszUIDllName,
  115. pszMonitorName,
  116. KAddPortOp,
  117. pErrorCode));
  118. }
  119. /*++
  120. Function Name:
  121. RPCSplWOW64ConfigurePort
  122. Description:
  123. Parameters:
  124. Return Value
  125. --*/
  126. BOOL
  127. RPCSplWOW64ConfigurePort(
  128. IN ULONG_PTR hWnd,
  129. IN LPWSTR pszServerName,
  130. IN LPWSTR pszUIDllName,
  131. IN LPWSTR pszPortName,
  132. OUT PDWORD pErrorCode
  133. )
  134. {
  135. return(pGLdrObj->ExecuteMonitorOperation(hWnd,
  136. pszServerName,
  137. pszUIDllName,
  138. pszPortName,
  139. KConfigurePortOp,
  140. pErrorCode));
  141. }
  142. /*++
  143. Function Name:
  144. RPCSplWOW64DeletePort
  145. Description:
  146. Parameters:
  147. Return Value
  148. --*/
  149. BOOL
  150. RPCSplWOW64DeletePort(
  151. IN ULONG_PTR hWnd,
  152. IN LPWSTR pszServerName,
  153. IN LPWSTR pszUIDllName,
  154. IN LPWSTR pszPortName,
  155. OUT PDWORD pErrorCode
  156. )
  157. {
  158. return(pGLdrObj->ExecuteMonitorOperation(hWnd,
  159. pszServerName,
  160. pszUIDllName,
  161. pszPortName,
  162. KDeletePortOp,
  163. pErrorCode));
  164. }
  165. /*++
  166. Function Name:
  167. RPCSplWOW64DeviceCapabilities
  168. Description:
  169. Parameters:
  170. Return Value
  171. --*/
  172. int
  173. RPCSplWOW64DeviceCapabilities(
  174. IN LPWSTR pszDeviceName,
  175. IN LPWSTR pszPortName,
  176. IN WORD Capabilites,
  177. IN DWORD DevModeSize,
  178. IN LPBYTE pDevMode,
  179. IN BOOL bClonedOutputFill,
  180. OUT PDWORD pClonedOutputSize,
  181. OUT LPBYTE *ppClonedOutput,
  182. OUT PDWORD pErrorCode
  183. )
  184. {
  185. return(pGLdrObj->DeviceCapabilities(pszDeviceName,
  186. pszPortName,
  187. Capabilites,
  188. DevModeSize,
  189. pDevMode,
  190. bClonedOutputFill,
  191. pClonedOutputSize,
  192. ppClonedOutput,
  193. pErrorCode));
  194. }
  195. /*++
  196. Function Name:
  197. RPCSplWOW64DocumentProperties
  198. Description:
  199. Parameters:
  200. Return Value
  201. --*/
  202. LONG
  203. RPCSplWOW64DocumentProperties(
  204. IN ULONG_PTR hWnd,
  205. IN LPWSTR pszPrinterName,
  206. OUT PDWORD pTouchedDevModeSize,
  207. OUT PDWORD pClonedDevModeOutSize,
  208. OUT LPBYTE *ppClonedDevModeOut,
  209. IN DWORD DevModeSize,
  210. IN LPBYTE pDevMode,
  211. IN BOOL bClonedDevModeOutFill,
  212. IN DWORD fMode,
  213. IN PDWORD pErrorCode
  214. )
  215. {
  216. return(pGLdrObj->DocumentProperties(hWnd,
  217. pszPrinterName,
  218. pTouchedDevModeSize,
  219. pClonedDevModeOutSize,
  220. ppClonedDevModeOut,
  221. DevModeSize,
  222. pDevMode,
  223. bClonedDevModeOutFill,
  224. fMode,
  225. pErrorCode));
  226. }
  227. /*++
  228. Function Name:
  229. RPCSplWOW64DocumentProperties
  230. Description:
  231. Parameters:
  232. Return Value
  233. --*/
  234. LONG
  235. RPCSplWOW64PrintUIDocumentProperties(
  236. IN ULONG_PTR hWnd,
  237. IN LPWSTR pszPrinterName,
  238. OUT PDWORD pTouchedDevModeSize,
  239. OUT PDWORD pClonedDevModeOutSize,
  240. OUT LPBYTE *ppClonedDevModeOut,
  241. IN DWORD DevModeSize,
  242. IN LPBYTE pDevMode,
  243. IN BOOL bClonedDevModeOutFill,
  244. IN DWORD fMode,
  245. IN DWORD fExclusionFlags,
  246. IN PDWORD pErrorCode
  247. )
  248. {
  249. return(pGLdrObj->PrintUIDocumentProperties(hWnd,
  250. pszPrinterName,
  251. pTouchedDevModeSize,
  252. pClonedDevModeOutSize,
  253. ppClonedDevModeOut,
  254. DevModeSize,
  255. pDevMode,
  256. bClonedDevModeOutFill,
  257. fMode,
  258. fExclusionFlags,
  259. pErrorCode));
  260. }
  261. /*++
  262. Function Name:
  263. RPCSplWOW64SPrinterProperties
  264. Description:
  265. Wrapper for TPrinterCfgMgr :: PrinterProperties
  266. Parameters:
  267. hWnd : Parent Window
  268. Printername : Printer Name
  269. Flag : Access permissions
  270. ErrorCode : Win32 error in case of failure
  271. Return Value:
  272. BOOL : FALSE for failure
  273. TRUE for success
  274. --*/
  275. BOOL
  276. RPCSplWOW64PrinterProperties(
  277. IN ULONG_PTR hWnd,
  278. IN LPCWSTR pszPrinterName,
  279. IN DWORD Flag,
  280. OUT PDWORD pErrorCode
  281. )
  282. {
  283. TPrinterCfgMgr *pPrntrCfgMgrObj = NULL;
  284. BOOL RetVal = FALSE;
  285. HRESULT hRes;
  286. if((hRes = pGLdrObj->QueryInterface(IID_PRINTERCONFIGURATION,
  287. reinterpret_cast<VOID **>(&pPrntrCfgMgrObj))) == S_OK)
  288. {
  289. SPLASSERT(pPrntrCfgMgrObj);
  290. if(pPrntrCfgMgrObj)
  291. {
  292. RetVal = pPrntrCfgMgrObj->PrinterProperties(hWnd,
  293. pszPrinterName,
  294. Flag,
  295. pErrorCode);
  296. if(!RetVal)
  297. {
  298. DBGMSG(DBG_WARN, ("TPrinterEventMgr::SpoolerPrinterEvent failed with %u\n",*pErrorCode));
  299. }
  300. pPrntrCfgMgrObj->Release();
  301. }
  302. else
  303. {
  304. *pErrorCode = pGLdrObj->GetLastErrorFromHRESULT(E_NOINTERFACE);
  305. }
  306. }
  307. else
  308. {
  309. DBGMSG(DBG_WARN, ("RPCSplWOW64PrinterProperties failed in Instantiating a Print Event Object with %u\n",hRes));
  310. *pErrorCode = pGLdrObj->GetLastErrorFromHRESULT(hRes);
  311. }
  312. return RetVal;
  313. }
  314. /*++
  315. Function Name:
  316. RPCSplWOW64SpoolerPrinterEvent
  317. Description:
  318. Wrapper for TPrinterEventMgr::SpoolerPrinterEvent
  319. Parameters:
  320. PrinterName : The name of the printer involved
  321. PrinterEvent : What happened
  322. Flags : Misc. flag bits
  323. lParam : Event specific parameters
  324. Return Value:
  325. BOOL : TRUE in case of success
  326. : FALSE in case of failure
  327. --*/
  328. BOOL
  329. RPCSplWOW64SpoolerPrinterEvent(
  330. IN LPWSTR pszPrinterName,
  331. IN int PrinterEvent,
  332. IN DWORD Flags,
  333. IN LPARAM lParam,
  334. OUT PDWORD pErrorCode
  335. )
  336. {
  337. TPrinterEventMgr *pPrntrEvntMgrObj = NULL;
  338. BOOL RetVal = FALSE;
  339. HRESULT hRes;
  340. if((hRes = pGLdrObj->QueryInterface(IID_PRINTEREVENT,
  341. reinterpret_cast<VOID **>(&pPrntrEvntMgrObj))) == S_OK)
  342. {
  343. SPLASSERT(pPrntrEvntMgrObj);
  344. RetVal = pPrntrEvntMgrObj->SpoolerPrinterEvent(pszPrinterName,
  345. PrinterEvent,
  346. Flags,
  347. lParam,
  348. pErrorCode);
  349. if (!RetVal)
  350. {
  351. DBGMSG(DBG_WARN, ("TPrinterEventgMgr :: PrinterProperties failed with %u\n",*pErrorCode));
  352. }
  353. pPrntrEvntMgrObj->Release();
  354. }
  355. else
  356. {
  357. DBGMSG(DBG_WARN, ("RPCSplWOW64SpoolerPrinterEvent failed in Instantiating a Print Event Object with %u\n",hRes));
  358. *pErrorCode = pGLdrObj->GetLastErrorFromHRESULT(hRes);
  359. }
  360. return RetVal;
  361. }
  362. /*++
  363. Function Name:
  364. RPCSplWOW64DocumentEvent
  365. Description:
  366. Wrapper for TPrinterEventMgr::DocumentEvent
  367. Parameters:
  368. PrinterName : The name of the printer involved
  369. InDC : The printer DC.
  370. EscapeCode : Why this function is called
  371. InSize, : Size of the input buffer
  372. InBuf, : Pointer to the input buffer
  373. OutSize, : Size of the output buffer
  374. OutBuf, : Pointer to the output buffer
  375. ErrorCode : output Last Error from operation
  376. Return Value:
  377. DOCUMENTEVENT_SUCCESS : success
  378. DOCUMENTEVENT_UNSUPPORTED : EscapeCode is not supported
  379. DOCUMENTEVENT_FAILURE : an error occured
  380. --*/
  381. int
  382. RPCSplWOW64DocumentEvent(
  383. IN LPWSTR pszPrinterName,
  384. IN ULONG_PTR InDC,
  385. IN int EscapeCode,
  386. IN DWORD InSize,
  387. IN LPBYTE pInBuf,
  388. OUT PDWORD pOutSize,
  389. OUT LPBYTE* ppOutBuf,
  390. OUT PDWORD pErrorCode
  391. )
  392. {
  393. TPrinterEventMgr* pPrntrEvntMgrObj = NULL;
  394. int RetVal = -1;
  395. HRESULT hRes;
  396. if((hRes = pGLdrObj->QueryInterface(IID_PRINTEREVENT,
  397. reinterpret_cast<VOID **>(&pPrntrEvntMgrObj))) == S_OK)
  398. {
  399. SPLASSERT(pPrntrEvntMgrObj);
  400. RetVal = pPrntrEvntMgrObj->DocumentEvent(pszPrinterName,
  401. InDC,
  402. EscapeCode,
  403. InSize,
  404. pInBuf,
  405. pOutSize,
  406. ppOutBuf,
  407. pErrorCode);
  408. if (RetVal == -1)
  409. {
  410. DBGMSG(DBG_WARN, ("TPrinterEventMgr::DocumentEvent failed with %u\n",*pErrorCode));
  411. }
  412. pPrntrEvntMgrObj->Release();
  413. }
  414. else
  415. {
  416. DBGMSG(DBG_WARN, ("RPCSplWOW64DocumentEvent failed in Instantiating a Print Event Object with %u\n",hRes));
  417. *pErrorCode = pGLdrObj->GetLastErrorFromHRESULT(hRes);
  418. }
  419. return RetVal;
  420. }
  421. /*++
  422. Function Name:
  423. RPCSplWOW64PrintUIQueueCreate
  424. Description:
  425. Wrapper for TPrintUIMgr::QueueCreate
  426. Parameters:
  427. hWnd : Parent hwnd.
  428. PrinterName : Printer name.
  429. CmdShow : Show command.
  430. lParam : currently unused.
  431. Return Value:
  432. DWORD : Error Code in case of Failure
  433. ERROR_SUCCESS in case of success
  434. --*/
  435. DWORD
  436. RPCSplWOW64PrintUIQueueCreate(
  437. IN ULONG_PTR hWnd,
  438. IN LPCWSTR pszPrinterName,
  439. IN INT CmdShow,
  440. IN LPARAM lParam
  441. )
  442. {
  443. TPrintUIMgr* pPrintUIMgrObj = NULL;
  444. DWORD ErrorCode = ERROR_SUCCESS;
  445. HRESULT hRes;
  446. if((hRes = pGLdrObj->QueryInterface(IID_PRINTUIOPERATIONS,
  447. reinterpret_cast<VOID **>(&pPrintUIMgrObj))) == S_OK)
  448. {
  449. SPLASSERT(pPrintUIMgrObj);
  450. ErrorCode = pPrintUIMgrObj->QueueCreate(reinterpret_cast<HWND>(hWnd),
  451. pszPrinterName,
  452. CmdShow,
  453. static_cast<LPARAM>(lParam)
  454. );
  455. if (ErrorCode != ERROR_SUCCESS)
  456. {
  457. DBGMSG(DBG_WARN, ("TPrintUIMgr::QueueCreate failed with %u\n",ErrorCode));
  458. }
  459. pPrintUIMgrObj->Release();
  460. }
  461. else
  462. {
  463. DBGMSG(DBG_WARN, ("RPCSplWOW64PrintUIQueueCreate failed in Instantiating a Print UI object with %u\n",hRes));
  464. ErrorCode = pGLdrObj->GetLastErrorFromHRESULT(hRes);
  465. }
  466. return ErrorCode;
  467. }
  468. /*++
  469. Function Name:
  470. RPCSplWOW64PrintUIPrinterPropPages
  471. Description:
  472. Wrapper for TPrintUIMgr::PrinterPropPages
  473. Parameters:
  474. hWnd : Parent hwnd.
  475. PrinterName : Printer name.
  476. CmdShow : Show command.
  477. lParam : currently unused.
  478. Return Value:
  479. DWORD : Error Code in case of Failure
  480. ERROR_SUCCESS in case of success
  481. --*/
  482. DWORD
  483. RPCSplWOW64PrintUIPrinterPropPages(
  484. IN ULONG_PTR hWnd,
  485. IN LPCWSTR pszPrinterName,
  486. IN INT CmdShow,
  487. IN LPARAM lParam
  488. )
  489. {
  490. TPrintUIMgr* pPrintUIMgrObj = NULL;
  491. DWORD ErrorCode = ERROR_SUCCESS;
  492. HRESULT hRes;
  493. if((hRes = pGLdrObj->QueryInterface(IID_PRINTUIOPERATIONS,
  494. reinterpret_cast<VOID **>(&pPrintUIMgrObj))) == S_OK)
  495. {
  496. SPLASSERT(pPrintUIMgrObj);
  497. ErrorCode = pPrintUIMgrObj->PrinterPropPages(reinterpret_cast<HWND>(hWnd),
  498. pszPrinterName,
  499. CmdShow,
  500. static_cast<LPARAM>(lParam)
  501. );
  502. if (ErrorCode != ERROR_SUCCESS)
  503. {
  504. DBGMSG(DBG_WARN, ("TPrintUIMgr::PrinterPropPages failed with %u\n",ErrorCode));
  505. }
  506. pPrintUIMgrObj->Release();
  507. }
  508. else
  509. {
  510. DBGMSG(DBG_WARN, ("RPCSplWOW64PrintUIPrinterPropPages failed in Instantiating a Print UI object with %u\n",hRes));
  511. ErrorCode = pGLdrObj->GetLastErrorFromHRESULT(hRes);
  512. }
  513. return ErrorCode;
  514. }
  515. /*++
  516. Function Name:
  517. RPCSplWOW64PrintUIDocumentDefaults
  518. Description:
  519. Wrapper for TPrintUIMgr::DocumentDefaults
  520. Parameters:
  521. hWnd : Parent hwnd.
  522. PrinterName : Printer name.
  523. CmdShow : Show command.
  524. lParam : currently unused.
  525. Return Value:
  526. DWORD : Error Code in case of Failure
  527. ERROR_SUCCESS in case of success
  528. --*/
  529. DWORD
  530. RPCSplWOW64PrintUIDocumentDefaults(
  531. IN ULONG_PTR hWnd,
  532. IN LPCWSTR pszPrinterName,
  533. IN INT CmdShow,
  534. IN LPARAM lParam
  535. )
  536. {
  537. TPrintUIMgr* pPrintUIMgrObj = NULL;
  538. DWORD ErrorCode = ERROR_SUCCESS;
  539. HRESULT hRes;
  540. if((hRes = pGLdrObj->QueryInterface(IID_PRINTUIOPERATIONS,
  541. reinterpret_cast<VOID **>(&pPrintUIMgrObj))) == S_OK)
  542. {
  543. SPLASSERT(pPrintUIMgrObj);
  544. ErrorCode = pPrintUIMgrObj->DocumentDefaults(reinterpret_cast<HWND>(hWnd),
  545. pszPrinterName,
  546. CmdShow,
  547. static_cast<LPARAM>(lParam)
  548. );
  549. if (ErrorCode != ERROR_SUCCESS)
  550. {
  551. DBGMSG(DBG_WARN, ("TPrintUIMgr::DocumentDefaults failed with %u\n",ErrorCode));
  552. }
  553. pPrintUIMgrObj->Release();
  554. }
  555. else
  556. {
  557. DBGMSG(DBG_WARN, ("RPCSplWOW64PrintUIDocumentDefaults failed in Instantiating a Print UI object with %u\n",hRes));
  558. ErrorCode = pGLdrObj->GetLastErrorFromHRESULT(hRes);
  559. }
  560. return ErrorCode;
  561. }
  562. /*++
  563. Function Name:
  564. RPCSplWOW64PrintUIPrinterSetup
  565. Description:
  566. Wrapper for TPrintUIMgr::PrinterSetup.
  567. Parameters:
  568. hwnd - Parent window.
  569. uAction - Action requested (defined in windows\inc16\msprintx.h)
  570. cchPrinterName - Length of pszPrinterName buffer.
  571. pszPrinterName - Input setup printer name, Output pointer to new printer name
  572. pcchPrinterName - New length of pszPrinterName on return.
  573. pszServerName - Name of server that printer is on.
  574. Return Value:
  575. DWORD : Error Code in case of Failure
  576. ERROR_SUCCESS in case of success
  577. --*/
  578. DWORD
  579. RPCSplWOW64PrintUIPrinterSetup(
  580. IN ULONG_PTR hWnd,
  581. IN UINT uAction,
  582. IN UINT cchPrinterName,
  583. IN DWORD PrinterNameSize,
  584. IN OUT byte* pszPrinterName,
  585. OUT UINT* pcchPrinterName,
  586. IN LPCWSTR pszServerName
  587. )
  588. {
  589. TPrintUIMgr* pPrintUIMgrObj = NULL;
  590. DWORD ErrorCode = ERROR_SUCCESS;
  591. HRESULT hRes;
  592. if((hRes = pGLdrObj->QueryInterface(IID_PRINTUIOPERATIONS,
  593. reinterpret_cast<VOID **>(&pPrintUIMgrObj))) == S_OK)
  594. {
  595. SPLASSERT(pPrintUIMgrObj);
  596. ErrorCode = pPrintUIMgrObj->PrinterSetup(reinterpret_cast<HWND>(hWnd),
  597. uAction,
  598. cchPrinterName,
  599. reinterpret_cast<LPWSTR>(pszPrinterName),
  600. pcchPrinterName,
  601. pszServerName
  602. );
  603. if (ErrorCode != ERROR_SUCCESS)
  604. {
  605. DBGMSG(DBG_WARN, ("TPrintUIMgr::PritnerSetup failed with %u\n",ErrorCode));
  606. }
  607. pPrintUIMgrObj->Release();
  608. }
  609. else
  610. {
  611. DBGMSG(DBG_WARN, ("RPCSplWOW64PrintUIPrinterSetup failed in Instantiating a Print UI object with %u\n",hRes));
  612. ErrorCode = pGLdrObj->GetLastErrorFromHRESULT(hRes);
  613. }
  614. return ErrorCode;
  615. }
  616. /*++
  617. Function Name:
  618. RPCSplWOW64PrintUIServerPropPages
  619. Description:
  620. Wrapper for TPrintUIMgr::ServerPropPages
  621. Parameters:
  622. hWnd : Parent hwnd.
  623. PrinterName : Server name.
  624. CmdShow : Show command.
  625. lParam : currently unused.
  626. Return Value:
  627. DWORD : Error Code in case of Failure
  628. ERROR_SUCCESS in case of success
  629. --*/
  630. DWORD
  631. RPCSplWOW64PrintUIServerPropPages(
  632. IN ULONG_PTR hWnd,
  633. IN LPCWSTR pszServerName,
  634. IN INT CmdShow,
  635. IN LPARAM lParam
  636. )
  637. {
  638. TPrintUIMgr* pPrintUIMgrObj = NULL;
  639. DWORD ErrorCode = ERROR_SUCCESS;
  640. HRESULT hRes;
  641. if((hRes = pGLdrObj->QueryInterface(IID_PRINTUIOPERATIONS,
  642. reinterpret_cast<VOID **>(&pPrintUIMgrObj))) == S_OK)
  643. {
  644. SPLASSERT(pPrintUIMgrObj);
  645. ErrorCode = pPrintUIMgrObj->ServerPropPages(reinterpret_cast<HWND>(hWnd),
  646. pszServerName,
  647. CmdShow,
  648. static_cast<LPARAM>(lParam)
  649. );
  650. if (ErrorCode != ERROR_SUCCESS)
  651. {
  652. DBGMSG(DBG_WARN, ("TPrintUIMgr::ServerPropPages failed with %u\n",ErrorCode));
  653. }
  654. pPrintUIMgrObj->Release();
  655. }
  656. else
  657. {
  658. DBGMSG(DBG_WARN, ("RPCSplWOW64PrintUIServerPropPages failed in Instantiating a Print UI object with %u\n",hRes));
  659. ErrorCode = pGLdrObj->GetLastErrorFromHRESULT(hRes);
  660. }
  661. return ErrorCode;
  662. }