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.

135 lines
3.6 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // Windows CE/Win32 compatibility definitions.
  4. //
  5. // Copyright (C) Microsoft Corporation, 2001.
  6. //
  7. //----------------------------------------------------------------------------
  8. #ifndef __WCECOMPAT_H__
  9. #define __WCECOMPAT_H__
  10. #ifdef _WIN32_WCE
  11. #ifndef DBG_COMMAND_EXCEPTION
  12. #define DBG_COMMAND_EXCEPTION ((LONG)0x40010009L)
  13. #endif
  14. #ifndef STDMETHODV
  15. #define STDMETHODV(Method) STDMETHOD(Method)
  16. #endif
  17. #ifndef INLINE
  18. #define INLINE __inline
  19. #endif
  20. #ifndef FORCEINLINE
  21. #define FORCEINLINE INLINE
  22. #endif
  23. #ifndef TH32CS_SNAPMODULE32
  24. #define TH32CS_SNAPMODULE32 0
  25. #endif
  26. #ifndef INVALID_SET_FILE_POINTER
  27. #define INVALID_SET_FILE_POINTER 0xffffffff
  28. #endif
  29. #define CREATE_UNICODE_ENVIRONMENT 0x00000400
  30. #define STACK_SIZE_PARAM_IS_A_RESERVATION 0x00010000
  31. typedef struct _EXCEPTION_RECORD32 {
  32. DWORD ExceptionCode;
  33. DWORD ExceptionFlags;
  34. DWORD ExceptionRecord;
  35. DWORD ExceptionAddress;
  36. DWORD NumberParameters;
  37. DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
  38. } EXCEPTION_RECORD32, *PEXCEPTION_RECORD32;
  39. typedef struct _EXCEPTION_RECORD64 {
  40. DWORD ExceptionCode;
  41. DWORD ExceptionFlags;
  42. DWORD64 ExceptionRecord;
  43. DWORD64 ExceptionAddress;
  44. DWORD NumberParameters;
  45. DWORD __unusedAlignment;
  46. DWORD64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
  47. } EXCEPTION_RECORD64, *PEXCEPTION_RECORD64;
  48. typedef LONG NTSTATUS;
  49. #define NT_SUCCESS(Status) ((Status) >= 0)
  50. typedef struct _STRING {
  51. USHORT Length;
  52. USHORT MaximumLength;
  53. PCHAR Buffer;
  54. } STRING, ANSI_STRING, *PSTRING, *PANSI_STRING;
  55. typedef struct _UNICODE_STRING {
  56. USHORT Length;
  57. USHORT MaximumLength;
  58. PWSTR Buffer;
  59. } UNICODE_STRING, *PUNICODE_STRING;
  60. typedef const UNICODE_STRING* PCUNICODE_STRING;
  61. typedef const ANSI_STRING* PCANSI_STRING;
  62. typedef struct _OBJECT_ATTRIBUTES {
  63. ULONG Length;
  64. HANDLE RootDirectory;
  65. PUNICODE_STRING ObjectName;
  66. ULONG Attributes;
  67. PVOID SecurityDescriptor; // Points to type SECURITY_DESCRIPTOR
  68. PVOID SecurityQualityOfService; // Points to type SECURITY_QUALITY_OF_SERVICE
  69. } OBJECT_ATTRIBUTES;
  70. typedef OBJECT_ATTRIBUTES *POBJECT_ATTRIBUTES;
  71. typedef struct _CLIENT_ID {
  72. HANDLE UniqueProcess;
  73. HANDLE UniqueThread;
  74. } CLIENT_ID;
  75. typedef CLIENT_ID *PCLIENT_ID;
  76. #define WSA_FLAG_OVERLAPPED 0
  77. #define WSA_IO_PENDING 0
  78. typedef OVERLAPPED WSAOVERLAPPED;
  79. typedef WSAOVERLAPPED *LPWSAOVERLAPPED;
  80. #define OpenThread(dwDesiredAccess, bInheritHandle, dwThreadId) \
  81. ((HANDLE)(dwThreadId))
  82. #define IsProcessorFeaturePresent(ProcessorFeature) FALSE
  83. #define VirtualQueryEx(hProcess, lpAddress, lpBuffer, dwLength) \
  84. (SetLastError(ERROR_CALL_NOT_IMPLEMENTED), 0)
  85. #define CancelIo(Handle) \
  86. (SetLastError(ERROR_CALL_NOT_IMPLEMENTED), FALSE)
  87. #define GetOverlappedResult(hFile, lpOverlapped, lpNumberOfBytesTransferred, bWait) \
  88. (SetLastError(ERROR_CALL_NOT_IMPLEMENTED), FALSE)
  89. #define WSASocket(af, type, protocol, lpProtocolInfo, g, dwFlags) \
  90. socket(af, type, protocol)
  91. #define WSAGetOverlappedResult(hFile, lpOverlapped, lpNumberOfBytesTransferred, bWait, Flags) \
  92. (SetLastError(ERROR_CALL_NOT_IMPLEMENTED), FALSE)
  93. INLINE
  94. void *
  95. ULongToHandle(
  96. const unsigned long h
  97. )
  98. {
  99. return((void *) (UINT_PTR) h );
  100. }
  101. #define UlongToHandle(ul) ULongToHandle(ul)
  102. #else
  103. #ifndef VER_PLATFORM_WIN32_CE
  104. #define VER_PLATFORM_WIN32_CE 3
  105. #endif
  106. #endif // #ifdef _WIN32_WCE
  107. #endif // #ifndef __WCECOMPAT_H__