Windows NT 4.0 source code leak
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.

141 lines
3.4 KiB

4 years ago
  1. /*++ BUILD Version: 0001 // Increment this if a change has global effects
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. vdmapi.h
  5. Abstract:
  6. This module defines the private MVDM APIs
  7. Created:
  8. 02-Apr-1992
  9. Revision History:
  10. Created 02-Apr-1992 Sudeep Bharati
  11. --*/
  12. #define MAXIMUM_VDM_COMMAND_LENGTH 128
  13. #define MAXIMUM_VDM_ENVIORNMENT 32*1024
  14. #define MAXIMUM_VDM_CURRENT_DIR 64
  15. // The following value can be used to allocate space for the largest possible
  16. // path string in ansi, including directory, drive letter and file name.
  17. // I originally coded this with 13 for the path name, but DOS seems to be
  18. // able to handle one more, thus the 14.
  19. #define MAXIMUM_VDM_PATH_STRING MAXIMUM_VDM_CURRENT_DIR+3+14
  20. // VDMState defines
  21. #define ASKING_FOR_FIRST_COMMAND 0x1 // Very First call.
  22. #define ASKING_FOR_WOW_BINARY 0x2 // Caller is WOWVDM
  23. #define ASKING_FOR_DOS_BINARY 0x4 // Caller is DOSVDM
  24. #define ASKING_FOR_SECOND_TIME 0x8 // Caller is asking second time after
  25. #define INCREMENT_REENTER_COUNT 0x10 // Increment the re-entrancy count
  26. #define DECREMENT_REENTER_COUNT 0x20 // Decrement the re-entrancy count
  27. #define NO_PARENT_TO_WAKE 0x40 // Just get the next command, dont wake up anyone
  28. // allocating bigger buffers.
  29. #define RETURN_ON_NO_COMMAND 0x80 // if there is no command return without blocking
  30. #define ASKING_FOR_PIF 0x100 // To get the exe name to find out PIF
  31. // early in the VDM initialization.
  32. #define STARTUP_INFO_RETURNED 0x200 // on return if this bit is set means
  33. // startupinfo structure was filled in.
  34. #define ASKING_FOR_ENVIRONMENT 0x400 // ask for environment only
  35. #define ASKING_FOR_SEPWOW_BINARY 0x800 // Caller is Separate WOW
  36. typedef struct _VDMINFO {
  37. ULONG iTask;
  38. ULONG dwCreationFlags;
  39. ULONG ErrorCode;
  40. ULONG CodePage;
  41. HANDLE StdIn;
  42. HANDLE StdOut;
  43. HANDLE StdErr;
  44. LPVOID CmdLine;
  45. LPVOID AppName;
  46. LPVOID PifFile;
  47. LPVOID CurDirectory;
  48. LPVOID Enviornment;
  49. ULONG EnviornmentSize;
  50. STARTUPINFOA StartupInfo;
  51. LPVOID Desktop;
  52. ULONG DesktopLen;
  53. LPVOID Title;
  54. ULONG TitleLen;
  55. LPVOID Reserved;
  56. ULONG ReservedLen;
  57. USHORT CmdSize;
  58. USHORT AppLen;
  59. USHORT PifLen;
  60. USHORT CurDirectoryLen;
  61. USHORT VDMState;
  62. USHORT CurDrive;
  63. BOOLEAN fComingFromBat;
  64. } VDMINFO, *PVDMINFO;
  65. // for CmdBatNotification
  66. #define CMD_BAT_OPERATION_TERMINATING 0
  67. #define CMD_BAT_OPERATION_STARTING 1
  68. //
  69. // Message sent by BaseSrv to shared WOWEXEC to tell it to call
  70. // GetNextVDMCommand. No longer will a thread in WOW be blocked
  71. // in GetNextVDMCommand all the time.
  72. //
  73. #define WM_WOWEXECSTARTAPP (WM_USER) // also in mvdm\inc\wowinfo.h
  74. //
  75. // MVDM apis
  76. //
  77. VOID
  78. APIENTRY
  79. VDMOperationStarted(
  80. IN BOOL IsWowCaller
  81. );
  82. BOOL
  83. APIENTRY
  84. GetNextVDMCommand(
  85. PVDMINFO pVDMInfo
  86. );
  87. VOID
  88. APIENTRY
  89. ExitVDM(
  90. IN BOOL IsWowCaller,
  91. IN ULONG iWowTask
  92. );
  93. BOOL
  94. APIENTRY
  95. SetVDMCurrentDirectories(
  96. IN ULONG cchCurDir,
  97. IN CHAR *lpszCurDir
  98. );
  99. ULONG
  100. APIENTRY
  101. GetVDMCurrentDirectories(
  102. IN ULONG cchCurDir,
  103. IN CHAR *lpszCurDir
  104. );
  105. VOID
  106. APIENTRY
  107. CmdBatNotification(
  108. IN ULONG fBeginEnd
  109. );
  110. VOID
  111. APIENTRY
  112. RegisterWowExec(
  113. IN HANDLE hwndWowExec
  114. );