Added version information.
[wine] / dlls / ntdll / ntdll_misc.h
1 /*
2  * Copyright 2000 Juergen Schmied
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef __WINE_NTDLL_MISC_H
20 #define __WINE_NTDLL_MISC_H
21
22 #include "winnt.h"
23 #include "winternl.h"
24 #include "module.h"
25 #include "thread.h"
26 #include "wine/server.h"
27
28 /* debug helper */
29 extern LPCSTR debugstr_us( const UNICODE_STRING *str );
30 extern void dump_ObjectAttributes (const OBJECT_ATTRIBUTES *ObjectAttributes);
31
32 extern void NTDLL_get_server_timeout( abs_time_t *when, const LARGE_INTEGER *timeout );
33
34 /* module handling */
35 extern WINE_MODREF *MODULE_AllocModRef( HMODULE hModule, LPCSTR filename );
36
37 extern FARPROC RELAY_GetProcAddress( HMODULE module, IMAGE_EXPORT_DIRECTORY *exports,
38                                      DWORD exp_size, FARPROC proc, const char *user );
39 extern FARPROC SNOOP_GetProcAddress( HMODULE hmod, IMAGE_EXPORT_DIRECTORY *exports, DWORD exp_size,
40                                      FARPROC origfun, DWORD ordinal );
41 extern void RELAY_SetupDLL( const char *module );
42
43 typedef struct RTL_DRIVE_LETTER_CURDIR
44 {
45     USHORT              Flags;
46     USHORT              Length;
47     ULONG               TimeStamp;
48     UNICODE_STRING      DosPath;
49 } RTL_DRIVE_LETTER_CURDIR, *PRTL_DRIVE_LETTER_CURDIR;
50
51 typedef struct _RTL_USER_PROCESS_PARAMETERS
52 {
53     ULONG               AllocationSize;
54     ULONG               Size;
55     ULONG               Flags;
56     ULONG               DebugFlags;
57     HANDLE              hConsole;
58     ULONG               ProcessGroup;
59     HANDLE              hStdInput;
60     HANDLE              hStdOutput;
61     HANDLE              hStdError;
62     UNICODE_STRING      CurrentDirectoryName;
63     HANDLE              CurrentDirectoryHandle;
64     UNICODE_STRING      DllPath;
65     UNICODE_STRING      ImagePathName;
66     UNICODE_STRING      CommandLine;
67     PWSTR               Environment;
68     ULONG               dwX;
69     ULONG               dwY;
70     ULONG               dwXSize;
71     ULONG               dwYSize;
72     ULONG               dwXCountChars;
73     ULONG               dwYCountChars;
74     ULONG               dwFillAttribute;
75     ULONG               dwFlags;
76     ULONG               wShowWindow;
77     UNICODE_STRING      WindowTitle;
78     UNICODE_STRING      DesktopInfo;
79     UNICODE_STRING      ShellInfo;
80     UNICODE_STRING      RuntimeInfo;
81     RTL_DRIVE_LETTER_CURDIR DLCurrentDirectory[0x20];
82 } RTL_USER_PROCESS_PARAMETERS, *PRTL_USER_PROCESS_PARAMETERS;
83
84 static inline HANDLE ntdll_get_process_heap(void)
85 {
86     HANDLE *pdb = (HANDLE *)NtCurrentTeb()->process;
87     return pdb[0x18 / sizeof(HANDLE)];  /* get dword at offset 0x18 in pdb */
88 }
89
90 /* FIXME: this should be part of PEB, once it's defined */
91 extern RTL_USER_PROCESS_PARAMETERS process_pmts;
92 BOOL build_initial_environment(void);
93
94 static inline RTL_USER_PROCESS_PARAMETERS* ntdll_get_process_pmts(void)
95 {
96     return &process_pmts;
97 }
98 #endif