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.

99 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1985 - 1999, Microsoft Corporation
  3. Module Name:
  4. vdm.c
  5. Abstract:
  6. This module contains the console API for MVDM.
  7. Author:
  8. Revision History:
  9. --*/
  10. #include "precomp.h"
  11. #pragma hdrstop
  12. #pragma hdrstop
  13. BOOL
  14. APIENTRY
  15. VDMConsoleOperation(
  16. DWORD iFunction,
  17. LPVOID lpData
  18. )
  19. /*++
  20. Parameters:
  21. iFunction - Function Index.
  22. VDM_HIDE_WINDOW
  23. Return Value:
  24. TRUE - The operation was successful.
  25. FALSE/NULL - The operation failed. Extended error status is available
  26. using GetLastError.
  27. --*/
  28. {
  29. CONSOLE_API_MSG m;
  30. PCONSOLE_VDM_MSG a = &m.u.VDMConsoleOperation;
  31. LPRECT lpRect;
  32. LPPOINT lpPoint;
  33. PBOOL lpBool;
  34. a->ConsoleHandle = GET_CONSOLE_HANDLE;
  35. a->iFunction = iFunction;
  36. if (iFunction == VDM_CLIENT_TO_SCREEN ||
  37. iFunction == VDM_SCREEN_TO_CLIENT) {
  38. lpPoint = (LPPOINT)lpData;
  39. a->Point = *lpPoint;
  40. } else if (iFunction == VDM_FULLSCREEN_NOPAINT) {
  41. a->Bool = (lpData != NULL);
  42. }
  43. #if defined(FE_SB)
  44. else if (iFunction == VDM_SET_VIDEO_MODE) {
  45. a->Bool = (lpData != NULL);
  46. }
  47. #endif // FE_SB
  48. CsrClientCallServer( (PCSR_API_MSG)&m,
  49. NULL,
  50. CSR_MAKE_API_NUMBER( CONSRV_SERVERDLL_INDEX,
  51. ConsolepVDMOperation
  52. ),
  53. sizeof( *a )
  54. );
  55. if (NT_SUCCESS( m.ReturnValue )) {
  56. switch (iFunction) {
  57. case VDM_IS_ICONIC:
  58. case VDM_IS_HIDDEN:
  59. lpBool = (PBOOL)lpData;
  60. *lpBool = a->Bool;
  61. break;
  62. case VDM_CLIENT_RECT:
  63. lpRect = (LPRECT)lpData;
  64. *lpRect = a->Rect;
  65. break;
  66. case VDM_CLIENT_TO_SCREEN:
  67. case VDM_SCREEN_TO_CLIENT:
  68. *lpPoint = a->Point;
  69. break;
  70. default:
  71. break;
  72. }
  73. return TRUE;
  74. } else {
  75. SET_LAST_NT_ERROR (m.ReturnValue);
  76. return FALSE;
  77. }
  78. }