mirror of
https://github.com/UzixLS/KernelEx.git
synced 2025-07-19 07:21:20 +03:00
import KernelEx-4.0-RC1
This commit is contained in:
77
apilibs/kexbasen/main.c
Normal file
77
apilibs/kexbasen/main.c
Normal file
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* KernelEx
|
||||
* Copyright (C) 2008, Xeno86
|
||||
*
|
||||
* This file is part of KernelEx source code.
|
||||
*
|
||||
* KernelEx is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published
|
||||
* by the Free Software Foundation; version 2 of the License.
|
||||
*
|
||||
* KernelEx 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNU Make; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "unifwd.h"
|
||||
#include "kexcoresdk.h"
|
||||
#include "kernel32/_kernel32_apilist.h"
|
||||
#include "gdi32/_gdi32_apilist.h"
|
||||
#include "user32/_user32_apilist.h"
|
||||
#include "advapi32/_advapi32_apilist.h"
|
||||
#include "comdlg32/_comdlg32_apilist.h"
|
||||
#include "shell32/_shell32_apilist.h"
|
||||
//#include "/__apilist.h"
|
||||
|
||||
static apilib_api_table api_table[7];
|
||||
|
||||
static void fill_apitable()
|
||||
{
|
||||
api_table[0] = apitable_kernel32;
|
||||
api_table[1] = apitable_gdi32;
|
||||
api_table[2] = apitable_user32;
|
||||
api_table[3] = apitable_advapi32;
|
||||
api_table[4] = apitable_comdlg32;
|
||||
api_table[5] = apitable_shell32;
|
||||
//last entry is null terminator
|
||||
}
|
||||
|
||||
extern "C"
|
||||
__declspec(dllexport)
|
||||
const apilib_api_table* get_api_table()
|
||||
{
|
||||
fill_apitable();
|
||||
//check if unicows is available
|
||||
if (!unifwd_init())
|
||||
return NULL;
|
||||
return api_table;
|
||||
}
|
||||
|
||||
BOOL init()
|
||||
{
|
||||
return common_init() && init_kernel32() && init_gdi32() && init_user32() && init_advapi32() && init_comdlg32() && init_shell32();
|
||||
}
|
||||
|
||||
BOOL APIENTRY DllMain(HINSTANCE instance, DWORD reason, BOOL load_static)
|
||||
{
|
||||
switch (reason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
// kexDebugPrint("KernelEx Base Non-shared library reporting in action!\n");
|
||||
DisableThreadLibraryCalls(instance);
|
||||
if (!init())
|
||||
return FALSE;
|
||||
break;
|
||||
case DLL_PROCESS_DETACH:
|
||||
// kexDebugPrint("KernelEx Base Non-shared library signing off!\n");
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
Reference in New Issue
Block a user