Reactos
1/*
2 * Kernelbase internal definitions
3 *
4 * Copyright 2019 Alexandre Julliard
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#ifndef __WINE_KERNELBASE_H
22#define __WINE_KERNELBASE_H
23
24#include "windef.h"
25#include "winbase.h"
26
27#ifdef __REACTOS__
28#include "synchacks.h"
29#endif
30
31
32struct pseudo_console
33{
34 HANDLE signal;
35 HANDLE reference;
36 HANDLE process;
37};
38
39extern WCHAR *file_name_AtoW( LPCSTR name, BOOL alloc );
40extern DWORD file_name_WtoA( LPCWSTR src, INT srclen, LPSTR dest, INT destlen );
41extern void init_global_data(void);
42extern void init_startup_info( RTL_USER_PROCESS_PARAMETERS *params );
43extern void init_locale( HMODULE module );
44extern void init_console(void);
45
46extern const WCHAR windows_dir[];
47extern const WCHAR system_dir[];
48
49static const BOOL is_win64 = (sizeof(void *) > sizeof(int));
50extern BOOL is_wow64;
51
52static inline BOOL set_ntstatus( NTSTATUS status )
53{
54 if (status) SetLastError( RtlNtStatusToDosError( status ));
55 return !status;
56}
57
58/* make the kernel32 names available */
59#define HeapAlloc(heap, flags, size) RtlAllocateHeap(heap, flags, size)
60#define HeapReAlloc(heap, flags, ptr, size) RtlReAllocateHeap(heap, flags, ptr, size)
61#define HeapFree(heap, flags, ptr) RtlFreeHeap(heap, flags, ptr)
62
63#endif /* __WINE_KERNELBASE_H */