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.

181 lines
3.1 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. vdm.h
  5. Abstract:
  6. This module contains MVDM related interface prototypes
  7. Author:
  8. Sudeep Bharati (sudeepb) 04-Jan-1992
  9. Revision History:
  10. --*/
  11. BOOL
  12. BaseGetVdmConfigInfo(
  13. IN LPCWSTR CommandLine,
  14. IN ULONG DosSeqId,
  15. IN ULONG BinaryType,
  16. IN PUNICODE_STRING CmdLineString,
  17. OUT PULONG VdmSize
  18. );
  19. ULONG
  20. BaseIsDosApplication(
  21. IN PUNICODE_STRING PathName,
  22. IN NTSTATUS Status
  23. );
  24. BOOL
  25. BaseUpdateVDMEntry(
  26. IN ULONG UpdateIndex,
  27. IN OUT HANDLE *WaitHandle,
  28. IN ULONG IndexInfo,
  29. IN ULONG BinaryType
  30. );
  31. BOOL
  32. BaseCheckVDM(
  33. IN ULONG BinaryType,
  34. IN PCWCH lpApplicationName,
  35. IN PCWCH lpCommandLine,
  36. IN PCWCH lpCurrentDirectory,
  37. IN ANSI_STRING *pAnsiStringEnv,
  38. IN PBASE_API_MSG m,
  39. IN OUT PULONG iTask,
  40. IN DWORD dwCreationFlags,
  41. LPSTARTUPINFOW lpStartupInfo
  42. );
  43. VOID
  44. BaseCloseStandardHandle(
  45. IN PVDMINFO pVDMInfo
  46. );
  47. BOOL
  48. BaseGetVDMKeyword(
  49. LPWSTR KeywordLine,
  50. LPSTR KeywordLineValue,
  51. LPDWORD KeywordLineSize,
  52. LPWSTR KeywordSize,
  53. LPDWORD VdmSize
  54. );
  55. BOOL
  56. BaseCheckForVDM(
  57. IN HANDLE hProcess,
  58. OUT LPDWORD lpExitCode
  59. );
  60. BOOL
  61. GetVDMConfigValue(
  62. HANDLE hKey,
  63. LPWSTR Keyword,
  64. LPWSTR UnicodeBuffer
  65. );
  66. BOOL
  67. BaseCreateVDMEnvironment(
  68. LPWSTR lpEnvironment,
  69. ANSI_STRING *pAStringEnv,
  70. UNICODE_STRING *pUStringEnv
  71. );
  72. BOOL
  73. BaseDestroyVDMEnvironment(
  74. ANSI_STRING *pAStringEnv,
  75. UNICODE_STRING *pUStringEnv
  76. );
  77. UINT
  78. BaseGetEnvNameType_U(
  79. WCHAR * Name,
  80. DWORD NameLength
  81. );
  82. LPCWSTR
  83. SkipPathTypeIndicator_U(
  84. LPCWSTR Path
  85. );
  86. BOOL
  87. FindLFNorSFN_U(
  88. LPWSTR Path,
  89. LPWSTR* ppFirst,
  90. LPWSTR* ppLast,
  91. BOOL FindLFN
  92. );
  93. BOOL
  94. IsShortName_U(
  95. LPCWSTR Name,
  96. int Length
  97. );
  98. BOOL
  99. IsLongName_U(
  100. LPCWSTR Name,
  101. int Length
  102. );
  103. #define MAX_VDM_NESTING 8
  104. #define DEFAULT_ENV_LENGTH 256
  105. #define MAX_VDM_CFG_LINE 256
  106. #define FULL_INFO_BUFFER_SIZE (sizeof(KEY_VALUE_FULL_INFORMATION) + MAX_VDM_CFG_LINE)
  107. #define WOW_ROOT \
  108. L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\WOW"
  109. #define CMDLINE L"cmdline"
  110. #define DOSSIZE L"size"
  111. #define WOWCMDLINE L"wowcmdline"
  112. #define WOWSIZE L"wowsize"
  113. #define CHECKDOSCONSOLE 0
  114. #define CHECKWOWCONSOLE 1
  115. #define ASSUMENOCONSOLE 2
  116. extern HANDLE hVDM[];
  117. #define STD_ENV_NAME_COUNT 5
  118. // Define environment variables we need to convert their values to
  119. // short path name in BaseCreateVdmEnvironment function.
  120. #define ENV_NAME_PATH L"PATH"
  121. #define ENV_NAME_PATH_LEN 4
  122. #define ENV_NAME_WINDIR L"WINDIR"
  123. #define ENV_NAME_WINDIR_LEN 6
  124. #define ENV_NAME_SYSTEMROOT L"SYSTEMROOT"
  125. #define ENV_NAME_SYSTEMROOT_LEN 10
  126. #define ENV_NAME_TEMP L"TEMP"
  127. #define ENV_NAME_TEMP_LEN 4
  128. #define ENV_NAME_TMP L"TMP"
  129. #define ENV_NAME_TMP_LEN 3
  130. // ENV_NAME_TYPE
  131. #define ENV_NAME_TYPE_NO_PATH 1
  132. #define ENV_NAME_TYPE_SINGLE_PATH 2
  133. #define ENV_NAME_TYPE_MULTIPLE_PATH 3
  134. typedef struct _ENV_INFO {
  135. UINT NameType;
  136. UINT NameLength;
  137. WCHAR *Name;
  138. } ENV_INFO, * PENV_INFO;