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:
23
apilibs/kexbasen/common.h
Normal file → Executable file
23
apilibs/kexbasen/common.h
Normal file → Executable file
@ -25,6 +25,10 @@
|
||||
#include <windows.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef int __stdcall STUB(void);
|
||||
typedef int __stdcall FWDPROC(void);
|
||||
|
||||
@ -34,14 +38,17 @@ int WINAPI CommonUnimpStub(void);
|
||||
char* file_fixWprefix(char* in);
|
||||
void fatal_error(const char* msg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define UNIMPL_FUNC(name,params) \
|
||||
__asm__( ".text\n" \
|
||||
".globl _" #name "_stub@0\n" \
|
||||
"_" #name "_new@0:\n\t" \
|
||||
"xor %eax, %eax\n\t" \
|
||||
"movb $" #params ", %cl\n\t" \
|
||||
#define UNIMPL_FUNC(name,params) \
|
||||
__asm__( ".text\n" \
|
||||
".globl _" #name "_stub@0\n" \
|
||||
"_" #name "_stub@0:\n\t" \
|
||||
"xor %eax, %eax\n\t" \
|
||||
"movb $" #params ", %cl\n\t" \
|
||||
"jmp _CommonUnimpStub@0\n\t" \
|
||||
)
|
||||
#else
|
||||
@ -61,7 +68,7 @@ void fatal_error(const char* msg);
|
||||
const WCHAR* p; \
|
||||
int c; \
|
||||
for (p = str##W ; *p ; p++); \
|
||||
c = (int) p - (int) str##W; \
|
||||
c = p - str##W + 1; \
|
||||
c *= acp_mcs; \
|
||||
str##A = (char*) alloca(c); \
|
||||
WtoA(str, c)
|
||||
@ -94,7 +101,7 @@ void fatal_error(const char* msg);
|
||||
const WCHAR* p; \
|
||||
int c; \
|
||||
for (p = str##W ; *p ; p++); \
|
||||
c = (int) p - (int) str##W; \
|
||||
c = p - str##W + 1; \
|
||||
c *= acp_mcs; \
|
||||
str##A = (char*) alloca(c); \
|
||||
file_WtoA(str, c); \
|
||||
|
Reference in New Issue
Block a user