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.

70 lines
1.6 KiB

  1. /******************************Module*Header**********************************\
  2. *
  3. * *******************
  4. * * GDI SAMPLE CODE *
  5. * *******************
  6. *
  7. * Module Name: escape.c
  8. *
  9. * Contains private escape calls for driver.
  10. *
  11. *
  12. *
  13. * Copyright (c) 1995-1999 Microsoft Corporation. All rights reserved.
  14. *****************************************************************************/
  15. #include "precomp.h"
  16. #include "log.h"
  17. #define ESCAPE_OPEN_LOG 1024
  18. #define ESCAPE_CLOSE_LOG 1025
  19. ULONG APIENTRY DrvEscape(
  20. SURFOBJ *pso,
  21. ULONG iEsc,
  22. ULONG cjIn,
  23. PVOID pvIn,
  24. ULONG cjOut,
  25. PVOID pvOut
  26. )
  27. {
  28. PPDev ppdev = (PPDev) pso->dhpdev;
  29. ULONG ulResult;
  30. switch(iEsc)
  31. {
  32. case ESCAPE_OPEN_LOG:
  33. ulResult = ulLogOpen(L"\\??\\E:\\puntinfo.txt", 1024 * 1024 * 32);
  34. if(!ulResult)
  35. {
  36. DBG_GDI((0, "DrvEscape: failed to open log file"));
  37. }
  38. else
  39. {
  40. DBG_GDI((0, "DrvEscape: opened log file"));
  41. }
  42. break;
  43. case ESCAPE_CLOSE_LOG:
  44. ulResult = ulLogClose();
  45. if(!ulResult)
  46. {
  47. DBG_GDI((0, "DrvEscape: failed to close log file"));
  48. }
  49. else
  50. {
  51. DBG_GDI((0, "DrvEscape: close log file"));
  52. }
  53. break;
  54. default:
  55. DBG_GDI((3, "DrvEscape: unknown escape %d", iEsc));
  56. ulResult = 0;
  57. }
  58. return ulResult;
  59. }