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.

176 lines
2.8 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. pdxdll.h
  5. Abstract:
  6. Posix Subsystem Dll Private Types and Prototypes
  7. Author:
  8. Mark Lucovsky (markl) 04-Oct-1989
  9. Revision History:
  10. --*/
  11. #ifndef _PDXP_
  12. #define _PDXP_
  13. #include <nt.h>
  14. #include <ntrtl.h>
  15. #include <nturtl.h>
  16. #include <excpt.h>
  17. #include <sys\types.h>
  18. #include <string.h>
  19. #include <limits.h>
  20. #include <signal.h>
  21. #include <errno.h>
  22. #include <dirent.h>
  23. #include <fcntl.h>
  24. #include <sys\stat.h>
  25. #include <sys\wait.h>
  26. #include <ntsm.h>
  27. #include <unistd.h>
  28. #include "psxmsg.h"
  29. #define NTPSX_ONLY
  30. #include "sesport.h"
  31. int *Errno;
  32. #define errno (*Errno)
  33. char ***Environ;
  34. #define environ (*Environ)
  35. //
  36. // The PsxDllHandle global variable contains the DLL handle for the WINDLL
  37. // client stubs executable.
  38. //
  39. HANDLE PsxDllHandle;
  40. //
  41. // The connection to the Server is described by the PsxPortHandle global
  42. // variable. The connection is established when the PsxConnectToServer
  43. // function is called.
  44. //
  45. UNICODE_STRING PsxPortName;
  46. HANDLE PsxPortHandle;
  47. extern ULONG_PTR PsxPortMemoryRemoteDelta;
  48. PVOID PdxHeap;
  49. PVOID PdxPortHeap;
  50. PSX_DIRECTORY_PREFIX PdxDirectoryPrefix;
  51. ANSI_STRING PsxAnsiCommandLine;
  52. //
  53. // PathName Conversion Macros
  54. //
  55. #define IS_POSIX_PATH_SEPARATOR(s) (*(s) == '/' )
  56. #define IS_POSIX_DOT(s) ( s[0] == '.' && ( s[1] == '/' || s[1] == '\0') )
  57. #define IS_POSIX_DOT_DOT(s) ( s[0] == '.' && s[1] == '.' && ( s[2] == '/' || s[2] == '\0') )
  58. #define IN_PORTABLE_CHARACTER_SET(c) (\
  59. ((c)>='A' && (c)<='Z') || \
  60. ((c)>='a' && (c)<='z') || \
  61. ((c)>='0' && (c)<='9') || \
  62. ((c)=='.') || \
  63. ((c)=='_') || \
  64. ((c)=='-') )
  65. typedef int (__cdecl * PFNPROCESS)(ULONG argc,
  66. PCHAR *argv
  67. );
  68. //
  69. // Stuff for the uname() syscall.
  70. //
  71. #define UNAME_SYSNAME "Windows NT"
  72. #define UNAME_RELEASE "3"
  73. #define UNAME_VERSION "5"
  74. //
  75. // Prototypes
  76. //
  77. void
  78. ClientOpen(
  79. IN int fd
  80. );
  81. VOID
  82. PdxProcessStartup(
  83. IN PPEB Peb
  84. );
  85. NTSTATUS
  86. PsxConnectToServer();
  87. NTSTATUS
  88. PsxInitDirectories();
  89. VOID
  90. PdxNullPosixApi();
  91. int
  92. PdxStatusToErrno(NTSTATUS);
  93. int
  94. PdxStatusToErrnoPath(PUNICODE_STRING);
  95. VOID
  96. _PdxSignalDeliverer (
  97. IN PCONTEXT Context,
  98. IN sigset_t PreviousBlockMask,
  99. IN int Signal,
  100. IN _handler Handler
  101. );
  102. VOID
  103. PdxSignalDeliverer (
  104. IN PCONTEXT Context,
  105. IN sigset_t PreviousBlockMask,
  106. IN int Signal,
  107. IN _handler Handler
  108. );
  109. VOID
  110. _PdxNullApiCaller(
  111. IN PCONTEXT Context
  112. );
  113. VOID
  114. PdxNullApiCaller(
  115. IN PCONTEXT Context
  116. );
  117. BOOLEAN
  118. PdxCanonicalize(
  119. IN PSZ PathName,
  120. OUT PUNICODE_STRING CanonPath,
  121. IN PVOID Heap
  122. );
  123. //
  124. // Routines defined in coninit.c
  125. //
  126. NTSTATUS PsxInitializeSessionPort(IN ULONG UniqueId);
  127. //
  128. // Routines defined in conrqust.c
  129. //
  130. NTSTATUS SendConsoleRequest(IN OUT PSCREQUESTMSG Request);
  131. #endif // _PDXP_