- Update to r53061
[reactos.git] / dll / win32 / kernel32 / include / kernel32.h
old mode 100755 (executable)
new mode 100644 (file)
index 5966978..ec4109f
@@ -1,5 +1,36 @@
 #pragma once
 
+//
+// Kernel32 Filter IDs
+//
+#define kernel32file            200
+#define kernel32ver             201
+#define actctx                  202
+#define resource                203
+#define kernel32session         204
+
+
+#if DBG
+#define DEBUG_CHANNEL(ch) static ULONG gDebugChannel = ch;
+#else
+#define DEBUG_CHANNEL(ch)
+#endif
+
+#define TRACE(fmt, ...)         TRACE__(gDebugChannel, fmt, ##__VA_ARGS__)
+#define WARN(fmt, ...)          WARN__(gDebugChannel, fmt, ##__VA_ARGS__)
+#define FIXME(fmt, ...)         WARN__(gDebugChannel, fmt,## __VA_ARGS__)
+#define ERR(fmt, ...)           ERR__(gDebugChannel, fmt, ##__VA_ARGS__)
+
+#define STUB \
+  SetLastError(ERROR_CALL_NOT_IMPLEMENTED); \
+  DPRINT1("%s() is UNIMPLEMENTED!\n", __FUNCTION__)
+
+#define debugstr_a  
+#define debugstr_w
+#define wine_dbgstr_w  
+#define debugstr_guid
+
+#include "wine/unicode.h"
 #include "baseheap.h"
 
 #define BINARY_UNKNOWN (0)
@@ -31,7 +62,7 @@
 #endif
 
 #define IsConsoleHandle(h) \
-  (((((ULONG)h) & 0x10000003) == 0x3) ? TRUE : FALSE)
+  (((((ULONG_PTR)h) & 0x10000003) == 0x3) ? TRUE : FALSE)
 
 #define HANDLE_DETACHED_PROCESS    (HANDLE)-2
 #define HANDLE_CREATE_NEW_CONSOLE  (HANDLE)-3
@@ -40,9 +71,6 @@
 /* Undocumented CreateProcess flag */
 #define STARTF_SHELLPRIVATE         0x400
   
-#define SetLastErrorByStatus(__S__) \
- ((void)SetLastError(RtlNtStatusToDosError(__S__)))
-
 typedef struct _CODEPAGE_ENTRY
 {
    LIST_ENTRY Entry;
@@ -52,6 +80,8 @@ typedef struct _CODEPAGE_ENTRY
    CPTABLEINFO CodePageTable;
 } CODEPAGE_ENTRY, *PCODEPAGE_ENTRY;
 
+extern PBASE_STATIC_SERVER_DATA BaseStaticServerData;
+
 typedef
 DWORD
 (*WaitForInputIdleType)(
@@ -65,12 +95,19 @@ extern HANDLE hProcessHeap;
 extern HANDLE hBaseDir;
 extern HMODULE hCurrentModule;
 
-extern RTL_CRITICAL_SECTION DllLock;
+extern RTL_CRITICAL_SECTION BaseDllDirectoryLock;
 
-extern UNICODE_STRING DllDirectory;
+extern UNICODE_STRING BaseDllDirectory;
+extern UNICODE_STRING BaseDefaultPath;
+extern UNICODE_STRING BaseDefaultPathAppend;
+extern PLDR_DATA_TABLE_ENTRY BasepExeLdrEntry;
 
 extern LPTOP_LEVEL_EXCEPTION_FILTER GlobalTopLevelExceptionFilter;
 
+extern SYSTEM_BASIC_INFORMATION BaseCachedSysInfo;
+
+extern BOOLEAN BaseRunningInServerProcess;
+
 /* FUNCTION PROTOTYPES *******************************************************/
 
 BOOL WINAPI VerifyConsoleIoHandle(HANDLE Handle);
@@ -100,6 +137,12 @@ DWORD FilenameU2A_FitOrFail(LPSTR  DestA, INT destLen, PUNICODE_STRING SourceU);
 #define HeapAlloc RtlAllocateHeap
 #define HeapReAlloc RtlReAllocateHeap
 #define HeapFree RtlFreeHeap
+#define _lread  (_readfun)_hread
+
+PLARGE_INTEGER
+WINAPI
+BaseFormatTimeOut(OUT PLARGE_INTEGER Timeout,
+                  IN DWORD dwMilliseconds);
 
 POBJECT_ATTRIBUTES
 WINAPI
@@ -110,8 +153,8 @@ BasepConvertObjectAttributes(OUT POBJECT_ATTRIBUTES ObjectAttributes,
 NTSTATUS
 WINAPI
 BasepCreateStack(HANDLE hProcess,
-                 ULONG StackReserve,
-                 ULONG StackCommit,
+                 SIZE_T StackReserve,
+                 SIZE_T StackCommit,
                  PINITIAL_TEB InitialTeb);
                  
 VOID
@@ -163,17 +206,14 @@ BasepAnsiStringToHeapUnicodeString(IN LPCSTR AnsiString,
                                    
 PUNICODE_STRING
 WINAPI
-Basep8BitStringToCachedUnicodeString(IN LPCSTR String);
-
-NTSTATUS
-WINAPI
-Basep8BitStringToLiveUnicodeString(OUT PUNICODE_STRING UnicodeString,
-                                   IN LPCSTR String);
+Basep8BitStringToStaticUnicodeString(IN LPCSTR AnsiString);
 
-NTSTATUS
+BOOLEAN
 WINAPI
-Basep8BitStringToHeapUnicodeString(OUT PUNICODE_STRING UnicodeString,
-                                   IN LPCSTR String);
+Basep8BitStringToDynamicUnicodeString(OUT PUNICODE_STRING UnicodeString,
+                                      IN LPCSTR String);
+#define BasepUnicodeStringTo8BitString RtlUnicodeStringToAnsiString
 
 typedef NTSTATUS (NTAPI *PRTL_CONVERT_STRING)(IN PUNICODE_STRING UnicodeString,
                                               IN PANSI_STRING AnsiString,
@@ -187,6 +227,12 @@ BasepMapFile(IN LPCWSTR lpApplicationName,
              OUT PHANDLE hSection,
              IN PUNICODE_STRING ApplicationName);
 
+LPWSTR
+WINAPI
+BasepGetDllPath(LPWSTR FullPath,
+                PVOID Environment);
+
+
 PCODEPAGE_ENTRY FASTCALL
 IntGetCodePageEntry(UINT CodePage);
 
@@ -196,3 +242,10 @@ GetDllLoadPath(LPCWSTR lpModule);
 VOID
 WINAPI
 InitCommandLines(VOID);
+
+VOID
+WINAPI
+BaseSetLastNTError(IN NTSTATUS Status);
+
+/* FIXME */
+WCHAR WINAPI RtlAnsiCharToUnicodeChar(LPSTR *);