Source code of Windows XP (NT5)
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.

60 lines
2.0 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: escape.c
  3. *
  4. * Escape handler for MCD drivers and other escapes.
  5. *
  6. * Copyright (c) 1996 Microsoft Corporation
  7. \**************************************************************************/
  8. #include "precomp.h"
  9. //****************************************************************************
  10. // ULONG DrvEscape(SURFOBJ *, ULONG, ULONG, VOID *, ULONG cjOut, VOID *pvOut)
  11. //
  12. // Driver escape entry point. This function should return TRUE for any
  13. // supported escapes in response to QUERYESCSUPPORT, and FALSE for any
  14. // others. All supported escapes are called from this routine.
  15. //****************************************************************************
  16. BOOL MCDrvGetEntryPoints(MCDSURFACE *pMCDSurface, MCDDRIVER *pMCDDriver);
  17. ULONG DrvEscape(SURFOBJ *pso, ULONG iEsc,
  18. ULONG cjIn, VOID *pvIn,
  19. ULONG cjOut, VOID *pvOut)
  20. {
  21. ULONG retVal;
  22. PDEV *ppdev;
  23. if (iEsc == MCDFUNCS) {
  24. ppdev = (PDEV *)pso->dhpdev;
  25. if (!ppdev->hMCD) {
  26. WCHAR uDllName[50];
  27. UCHAR dllName[50];
  28. ULONG nameSize;
  29. EngMultiByteToUnicodeN(uDllName, sizeof(uDllName), &nameSize,
  30. MCDENGDLLNAME, sizeof(MCDENGDLLNAME));
  31. if (ppdev->hMCD = EngLoadImage(uDllName)) {
  32. MCDENGINITFUNC pMCDEngInit = EngFindImageProcAddress(ppdev->hMCD,
  33. (LPSTR)MCDENGINITFUNCNAME);
  34. if (pMCDEngInit) {
  35. (*pMCDEngInit)(pso, MCDrvGetEntryPoints);
  36. ppdev->pMCDFilterFunc = EngFindImageProcAddress(ppdev->hMCD,
  37. (LPSTR)MCDENGESCFILTERNAME);
  38. }
  39. }
  40. }
  41. if (ppdev->pMCDFilterFunc) {
  42. if ((*ppdev->pMCDFilterFunc)(pso, iEsc, cjIn, pvIn,
  43. cjOut, pvOut, &retVal))
  44. return retVal;
  45. }
  46. }
  47. return (ULONG)FALSE;
  48. }