2002-03-10 00:29:33 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2000 Juergen Schmied
|
|
|
|
*
|
|
|
|
* 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
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-03-10 00:29:33 +01:00
|
|
|
*/
|
|
|
|
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
#ifndef __WINE_NTDLL_MISC_H
|
|
|
|
#define __WINE_NTDLL_MISC_H
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2007-10-20 16:56:44 +02:00
|
|
|
#include <sys/types.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
|
|
|
|
#include "windef.h"
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
#include "winnt.h"
|
2002-09-13 00:07:02 +02:00
|
|
|
#include "winternl.h"
|
2020-05-14 15:17:06 +02:00
|
|
|
#include "unixlib.h"
|
2019-05-14 12:30:46 +02:00
|
|
|
#include "wine/asm.h"
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
|
2020-04-11 07:16:26 +02:00
|
|
|
#define DECLARE_CRITICAL_SECTION(cs) \
|
|
|
|
static RTL_CRITICAL_SECTION cs; \
|
|
|
|
static RTL_CRITICAL_SECTION_DEBUG cs##_debug = \
|
|
|
|
{ 0, 0, &cs, { &cs##_debug.ProcessLocksList, &cs##_debug.ProcessLocksList }, \
|
|
|
|
0, 0, { (DWORD_PTR)(__FILE__ ": " # cs) }}; \
|
|
|
|
static RTL_CRITICAL_SECTION cs = { &cs##_debug, -1, 0, 0, 0, 0 };
|
|
|
|
|
2005-07-14 14:33:30 +02:00
|
|
|
#define MAX_NT_PATH_LENGTH 277
|
|
|
|
|
2019-10-28 21:07:53 +01:00
|
|
|
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
|
2013-01-08 14:00:06 +01:00
|
|
|
static const UINT_PTR page_size = 0x1000;
|
|
|
|
#else
|
|
|
|
extern UINT_PTR page_size DECLSPEC_HIDDEN;
|
|
|
|
#endif
|
|
|
|
|
2005-11-02 21:54:12 +01:00
|
|
|
/* exceptions */
|
2011-04-21 10:32:31 +02:00
|
|
|
extern LONG call_vectored_handlers( EXCEPTION_RECORD *rec, CONTEXT *context ) DECLSPEC_HIDDEN;
|
2020-04-16 00:06:40 +02:00
|
|
|
extern void DECLSPEC_NORETURN raise_status( NTSTATUS status, EXCEPTION_RECORD *rec ) DECLSPEC_HIDDEN;
|
2018-10-09 14:42:30 +02:00
|
|
|
extern LONG WINAPI call_unhandled_exception_filter( PEXCEPTION_POINTERS eptr ) DECLSPEC_HIDDEN;
|
2005-05-07 20:10:30 +02:00
|
|
|
|
2019-08-19 13:21:47 +02:00
|
|
|
#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
|
2020-04-24 03:17:31 +02:00
|
|
|
extern RUNTIME_FUNCTION *lookup_function_info( ULONG_PTR pc, ULONG_PTR *base, LDR_DATA_TABLE_ENTRY **module ) DECLSPEC_HIDDEN;
|
2019-08-19 13:21:47 +02:00
|
|
|
#endif
|
|
|
|
|
2009-02-16 11:46:44 +01:00
|
|
|
/* debug helpers */
|
2011-04-21 10:32:31 +02:00
|
|
|
extern LPCSTR debugstr_us( const UNICODE_STRING *str ) DECLSPEC_HIDDEN;
|
2021-02-05 10:21:30 +01:00
|
|
|
extern const char *debugstr_exception_code( DWORD code ) DECLSPEC_HIDDEN;
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
|
2003-11-04 05:50:18 +01:00
|
|
|
/* init routines */
|
2019-11-07 16:54:31 +01:00
|
|
|
extern void version_init(void) DECLSPEC_HIDDEN;
|
2011-04-21 10:32:31 +02:00
|
|
|
extern void debug_init(void) DECLSPEC_HIDDEN;
|
|
|
|
extern void actctx_init(void) DECLSPEC_HIDDEN;
|
|
|
|
extern void heap_set_debug_flags( HANDLE handle ) DECLSPEC_HIDDEN;
|
2019-11-19 10:08:27 +01:00
|
|
|
extern void init_locale( HMODULE module ) DECLSPEC_HIDDEN;
|
2020-06-29 12:10:58 +02:00
|
|
|
extern void init_user_process_params(void) DECLSPEC_HIDDEN;
|
2020-08-20 15:27:30 +02:00
|
|
|
extern void CDECL DECLSPEC_NORETURN signal_start_thread( CONTEXT *ctx ) DECLSPEC_HIDDEN;
|
2003-03-31 03:37:04 +02:00
|
|
|
|
2003-11-06 01:08:05 +01:00
|
|
|
/* server support */
|
2013-12-09 10:34:53 +01:00
|
|
|
extern BOOL is_wow64 DECLSPEC_HIDDEN;
|
2007-10-25 20:09:54 +02:00
|
|
|
|
2003-03-07 00:41:37 +01:00
|
|
|
/* module handling */
|
2013-12-23 18:16:51 +01:00
|
|
|
extern LIST_ENTRY tls_links DECLSPEC_HIDDEN;
|
2004-06-15 02:47:00 +02:00
|
|
|
extern FARPROC RELAY_GetProcAddress( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports,
|
2011-04-21 10:32:31 +02:00
|
|
|
DWORD exp_size, FARPROC proc, DWORD ordinal, const WCHAR *user ) DECLSPEC_HIDDEN;
|
2004-06-15 02:47:00 +02:00
|
|
|
extern FARPROC SNOOP_GetProcAddress( HMODULE hmod, const IMAGE_EXPORT_DIRECTORY *exports, DWORD exp_size,
|
2011-04-21 10:32:31 +02:00
|
|
|
FARPROC origfun, DWORD ordinal, const WCHAR *user ) DECLSPEC_HIDDEN;
|
|
|
|
extern void RELAY_SetupDLL( HMODULE hmod ) DECLSPEC_HIDDEN;
|
|
|
|
extern void SNOOP_SetupDLL( HMODULE hmod ) DECLSPEC_HIDDEN;
|
2020-05-21 12:40:08 +02:00
|
|
|
extern const WCHAR windows_dir[] DECLSPEC_HIDDEN;
|
2018-02-19 19:38:29 +01:00
|
|
|
extern const WCHAR system_dir[] DECLSPEC_HIDDEN;
|
2019-10-22 10:15:28 +02:00
|
|
|
extern const WCHAR syswow64_dir[] DECLSPEC_HIDDEN;
|
2003-04-08 01:27:54 +02:00
|
|
|
|
2020-09-01 12:48:04 +02:00
|
|
|
extern void (FASTCALL *pBaseThreadInitThunk)(DWORD,LPTHREAD_START_ROUTINE,void *) DECLSPEC_HIDDEN;
|
2020-05-14 15:17:06 +02:00
|
|
|
extern const struct unix_funcs *unix_funcs DECLSPEC_HIDDEN;
|
2008-02-12 22:39:19 +01:00
|
|
|
|
2011-04-21 10:32:31 +02:00
|
|
|
extern struct _KUSER_SHARED_DATA *user_shared_data DECLSPEC_HIDDEN;
|
2003-12-08 22:58:55 +01:00
|
|
|
|
2011-04-21 10:32:31 +02:00
|
|
|
extern int CDECL NTDLL__vsnprintf( char *str, SIZE_T len, const char *format, __ms_va_list args ) DECLSPEC_HIDDEN;
|
|
|
|
extern int CDECL NTDLL__vsnwprintf( WCHAR *str, SIZE_T len, const WCHAR *format, __ms_va_list args ) DECLSPEC_HIDDEN;
|
2009-01-28 19:17:34 +01:00
|
|
|
|
2006-02-22 16:30:05 +01:00
|
|
|
/* load order */
|
|
|
|
|
|
|
|
enum loadorder
|
|
|
|
{
|
|
|
|
LO_INVALID,
|
|
|
|
LO_DISABLED,
|
|
|
|
LO_NATIVE,
|
|
|
|
LO_BUILTIN,
|
|
|
|
LO_NATIVE_BUILTIN, /* native then builtin */
|
|
|
|
LO_BUILTIN_NATIVE, /* builtin then native */
|
|
|
|
LO_DEFAULT /* nothing specified, use default strategy */
|
|
|
|
};
|
|
|
|
|
2019-02-08 22:07:54 +01:00
|
|
|
extern enum loadorder get_load_order( const WCHAR *app_name, const UNICODE_STRING *nt_name ) DECLSPEC_HIDDEN;
|
2006-02-22 16:30:05 +01:00
|
|
|
|
2020-07-24 11:24:31 +02:00
|
|
|
#ifndef _WIN64
|
|
|
|
static inline TEB64 *NtCurrentTeb64(void) { return (TEB64 *)NtCurrentTeb()->GdiBatchCount; }
|
|
|
|
#endif
|
|
|
|
|
2013-07-20 07:15:34 +02:00
|
|
|
#define HASH_STRING_ALGORITHM_DEFAULT 0
|
|
|
|
#define HASH_STRING_ALGORITHM_X65599 1
|
|
|
|
#define HASH_STRING_ALGORITHM_INVALID 0xffffffff
|
|
|
|
|
2013-08-02 13:45:46 +02:00
|
|
|
NTSTATUS WINAPI RtlHashUnicodeString(PCUNICODE_STRING,BOOLEAN,ULONG,ULONG*);
|
|
|
|
|
2020-03-27 13:40:37 +01:00
|
|
|
/* convert from straight ASCII to Unicode without depending on the current codepage */
|
|
|
|
static inline void ascii_to_unicode( WCHAR *dst, const char *src, size_t len )
|
|
|
|
{
|
|
|
|
while (len--) *dst++ = (unsigned char)*src++;
|
|
|
|
}
|
|
|
|
|
2020-10-06 12:04:47 +02:00
|
|
|
/* FLS data */
|
|
|
|
extern void init_global_fls_data(void) DECLSPEC_HIDDEN;
|
2020-10-06 12:04:49 +02:00
|
|
|
extern TEB_FLS_DATA *fls_alloc_data(void) DECLSPEC_HIDDEN;
|
2020-10-06 12:04:47 +02:00
|
|
|
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
#endif
|