kernel_private.h 3.25 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/*
 * Kernel32 undocumented and private functions definition
 *
 * Copyright 2003 Eric Pouech
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * 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 22 23
 */

#ifndef __WINE_KERNEL_PRIVATE_H
#define __WINE_KERNEL_PRIVATE_H

24 25
#include "wine/server.h"

26
HANDLE  WINAPI OpenConsoleW(LPCWSTR, DWORD, BOOL, DWORD);
27 28 29 30
BOOL    WINAPI VerifyConsoleIoHandle(HANDLE);
HANDLE  WINAPI DuplicateConsoleHandle(HANDLE, DWORD, BOOL, DWORD);
BOOL    WINAPI CloseConsoleHandle(HANDLE handle);
HANDLE  WINAPI GetConsoleInputWaitHandle(void);
31
BOOL           CONSOLE_Init(RTL_USER_PROCESS_PARAMETERS *params);
32
BOOL           CONSOLE_Exit(void);
33 34 35

static inline BOOL is_console_handle(HANDLE h)
{
36
    return h != INVALID_HANDLE_VALUE && ((UINT_PTR)h & 3) == 3;
37 38 39 40 41
}

/* map a real wineserver handle onto a kernel32 console handle */
static inline HANDLE console_handle_map(HANDLE h)
{
42
    return h != INVALID_HANDLE_VALUE ? (HANDLE)((UINT_PTR)h ^ 3) : INVALID_HANDLE_VALUE;
43 44 45
}

/* map a kernel32 console handle onto a real wineserver handle */
46
static inline obj_handle_t console_handle_unmap(HANDLE h)
47
{
48
    return wine_server_obj_handle( h != INVALID_HANDLE_VALUE ? (HANDLE)((UINT_PTR)h ^ 3) : INVALID_HANDLE_VALUE );
49 50
}

51 52 53 54
/* Some Wine specific values for Console inheritance (params->ConsoleHandle) */
#define KERNEL32_CONSOLE_ALLOC          ((HANDLE)1)
#define KERNEL32_CONSOLE_SHELL          ((HANDLE)2)

55 56
extern HMODULE kernel32_handle;

57 58
extern const WCHAR *DIR_Windows;
extern const WCHAR *DIR_System;
59
extern const WCHAR *DIR_SysWow64;
60

61
extern void FILE_SetDosError(void);
62 63
extern WCHAR *FILE_name_AtoW( LPCSTR name, BOOL alloc );
extern DWORD FILE_name_WtoA( LPCWSTR src, INT srclen, LPSTR dest, INT destlen );
64

65
/* return values for MODULE_GetBinaryType */
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
enum binary_type
{
    BINARY_UNKNOWN = 0,
    BINARY_PE,
    BINARY_WIN16,
    BINARY_OS216,
    BINARY_DOS,
    BINARY_UNIX_EXE,
    BINARY_UNIX_LIB
};

#define BINARY_FLAG_DLL   0x01
#define BINARY_FLAG_64BIT 0x02

struct binary_info
{
    enum binary_type type;
    DWORD            flags;
    void            *res_start;
    void            *res_end;
};
87 88

/* module.c */
89
extern WCHAR *MODULE_get_dll_load_path( LPCWSTR module );
90
extern void MODULE_get_binary_info( HANDLE hfile, struct binary_info *info );
91

92 93
extern BOOL NLS_IsUnicodeOnlyLcid(LCID);

94 95 96 97 98 99 100 101 102 103 104 105 106
/* environ.c */
extern void ENV_CopyStartupInformation(void);

/* computername.c */
extern void COMPUTERNAME_Init(void);

/* locale.c */
extern void LOCALE_Init(void);
extern void LOCALE_InitRegistry(void);

/* oldconfig.c */
extern void convert_old_config(void);

107 108 109
/* returns directory handle for named objects */
extern HANDLE get_BaseNamedObjects_handle(void);

110
#endif