1
0
mirror of https://github.com/UzixLS/KernelEx.git synced 2025-07-19 07:21:20 +03:00

import KernelEx-4.5-Beta1

This commit is contained in:
UzixLS
2018-11-03 16:21:13 +03:00
parent d6aad6c6c5
commit 09929b2b7d
392 changed files with 17832 additions and 2491 deletions

62
common/kexcoresdk.h Normal file → Executable file
View File

@ -113,7 +113,20 @@ _KEXCOREIMP unsigned long kexGetKEXVersion();
_KEXCOREIMP int kexIsDebugCore();
/** kexDebugPrint - output debug information
/** DBGPRINTF - convenience macro for including debug messages only in debugs.
*
* Sample usage: DBGPRINTF(("This is a test %d %s\n", 1, "ttt"));
*/
#ifndef KEXCORE_EXPORTS
#ifndef _DEBUG
#define DBGPRINTF(x) do { } while (0)
#else
#define DBGPRINTF(x) kexDebugPrint x
#endif
#endif
/** kexDebugPrint - output debug message
*
* Parameters are compatible with printf command,
* maximum output length is limited to 256 bytes.
@ -149,30 +162,67 @@ _KEXCOREIMP HANDLE kexOpenThread(DWORD dwDesiredAccess, BOOL bInheritHandle, DWO
_KEXCOREIMP BOOL kexAreExtensionsEnabled();
/** KernelEx resolver flags. */
#define KRF_KEX_DISABLE 1 /* disable KernelEx API extensions for this module */
#define KRF_OVERRIDE_PROC_MOD 2 /* use same configuration and flags for all modules in a process */
#define KRF_LOG_APIS 4 /* enable API tracing */
#define KRF_NO_INHERIT 16 /* don't inherit configuration and flags to child processes */
#define KRF_VALID_FLAG 128 /* denotes that flags field is valid */
/** kexGetModuleSettings - Retrieve per module settings.
*
* @param module Module path.
* @param conf_name Receives configuration name, has to be at least 256 bytes long.
* @param ldr_flags Receives flags.
* @param conf_name Receives configuration name, buffer has to be at least 256 bytes long.
* @param mod_flags Receives resolver flags.
*/
_KEXCOREIMP void kexGetModuleSettings(const char* module,
char* conf_name, BYTE* ldr_flags);
char* conf_name, DWORD* mod_flags);
/** kexSetModuleSettings - Set per module settings.
*
* @param module Module path.
* @param conf_name Configuration name to be set for the module.
* @param ldr_flags Flags to be set for the module.
* @param mod_flags Resolver flags to be set for the module.
*/
_KEXCOREIMP void kexSetModuleSettings(const char* module,
const char* conf_name, BYTE ldr_flags);
const char* conf_name, DWORD mod_flags);
/** kexFlushAppSettings - Reloads all module settings from registy. */
_KEXCOREIMP void kexFlushAppSettings(void);
/** kexPsAllocIndex - Reserve process storage entry.
*
* @return Index to access process storage.
*/
_KEXCOREIMP int kexPsAllocIndex(void);
/** kexPsGetValue - Get process value associated with tag.
*
* @param index Index allocated with kexPsAllocIndex.
*/
_KEXCOREIMP void* kexPsGetValue(int index);
/** kexPsSetValue - Set process value associated with tag.
*
* @param index Index allocated with kexPsAllocIndex.
* @param value Any data, pass zero to free storage associated with tag.
*/
_KEXCOREIMP int kexPsSetValue(int index, void* value);
/** kexGetK32Lock - obtain pointer to Kernel32 lock object.
*
* @return Pointer to Kernel32 lock object.
*/
_KEXCOREIMP void* kexGetK32Lock();
#ifdef __cplusplus
} /* extern "C" */
#endif