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.

712 lines
21 KiB

  1. /****************************************************************************
  2. *****************************************************************************
  3. *
  4. * ******************************************
  5. * * Copyright (c) 1995, Cirrus Logic, Inc. *
  6. * * All Rights Reserved *
  7. * ******************************************
  8. *
  9. * PROJECT: Laguna I (CL-GD5462) -
  10. *
  11. * FILE: escape.c
  12. *
  13. * AUTHOR: Benny Ng
  14. *
  15. * DESCRIPTION:
  16. * This module Handles escapes
  17. *
  18. * MODULES:
  19. * DrvEscape()
  20. *
  21. * REVISION HISTORY:
  22. * 11/16/95 Benny Ng Initial version
  23. *
  24. * $Log: X:/log/laguna/nt35/displays/cl546x/ESCAPE.C $
  25. *
  26. * Rev 1.14 Dec 10 1997 13:32:12 frido
  27. * Merged from 1.62 branch.
  28. *
  29. * Rev 1.13.1.0 Nov 10 1997 11:34:08 phyang
  30. * Added 5 escape functions for utilities to update registry values.
  31. *
  32. * Rev 1.13 10 Sep 1997 10:40:36 noelv
  33. * Modified QUERYESCSUPPORT to only return TRUE for escapes we actually suppor
  34. * It was returning TRUE all the time.
  35. *
  36. * Rev 1.12 20 Aug 1997 15:49:42 bennyn
  37. *
  38. * Added IS_CIRRUS_DRIVER escape support
  39. *
  40. ****************************************************************************
  41. ****************************************************************************/
  42. /*----------------------------- INCLUDES ----------------------------------*/
  43. #include "precomp.h"
  44. #include "clioctl.h"
  45. /*----------------------------- DEFINES -----------------------------------*/
  46. //#define DBGBRK
  47. #define ESC_DBG_LVL 1
  48. #if 0 // MCD not working good
  49. #if ( DRIVER_5465 && !defined(WINNT_VER35) )
  50. #define CLMCD_ESCAPE_SUPPORTED
  51. #endif
  52. #endif// 0 MCD not working good
  53. #ifdef CLMCD_ESCAPE_SUPPORTED
  54. // #define CLMCDDLLNAME "CLMCD.DLL"
  55. // #define CLMCDINITFUNCNAME "CLMCDInit"
  56. MCDRVGETENTRYPOINTSFUNC CLMCDInit(PPDEV ppdev);
  57. #endif // def CLMCD_ESCAPE_SUPPORTED
  58. /*--------------------- STATIC FUNCTION PROTOTYPES ------------------------*/
  59. /*--------------------------- ENUMERATIONS --------------------------------*/
  60. /*----------------------------- TYPEDEFS ----------------------------------*/
  61. #ifdef CLMCD_ESCAPE_SUPPORTED
  62. typedef BOOL (*MCDRVGETENTRYPOINTSFUNC)(MCDSURFACE *pMCDSurface, MCDDRIVER *pMCDDriver);
  63. typedef POFMHDL (*ALLOCOFFSCNMEMFUNC)(PPDEV ppdev, PSIZEL surf, ULONG alignflag, POFM_CALLBACK pcallback);
  64. typedef BOOL (*FREEOFFSCNMEMFUNC)(PPDEV ppdev, OFMHDL *hdl);
  65. //typedef MCDRVGETENTRYPOINTSFUNC (*CLMCDINITFUNC)(PPDEV);
  66. #endif // def CLMCD_ESCAPE_SUPPORTED
  67. /*-------------------------- STATIC VARIABLES -----------------------------*/
  68. /****************************************************************************
  69. * FUNCTION NAME: DrvEscape()
  70. *
  71. * DESCRIPTION: Driver escape entry point.
  72. *
  73. * REVISION HISTORY:
  74. * 11/16/95 Benny Ng Initial version
  75. ****************************************************************************/
  76. ULONG APIENTRY DrvEscape(SURFOBJ *pso,
  77. ULONG iEsc,
  78. ULONG cjIn,
  79. PVOID pvIn,
  80. ULONG cjOut,
  81. PVOID pvOut)
  82. {
  83. PPDEV ppdev = (PPDEV) pso->dhpdev;
  84. DWORD returnedDataLength = 0;
  85. ULONG retval = FALSE;
  86. PMMREG_ACCESS pInMRAccess;
  87. PMMREG_ACCESS pMRAccess;
  88. BYTE *pbAddr;
  89. WORD *pwAddr;
  90. DWORD *pdwAddr;
  91. DISPDBG((ESC_DBG_LVL, "DrvEscape-Entry.\n"));
  92. switch (iEsc)
  93. {
  94. //
  95. // Prior to using an Escape, an application will ask us
  96. // if we support it first. Return TRUE if we can handle
  97. // the requested escape.
  98. //
  99. case QUERYESCSUPPORT:
  100. {
  101. DISPDBG((ESC_DBG_LVL, "DrvEscape: QUERY_ESCAPE_SUPPORTED. "
  102. "Requested escape is 0x%X.\n", *((ULONG *)pvIn) ));
  103. switch ( *((ULONG *)pvIn) )
  104. {
  105. case QUERYESCSUPPORT:
  106. case IS_CIRRUS_DRIVER:
  107. case GET_VIDEO_MEM_SIZE:
  108. case CRTC_READ:
  109. case GET_BIOS_VERSION:
  110. case GET_PCI_VEN_DEV_ID:
  111. case GET_EDID_DATA:
  112. #ifdef CLMCD_ESCAPE_SUPPORTED // OpenGL MCD Interface
  113. case MCDFUNCS:
  114. #endif
  115. case CIRRUS_ESCAPE_FUNCTION:
  116. #if (!(WINNT_VER35)) && DRIVER_5465 // NT 4.0+ and 5465+
  117. case ID_LGPM_SETHWMODULESTATE:
  118. case ID_LGPM_GETHWMODULESTATE:
  119. #endif
  120. case BIOS_CALL_REQUEST:
  121. case GET_CL_MMAP_ADDR:
  122. DISPDBG((ESC_DBG_LVL,
  123. "DrvEscape: We support the requested escape.\n"));
  124. retval = TRUE;
  125. default:
  126. DISPDBG((ESC_DBG_LVL,
  127. "DrvEscape: We DO NOT support the requested escape.\n"));
  128. retval = FALSE;
  129. }
  130. break;
  131. }; // case QUERYESCSUPPORT
  132. case SET_AGPDATASTREAMING:
  133. {
  134. DISPDBG((ESC_DBG_LVL, "DrvEscape: SET_AGPDATASTREAMING.\n"));
  135. retval = FALSE;
  136. if (cjIn == sizeof(BYTE))
  137. {
  138. if (DEVICE_IO_CTRL(ppdev->hDriver,
  139. IOCTL_SET_AGPDATASTREAMING,
  140. pvIn,
  141. sizeof(BYTE),
  142. NULL,
  143. 0,
  144. &returnedDataLength,
  145. NULL))
  146. {
  147. retval = TRUE;
  148. };
  149. };
  150. break;
  151. } // end case SET_AGPDATASTREAMING
  152. case SET_DDCCONTROLFLAG:
  153. {
  154. DISPDBG((ESC_DBG_LVL, "DrvEscape: SET_DDCCONTROLFLAG.\n"));
  155. retval = FALSE;
  156. if (cjIn == sizeof(DWORD))
  157. {
  158. if (DEVICE_IO_CTRL(ppdev->hDriver,
  159. IOCTL_SET_DDCCONTROLFLAG,
  160. pvIn,
  161. sizeof(DWORD),
  162. NULL,
  163. 0,
  164. &returnedDataLength,
  165. NULL))
  166. {
  167. retval = TRUE;
  168. };
  169. };
  170. break;
  171. } // end case SET_DDCCONTROLFLAG
  172. case SET_NONDDCMONITOR_DATA:
  173. {
  174. DISPDBG((ESC_DBG_LVL, "DrvEscape: SET_NONDDCMONITOR_DATA.\n"));
  175. retval = FALSE;
  176. if (cjIn == 128)
  177. {
  178. if (DEVICE_IO_CTRL(ppdev->hDriver,
  179. IOCTL_SET_NONDDCMONITOR_DATA,
  180. pvIn,
  181. 128,
  182. NULL,
  183. 0,
  184. &returnedDataLength,
  185. NULL))
  186. {
  187. retval = TRUE;
  188. };
  189. };
  190. break;
  191. } // end case SET_NONDDCMONITOR_DATA
  192. case SET_NONDDCMONITOR_BRAND:
  193. {
  194. DISPDBG((ESC_DBG_LVL, "DrvEscape: SET_NONDDCMONITOR_BRAND.\n"));
  195. retval = FALSE;
  196. if (cjIn > 0)
  197. {
  198. if (DEVICE_IO_CTRL(ppdev->hDriver,
  199. IOCTL_SET_NONDDCMONITOR_BRAND,
  200. pvIn,
  201. cjIn,
  202. NULL,
  203. 0,
  204. &returnedDataLength,
  205. NULL))
  206. {
  207. retval = TRUE;
  208. };
  209. };
  210. break;
  211. } // end case SET_NONDDCMONITOR_BRAND
  212. case SET_NONDDCMONITOR_MODEL:
  213. {
  214. DISPDBG((ESC_DBG_LVL, "DrvEscape: SET_NONDDCMONITOR_MODEL.\n"));
  215. retval = FALSE;
  216. if (cjIn > 0)
  217. {
  218. if (DEVICE_IO_CTRL(ppdev->hDriver,
  219. IOCTL_SET_NONDDCMONITOR_MODEL,
  220. pvIn,
  221. cjIn,
  222. NULL,
  223. 0,
  224. &returnedDataLength,
  225. NULL))
  226. {
  227. retval = TRUE;
  228. };
  229. };
  230. break;
  231. } // end case SET_NONDDCMONITOR_MODEL
  232. case IS_CIRRUS_DRIVER:
  233. {
  234. DISPDBG((ESC_DBG_LVL, "DrvEscape: IS_CIRRUS_DRIVER.\n"));
  235. retval = TRUE;
  236. break;
  237. } // end case IS_CIRRUS_DRIVER
  238. case GET_VIDEO_MEM_SIZE:
  239. {
  240. BYTE btmp;
  241. PBYTE pOut = (PBYTE) pvOut;
  242. DISPDBG((ESC_DBG_LVL, "DrvEscape: GET_VIDEO_MEM_SIZE.\n"));
  243. if (cjOut == sizeof(BYTE))
  244. {
  245. btmp = ppdev->lTotalMem/0x10000;
  246. *pOut = btmp;
  247. retval = TRUE;
  248. };
  249. break;
  250. } // end case GET_VIDEO_MEM_SIZE
  251. case CRTC_READ:
  252. {
  253. BYTE bindex;
  254. PBYTE pMMReg = (PBYTE) ppdev->pLgREGS_real;
  255. PBYTE pIn = (PBYTE) pvIn;
  256. PBYTE pOut = (PBYTE) pvOut;
  257. DISPDBG((ESC_DBG_LVL, "DrvEscape: CRTC_READ.\n"));
  258. if ((cjIn == sizeof(BYTE)) &&
  259. (cjOut == sizeof(BYTE)))
  260. {
  261. bindex = (*pIn) * 4;
  262. pMMReg = pMMReg + bindex;
  263. *pOut = *pMMReg;
  264. retval = TRUE;
  265. };
  266. break;
  267. } // end case CRTC_READ
  268. case GET_BIOS_VERSION:
  269. {
  270. DISPDBG((ESC_DBG_LVL, "DrvEscape: GET_BIOS_VERSION.\n"));
  271. if (cjOut == sizeof(WORD))
  272. {
  273. if (DEVICE_IO_CTRL(ppdev->hDriver,
  274. IOCTL_GET_BIOS_VERSION,
  275. NULL,
  276. 0,
  277. pvOut,
  278. sizeof(WORD),
  279. &returnedDataLength,
  280. NULL))
  281. {
  282. retval = TRUE;
  283. };
  284. };
  285. break;
  286. } // end case GET_BIOS_VERSION
  287. case GET_PCI_VEN_DEV_ID:
  288. {
  289. ULONG ultmp;
  290. PULONG pOut = (PULONG) pvOut;
  291. DISPDBG((ESC_DBG_LVL, "DrvEscape: GET_PCI_VEN_DEV_ID.\n"));
  292. if (cjOut == sizeof(DWORD))
  293. {
  294. ultmp = ppdev->dwLgVenID;
  295. ultmp = (ultmp << 16) | (ppdev->dwLgDevID & 0xFFFF);
  296. *pOut = ultmp;
  297. retval = TRUE;
  298. };
  299. break;
  300. } // end case GET_PCI_VEN_DEV_ID
  301. case GET_EDID_DATA:
  302. {
  303. DISPDBG((ESC_DBG_LVL, "DrvEscape: GET_EDID_DATA.\n"));
  304. if (cjOut == 132)
  305. {
  306. if (DEVICE_IO_CTRL(ppdev->hDriver,
  307. IOCTL_GET_EDID_DATA,
  308. NULL,
  309. 0,
  310. pvOut,
  311. 132,
  312. &returnedDataLength,
  313. NULL))
  314. {
  315. retval = TRUE;
  316. };
  317. };
  318. break;
  319. } // end case GET_EDID_DATA
  320. #ifdef CLMCD_ESCAPE_SUPPORTED
  321. // OpenGL Mini-Client Driver Interface
  322. case MCDFUNCS:
  323. {
  324. DISPDBG((ESC_DBG_LVL, "DrvEscape-MCDFUNC start\n"));
  325. if (!ppdev->hMCD) {
  326. WCHAR uDllName[50];
  327. UCHAR dllName[50];
  328. ULONG nameSize;
  329. {
  330. HANDLE hCLMCD;
  331. // // load and initialize the dll containing MCD support for display driver
  332. // EngMultiByteToUnicodeN(uDllName, sizeof(uDllName), &nameSize,
  333. // CLMCDDLLNAME, sizeof(CLMCDDLLNAME));
  334. //
  335. // if (hCLMCD = EngLoadImage(uDllName))
  336. {
  337. // CLMCDINITFUNC pCLMCDInit = EngFindImageProcAddress(hCLMCD,
  338. // (LPSTR)CLMCDINITFUNCNAME);
  339. // if (pCLMCDInit)
  340. {
  341. // Enable 3D engine - if enable fails, don't continue loading MCD dll
  342. if (LgPM_SetHwModuleState(ppdev, MOD_3D, ENABLE))
  343. {
  344. DRVENABLEDATA temp;
  345. // MCD dispdriver dll init returns ptr to MCDrvGetEntryPoints,
  346. // which is passed to init proc for MCD helper lib a few lines down...
  347. // MCDRVGETENTRYPOINTSFUNC pMCDGetEntryPoints = (*pCLMCDInit)(ppdev);
  348. MCDRVGETENTRYPOINTSFUNC pMCDGetEntryPoints = CLMCDInit(ppdev);
  349. ppdev->pAllocOffScnMem = AllocOffScnMem;
  350. ppdev->pFreeOffScnMem = FreeOffScnMem;
  351. // after MCD display driver dll loaded, load MCD helper lib (MSFT supplied)
  352. EngMultiByteToUnicodeN(uDllName, sizeof(uDllName), &nameSize,
  353. MCDENGDLLNAME, sizeof(MCDENGDLLNAME));
  354. if (ppdev->hMCD = EngLoadImage(uDllName)) {
  355. MCDENGINITFUNC pMCDEngInit = EngFindImageProcAddress(ppdev->hMCD,
  356. (LPSTR)MCDENGINITFUNCNAME);
  357. if (pMCDEngInit) {
  358. (*pMCDEngInit)(pso, pMCDGetEntryPoints);
  359. ppdev->pMCDFilterFunc = EngFindImageProcAddress(ppdev->hMCD,
  360. (LPSTR)MCDENGESCFILTERNAME);
  361. }
  362. }
  363. }
  364. }
  365. }
  366. }
  367. }
  368. if (ppdev->pMCDFilterFunc) {
  369. #ifdef DBGBRK
  370. DBGBREAKPOINT();
  371. #endif
  372. if ((*ppdev->pMCDFilterFunc)(pso, iEsc, cjIn, pvIn,
  373. cjOut, pvOut, &retval))
  374. {
  375. DISPDBG((ESC_DBG_LVL, "DrvEscape-MCDFilterFunc SUCCESS, retval=%x\n",retval));
  376. return retval;
  377. }
  378. DISPDBG((ESC_DBG_LVL, "DrvEscape-MCDFilterFunc FAILED\n"));
  379. }
  380. }
  381. break;
  382. #endif // def CLMCD_ESCAPE_SUPPORTED
  383. case CIRRUS_ESCAPE_FUNCTION:
  384. {
  385. DISPDBG((ESC_DBG_LVL, "DrvEscape: CIRRUS_ESCAPE_FUNCTION.\n"));
  386. if ((cjIn == sizeof(VIDEO_X86_BIOS_ARGUMENTS)) &&
  387. (cjOut == sizeof(VIDEO_X86_BIOS_ARGUMENTS)))
  388. {
  389. VIDEO_POWER_MANAGEMENT inPM;
  390. BOOL bCallFail = FALSE;
  391. VIDEO_X86_BIOS_ARGUMENTS *pinregs = (VIDEO_X86_BIOS_ARGUMENTS *) pvIn;
  392. VIDEO_X86_BIOS_ARGUMENTS *poutregs = (VIDEO_X86_BIOS_ARGUMENTS *) pvOut;
  393. poutregs->Eax = 0x014F;
  394. poutregs->Ebx = pinregs->Ebx;
  395. poutregs->Ecx = pinregs->Ecx;
  396. if (pinregs->Eax == 0x4F10)
  397. {
  398. if (pinregs->Ebx == 0x0001)
  399. inPM.PowerState = VideoPowerOn;
  400. else if (pinregs->Ebx == 0x0101)
  401. inPM.PowerState = VideoPowerStandBy;
  402. else if (pinregs->Ebx == 0x0201)
  403. inPM.PowerState = VideoPowerSuspend;
  404. else if (pinregs->Ebx == 0x0401)
  405. inPM.PowerState = VideoPowerOff;
  406. else
  407. bCallFail = TRUE;
  408. if (!bCallFail)
  409. {
  410. if (DEVICE_IO_CTRL(ppdev->hDriver,
  411. IOCTL_VIDEO_SET_POWER_MANAGEMENT,
  412. &inPM,
  413. sizeof(VIDEO_POWER_MANAGEMENT),
  414. NULL,
  415. 0,
  416. &returnedDataLength,
  417. NULL))
  418. {
  419. poutregs->Eax = 0x004F;
  420. retval = TRUE;
  421. };
  422. }; // endif (!bCallFail)
  423. }; // endif (pinregs->Eax == 0x4F10)
  424. };
  425. break;
  426. }; // case CIRRUS_ESCAPE_FUNCTION
  427. #if (!(WINNT_VER35)) && DRIVER_5465 // NT 4.0+ and 5465+
  428. case ID_LGPM_SETHWMODULESTATE:
  429. {
  430. ULONG state;
  431. DISPDBG((ESC_DBG_LVL, "DrvEscape: ID_LGPM_SETHWMODULESTATE.\n"));
  432. if (ppdev->dwLgDevID >= CL_GD5465)
  433. {
  434. if ((cjIn == sizeof(LGPM_IN_STRUCT)) &&
  435. (cjOut == sizeof(LGPM_OUT_STRUCT)))
  436. {
  437. LGPM_IN_STRUCT *pIn = (LGPM_IN_STRUCT *) pvIn;
  438. LGPM_OUT_STRUCT *pOut = (LGPM_OUT_STRUCT *) pvOut;
  439. retval = TRUE;
  440. pOut->status = FALSE;
  441. pOut->retval = 0;
  442. pOut->status = LgPM_SetHwModuleState(ppdev, pIn->arg1, pIn->arg2);
  443. };
  444. }; // endif (ppdev->dwLgDevID >= CL_GD5465)
  445. break;
  446. }; // case ID_LGPM_SETHWMODULESTATE
  447. #endif
  448. #if (!(WINNT_VER35)) && DRIVER_5465 // NT 4.0+ and 5465+
  449. case ID_LGPM_GETHWMODULESTATE:
  450. {
  451. ULONG state;
  452. DISPDBG((ESC_DBG_LVL, "DrvEscape: ID_LGPM_GETHWMODULESTATE.\n"));
  453. if (ppdev->dwLgDevID >= CL_GD5465)
  454. {
  455. if ((cjIn == sizeof(LGPM_IN_STRUCT)) &&
  456. (cjOut == sizeof(LGPM_OUT_STRUCT)))
  457. {
  458. LGPM_IN_STRUCT *pIn = (LGPM_IN_STRUCT *) pvIn;
  459. LGPM_OUT_STRUCT *pOut = (LGPM_OUT_STRUCT *) pvOut;
  460. retval = TRUE;
  461. pOut->status = FALSE;
  462. pOut->retval = 0;
  463. pOut->status = LgPM_GetHwModuleState(ppdev, pIn->arg1, &state);
  464. pOut->retval = state;
  465. };
  466. }; // endif (ppdev->dwLgDevID >= CL_GD5465)
  467. break;
  468. }; // case ID_LGPM_GETHWMODULESTATE
  469. #endif
  470. case BIOS_CALL_REQUEST:
  471. {
  472. if ((cjIn == sizeof(VIDEO_X86_BIOS_ARGUMENTS)) &&
  473. (cjOut == sizeof(VIDEO_X86_BIOS_ARGUMENTS)))
  474. {
  475. if (DEVICE_IO_CTRL(ppdev->hDriver,
  476. IOCTL_CL_BIOS,
  477. pvIn,
  478. cjIn,
  479. pvOut,
  480. cjOut,
  481. &returnedDataLength,
  482. NULL))
  483. retval = TRUE;
  484. };
  485. DISPDBG((ESC_DBG_LVL, "DrvEscape-BIOS_CALL_REQUEST\n"));
  486. #ifdef DBGBRK
  487. DbgBreakPoint();
  488. #endif
  489. break;
  490. }; // end case BIOS_CALL_REQUEST
  491. case GET_CL_MMAP_ADDR:
  492. {
  493. DISPDBG((ESC_DBG_LVL, "DrvEscape: GET_CL_MMAP_ADDR.\n"));
  494. if ((cjIn != sizeof(MMREG_ACCESS)) || (cjOut != sizeof(MMREG_ACCESS)))
  495. break;
  496. pInMRAccess = (MMREG_ACCESS *) pvIn;
  497. pMRAccess = (MMREG_ACCESS *) pvOut;
  498. pMRAccess->Offset = pInMRAccess->Offset;
  499. pMRAccess->ReadVal = pInMRAccess->ReadVal;
  500. pMRAccess->WriteVal = pInMRAccess->WriteVal;
  501. pMRAccess->RdWrFlag = pInMRAccess->RdWrFlag;
  502. pMRAccess->AccessType = pInMRAccess->AccessType;
  503. pbAddr = (BYTE *) ppdev->pLgREGS;
  504. pbAddr = pbAddr + pMRAccess->Offset;
  505. if (pMRAccess->RdWrFlag == READ_OPR) // Read operation
  506. {
  507. pMRAccess->WriteVal = 0;
  508. retval = TRUE;
  509. if (pMRAccess->AccessType == BYTE_ACCESS)
  510. {
  511. pMRAccess->ReadVal = (*pbAddr) & 0xFF;
  512. }
  513. else if (pMRAccess->AccessType == WORD_ACCESS)
  514. {
  515. pwAddr = (WORD *)pbAddr;
  516. pMRAccess->ReadVal = (*pwAddr) & 0xFFFF;
  517. }
  518. else if (pMRAccess->AccessType == DWORD_ACCESS)
  519. {
  520. pdwAddr = (DWORD *)pbAddr;
  521. pMRAccess->ReadVal = *pdwAddr;
  522. }
  523. else
  524. {
  525. pMRAccess->ReadVal = 0;
  526. retval = FALSE;
  527. };
  528. }
  529. else if (pMRAccess->RdWrFlag == WRITE_OPR) // Write operation
  530. {
  531. retval = TRUE;
  532. if (pMRAccess->AccessType == BYTE_ACCESS)
  533. {
  534. pMRAccess->ReadVal = (*pbAddr) & 0xFF;
  535. *pbAddr = (BYTE) (pMRAccess->WriteVal & 0xFF);
  536. }
  537. else if (pMRAccess->AccessType == WORD_ACCESS)
  538. {
  539. pwAddr = (WORD *)pbAddr;
  540. pMRAccess->ReadVal = (*pwAddr) & 0xFFFF;
  541. *pwAddr = (WORD) (pMRAccess->WriteVal & 0xFFFF);
  542. }
  543. else if (pMRAccess->AccessType == DWORD_ACCESS)
  544. {
  545. pdwAddr = (DWORD *)pbAddr;
  546. pMRAccess->ReadVal = *pdwAddr;
  547. *pdwAddr = pMRAccess->WriteVal;
  548. }
  549. else
  550. {
  551. pMRAccess->ReadVal = 0;
  552. pMRAccess->WriteVal = 0;
  553. retval = FALSE;
  554. };
  555. };
  556. DISPDBG((ESC_DBG_LVL, "DrvEscape-GET_CL_MMAP_ADDR\n"));
  557. DISPDBG((ESC_DBG_LVL, "DrvEscape-rd=%x, wr=%x\n",
  558. pMRAccess->ReadVal, pMRAccess->WriteVal));
  559. #ifdef DBGBRK
  560. DbgBreakPoint();
  561. #endif
  562. break;
  563. }; // IOCTL_CL_GET_MMAP_ADDR
  564. default:
  565. DISPDBG((ESC_DBG_LVL,
  566. "DrvEscape: default - Escape not handled.\n"));
  567. DISPDBG((ESC_DBG_LVL,
  568. "DrvEscape: Requested escape is 0x%X.\n",iEsc ));
  569. DISPDBG((ESC_DBG_LVL, "DrvEscape: Returning FALSE.\n"));
  570. retval = FALSE;
  571. break;
  572. }; // end switch
  573. DISPDBG((ESC_DBG_LVL, "DrvEscape-Exit.\n"));
  574. return (retval);
  575. }
  576.