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.

166 lines
3.0 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. NTSTATUS
  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. IN HANDLE hUserToken
  43. );
  44. VOID
  45. BaseCloseStandardHandle(
  46. IN PVDMINFO pVDMInfo
  47. );
  48. BOOL
  49. BaseCheckForVDM(
  50. IN HANDLE hProcess,
  51. OUT LPDWORD lpExitCode
  52. );
  53. BOOL
  54. BaseCreateVDMEnvironment(
  55. LPWSTR lpEnvironment,
  56. ANSI_STRING *pAStringEnv,
  57. UNICODE_STRING *pUStringEnv
  58. );
  59. BOOL
  60. BaseDestroyVDMEnvironment(
  61. ANSI_STRING *pAStringEnv,
  62. UNICODE_STRING *pUStringEnv
  63. );
  64. UINT
  65. BaseGetEnvNameType_U(
  66. WCHAR * Name,
  67. DWORD NameLength
  68. );
  69. LPCWSTR
  70. SkipPathTypeIndicator_U(
  71. LPCWSTR Path
  72. );
  73. BOOL
  74. FindLFNorSFN_U(
  75. LPWSTR Path,
  76. LPWSTR* ppFirst,
  77. LPWSTR* ppLast,
  78. BOOL FindLFN
  79. );
  80. BOOL
  81. IsShortName_U(
  82. LPCWSTR Name,
  83. int Length
  84. );
  85. BOOL
  86. IsLongName_U(
  87. LPCWSTR Name,
  88. int Length
  89. );
  90. #define MAX_VDM_NESTING 8
  91. #define DEFAULT_ENV_LENGTH 256
  92. #define MAX_VDM_CFG_LINE 256
  93. #define FULL_INFO_BUFFER_SIZE (sizeof(KEY_VALUE_FULL_INFORMATION) + MAX_VDM_CFG_LINE)
  94. #define WOW_ROOT \
  95. L"\\Registry\\Machine\\System\\CurrentControlSet\\Control\\WOW"
  96. #define CMDLINE L"cmdline"
  97. #define DOSSIZE L"size"
  98. #define WOWCMDLINE L"wowcmdline"
  99. #define WOWSIZE L"wowsize"
  100. #define CHECKDOSCONSOLE 0
  101. #define CHECKWOWCONSOLE 1
  102. #define ASSUMENOCONSOLE 2
  103. extern HANDLE hVDM[];
  104. #define STD_ENV_NAME_COUNT 5
  105. // Define environment variables we need to convert their values to
  106. // short path name in BaseCreateVdmEnvironment function.
  107. #define ENV_NAME_PATH L"PATH"
  108. #define ENV_NAME_PATH_LEN 4
  109. #define ENV_NAME_WINDIR L"WINDIR"
  110. #define ENV_NAME_WINDIR_LEN 6
  111. #define ENV_NAME_SYSTEMROOT L"SYSTEMROOT"
  112. #define ENV_NAME_SYSTEMROOT_LEN 10
  113. #define ENV_NAME_TEMP L"TEMP"
  114. #define ENV_NAME_TEMP_LEN 4
  115. #define ENV_NAME_TMP L"TMP"
  116. #define ENV_NAME_TMP_LEN 3
  117. // ENV_NAME_TYPE
  118. #define ENV_NAME_TYPE_NO_PATH 1
  119. #define ENV_NAME_TYPE_SINGLE_PATH 2
  120. #define ENV_NAME_TYPE_MULTIPLE_PATH 3
  121. typedef struct _ENV_INFO {
  122. UINT NameType;
  123. UINT NameLength;
  124. WCHAR *Name;
  125. } ENV_INFO, * PENV_INFO;