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

import KernelEx-4.0-Final

This commit is contained in:
UzixLS
2018-11-03 16:20:02 +03:00
parent 339353cce8
commit 30df122aba
339 changed files with 11011 additions and 1945 deletions

0
apilibs/kexbasen/advapi32/_advapi32_apilist.c Executable file → Normal file
View File

1
apilibs/kexbasen/advapi32/_advapi32_apilist.h Executable file → Normal file
View File

@ -22,7 +22,6 @@
#ifndef _ADVAPI32_APILIST_H
#define _ADVAPI32_APILIST_H
#include "auxdecl.h"
#include "kexcoresdk.h"
BOOL init_advapi32();

0
apilibs/kexbasen/advapi32/uniadvapi32.c Executable file → Normal file
View File

View File

@ -1,132 +0,0 @@
/* This file contains required declarations missing from MINGW and MSVC6 without PSDK */
#ifndef __AUXDECL_H
#define __AUXDECL_H
#include <windows.h>
/* declarations for MSVC6 without PSDK */
#if defined (_MSC_VER) && (WINVER < 0x0500)
#define VER_MINORVERSION 0x0000001
#define VER_MAJORVERSION 0x0000002
#define VER_BUILDNUMBER 0x0000004
#define VER_PLATFORMID 0x0000008
#define VER_SERVICEPACKMINOR 0x0000010
#define VER_SERVICEPACKMAJOR 0x0000020
#define VER_SUITENAME 0x0000040
#define VER_PRODUCT_TYPE 0x0000080
#define VER_EQUAL 1
#define VER_GREATER 2
#define VER_GREATER_EQUAL 3
#define VER_LESS 4
#define VER_LESS_EQUAL 5
#define VER_AND 6
#define VER_OR 7
#define VER_NT_WORKSTATION 1
#define VER_NT_DOMAIN_CONTROLLER 2
#define VER_NT_SERVER 3
#define VER_SUITE_SMALLBUSINESS 1
#define VER_SUITE_ENTERPRISE 2
#define VER_SUITE_BACKOFFICE 4
#define VER_SUITE_TERMINAL 16
#define VER_SUITE_SMALLBUSINESS_RESTRICTED 32
#define VER_SUITE_EMBEDDEDNT 64
#define VER_SUITE_DATACENTER 128
#define VER_SUITE_SINGLEUSERTS 256
#define VER_SUITE_PERSONAL 512
#define VER_SUITE_BLADE 1024
#define VER_SUITE_STORAGE_SERVER 8192
#define VER_SUITE_COMPUTE_SERVER 16384
#define OSVERSIONINFOEXA __OSVERSIONINFOEXA
#define POSVERSIONINFOEXA __POSVERSIONINFOEXA
#define LPOSVERSIONINFOEXA __LPOSVERSIONINFOEXA
#define OSVERSIONINFOEXW __OSVERSIONINFOEXW
#define POSVERSIONINFOEXW __POSVERSIONINFOEXW
#define LPOSVERSIONINFOEXW __LPOSVERSIONINFOEXW
typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
CHAR szCSDVersion[128];
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
} __OSVERSIONINFOEXA, *__POSVERSIONINFOEXA, *__LPOSVERSIONINFOEXA;
typedef struct {
DWORD dwOSVersionInfoSize;
DWORD dwMajorVersion;
DWORD dwMinorVersion;
DWORD dwBuildNumber;
DWORD dwPlatformId;
WCHAR szCSDVersion[128];
WORD wServicePackMajor;
WORD wServicePackMinor;
WORD wSuiteMask;
BYTE wProductType;
BYTE wReserved;
} __OSVERSIONINFOEXW, *__POSVERSIONINFOEXW, *__LPOSVERSIONINFOEXW;
typedef long LONG_PTR;
typedef BOOL (CALLBACK *UILANGUAGE_ENUMPROCA)(LPSTR, LONG_PTR);
typedef BOOL (CALLBACK *UILANGUAGE_ENUMPROCW)(LPWSTR, LONG_PTR);
#define MEMORYSTATUSEX __MEMORYSTATUSEX
#define PMEMORYSTATUSEX __PMEMORYSTATUSEX
#define LPMEMORYSTATUSEX __LPMEMORYSTATUSEX
typedef struct
{
DWORD dwLength;
DWORD dwMemoryLoad;
DWORDLONG ullTotalPhys;
DWORDLONG ullAvailPhys;
DWORDLONG ullTotalPageFile;
DWORDLONG ullAvailPageFile;
DWORDLONG ullTotalVirtual;
DWORDLONG ullAvailVirtual;
DWORDLONG ullAvailExtendedVirtual;
} __MEMORYSTATUSEX, *__PMEMORYSTATUSEX, *__LPMEMORYSTATUSEX;
typedef enum {
SHGFP_TYPE_CURRENT = 0,
SHGFP_TYPE_DEFAULT = 1,
} SHGFP_TYPE;
#define GA_ROOT 2
typedef void *LPPRINTDLGEX;
EXTERN_C int WINAPI GetRandomRgn(HDC hdc, HRGN hrgn, INT iNum);
EXTERN_C HRESULT WINAPI SHGetFolderPathA(HWND hwnd, int csidl, HANDLE hToken, DWORD dwFlags, LPSTR pszPath);
EXTERN_C HWND WINAPI GetAncestor(HWND hwnd, UINT gaFlags);
EXTERN_C UINT WINAPI RealGetWindowClass(HWND hwnd, LPTSTR pszType, UINT cchType);
#endif /* defined (_MSC_VER) && (WINVER < 0x0500) */
/* declarations for MINGW32 */
#ifdef __MINGW32_VERSION
/* The security descriptor structure */
typedef struct {
BYTE Revision;
BYTE Sbz1;
SECURITY_DESCRIPTOR_CONTROL Control;
DWORD Owner;
DWORD Group;
DWORD Sacl;
DWORD Dacl;
} SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE;
#endif /* __MINGW32_VERSION */
#endif /* __AUXDECL_H */

2
apilibs/kexbasen/comdlg32/_comdlg32_apilist.c Executable file → Normal file
View File

@ -35,7 +35,9 @@ static const apilib_named_api comdlg32_named_apis[] =
DECL_API("ChooseFontW", ChooseFontW_fwd),
DECL_API("FindTextW", FindTextW_fwd),
DECL_API("GetFileTitleW", GetFileTitleW_fwd),
DECL_API("GetOpenFileNameA", GetOpenFileNameA_fix),
DECL_API("GetOpenFileNameW", GetOpenFileNameW_fwd),
DECL_API("GetSaveFileNameA", GetSaveFileNameA_fix),
DECL_API("GetSaveFileNameW", GetSaveFileNameW_fwd),
DECL_API("PageSetupDlgW", PageSetupDlgW_fwd),
DECL_API("PrintDlgW", PrintDlgW_fwd),

3
apilibs/kexbasen/comdlg32/_comdlg32_apilist.h Executable file → Normal file
View File

@ -22,13 +22,14 @@
#ifndef _COMDLG32_APILIST_H
#define _COMDLG32_APILIST_H
#include "auxdecl.h"
#include "kexcoresdk.h"
BOOL init_comdlg32();
extern const apilib_api_table apitable_comdlg32;
/*** AUTOGENERATED APILIST DECLARATIONS BEGIN ***/
BOOL WINAPI GetOpenFileNameA_fix(LPOPENFILENAMEA lpofn);
BOOL WINAPI GetSaveFileNameA_fix(LPOPENFILENAMEA lpofn);
FWDPROC ChooseColorW_fwd;
FWDPROC ChooseFontW_fwd;
FWDPROC FindTextW_fwd;

View File

@ -0,0 +1,51 @@
/*
* KernelEx
* Copyright (C) 2009, 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.
*
*/
#define WINVER 0x0501
#include <windows.h>
/* MAKE_EXPORT GetOpenFileNameA_fix=GetOpenFileNameA */
BOOL WINAPI GetOpenFileNameA_fix(LPOPENFILENAMEA lpofn)
{
BOOL ret = GetOpenFileNameA(lpofn);
if (!ret && CommDlgExtendedError() == CDERR_STRUCTSIZE && lpofn
&& lpofn->lStructSize == sizeof(OPENFILENAME))
{
lpofn->lStructSize = OPENFILENAME_SIZE_VERSION_400A;
ret = GetOpenFileNameA(lpofn);
lpofn->lStructSize = sizeof(OPENFILENAME);
}
return ret;
}
/* MAKE_EXPORT GetSaveFileNameA_fix=GetSaveFileNameA */
BOOL WINAPI GetSaveFileNameA_fix(LPOPENFILENAMEA lpofn)
{
BOOL ret = GetSaveFileNameA(lpofn);
if (!ret && CommDlgExtendedError() == CDERR_STRUCTSIZE && lpofn
&& lpofn->lStructSize == sizeof(OPENFILENAME))
{
lpofn->lStructSize = OPENFILENAME_SIZE_VERSION_400A;
ret = GetSaveFileNameA(lpofn);
lpofn->lStructSize = sizeof(OPENFILENAME);
}
return ret;
}

0
apilibs/kexbasen/comdlg32/unicomdlg32.c Executable file → Normal file
View File

0
apilibs/kexbasen/common.c Executable file → Normal file
View File

0
apilibs/kexbasen/common.h Executable file → Normal file
View File

2
apilibs/kexbasen/dirlist Executable file → Normal file
View File

@ -4,3 +4,5 @@ gdi32
advapi32
comdlg32
shell32
rpcrt4
winspool

145
apilibs/kexbasen/gdi32/UberGDI.c Executable file → Normal file
View File

@ -27,117 +27,7 @@
#include <malloc.h>
#include <windows.h>
#include "common.h"
//#include <usp10.h>
typedef void *SCRIPT_CACHE;
typedef struct {
int cBytes;
WORD wgBlank;
WORD wgDefault;
WORD wgInvalid;
WORD wgKashida;
int iKashidaWidth;
} SCRIPT_FONTPROPERTIES;
typedef HRESULT (WINAPI *PFNSCRIPTGETCMAP) (
HDC hdc,
SCRIPT_CACHE *psc,
const WCHAR *pwcInChars,
int cChars,
DWORD dwFlags,
WORD *pwOutGlyphs);
typedef HRESULT (WINAPI *PFNSFC) (SCRIPT_CACHE *psc);
typedef HRESULT (WINAPI *PFNCGH) ( HDC hdc, SCRIPT_CACHE *psc, long *tmHeight );
typedef HRESULT (WINAPI *PFNGFP) ( HDC hdc, SCRIPT_CACHE *psc, SCRIPT_FONTPROPERTIES *sfp );
typedef HRESULT (WINAPI *PFNGETGABCWIDTH) ( HDC hdc, SCRIPT_CACHE *psc, WORD wGlyph, ABC *pABC);
static HRESULT WINAPI ScriptGetCMap_dld(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars, int cChars, DWORD dwFlags, WORD *pwOutGlyphs);
static HRESULT WINAPI ScriptFreeCache_dld(SCRIPT_CACHE *psc);
static HRESULT WINAPI ScriptCacheGetHeight_dld(HDC hdc, SCRIPT_CACHE *psc, long *tmHeight);
static HRESULT WINAPI ScriptGetFontProperties_dld(HDC hdc, SCRIPT_CACHE *psc, SCRIPT_FONTPROPERTIES *sfp);
static PFNSCRIPTGETCMAP ScriptGetCMap_pfn = ScriptGetCMap_dld;
static PFNSFC ScriptFreeCache_pfn = ScriptFreeCache_dld;
static PFNCGH ScriptCacheGetHeight_pfn = ScriptCacheGetHeight_dld;
static PFNGFP ScriptGetFontProperties_pfn = ScriptGetFontProperties_dld;
static PFNGETGABCWIDTH ScriptGetGlyphABCWidth_pfn = NULL;
/* delay-loaded Uniscribe start */
static const char c_szUsp10[]="usp10.dll";
static FARPROC WINAPI LoadUniscribeProc(LPCSTR proc)
{
static HMODULE usp10;
FARPROC ret;
DWORD lasterr = GetLastError();
if (!usp10)
{
usp10 = GetModuleHandleA(c_szUsp10);
if (!usp10) usp10 = LoadLibraryA(c_szUsp10);
if (!usp10)
fatal_error("kexbasen: Failed to load Uniscribe!");
}
ret = GetProcAddress(usp10,proc);
SetLastError(lasterr);
return ret;
}
static HRESULT WINAPI ScriptGetCMap_dld(
HDC hdc,
SCRIPT_CACHE *psc,
const WCHAR *pwcInChars,
int cChars,
DWORD dwFlags,
WORD *pwOutGlyphs
)
{
PFNSCRIPTGETCMAP pfn;
pfn = (PFNSCRIPTGETCMAP)LoadUniscribeProc("ScriptGetCMap");
if ( !pfn ) return E_FAIL;
ScriptGetCMap_pfn = pfn;
return pfn (hdc,psc,pwcInChars,cChars,dwFlags,pwOutGlyphs);
}
static HRESULT WINAPI ScriptFreeCache_dld(
SCRIPT_CACHE *psc
)
{
PFNSFC pfn;
pfn = (PFNSFC)LoadUniscribeProc("ScriptFreeCache");
if ( !pfn ) return E_FAIL;
ScriptFreeCache_pfn = pfn;
return pfn (psc);
}
static HRESULT WINAPI ScriptCacheGetHeight_dld(
HDC hdc,
SCRIPT_CACHE *psc,
long *tmHeight
)
{
PFNCGH pfn;
pfn = (PFNCGH)LoadUniscribeProc("ScriptCacheGetHeight");
if ( !pfn ) return E_FAIL;
ScriptCacheGetHeight_pfn = pfn;
return pfn (hdc,psc,tmHeight);
}
static HRESULT WINAPI ScriptGetFontProperties_dld(
HDC hdc,
SCRIPT_CACHE *psc,
SCRIPT_FONTPROPERTIES *sfp
)
{
PFNGFP pfn;
pfn = (PFNGFP)LoadUniscribeProc("ScriptGetFontProperties");
if ( !pfn ) return E_FAIL;
ScriptGetFontProperties_pfn = pfn;
return pfn (hdc,psc,sfp);
}
/* delay-loaded Uniscribe END */
#include <usp10.h>
/* MAKE_EXPORT GetGlyphIndicesW_new=GetGlyphIndicesW */
int WINAPI GetGlyphIndicesW_new(
@ -151,7 +41,7 @@ int WINAPI GetGlyphIndicesW_new(
HRESULT result;
SCRIPT_CACHE cache = 0;
if (!hdc || !pgi || (UINT)lpstr<0xFFFFu || !c) return GDI_ERROR;
result = ScriptGetCMap_pfn(hdc,&cache,lpstr,c,0,pgi);
result = ScriptGetCMap(hdc,&cache,lpstr,c,0,pgi);
if ( !( result == S_OK || result == S_FALSE ) ) return GDI_ERROR;
if ( fl && result == S_FALSE)
{
@ -159,14 +49,14 @@ int WINAPI GetGlyphIndicesW_new(
int i;
SCRIPT_FONTPROPERTIES fpr;
fpr.cBytes = sizeof(SCRIPT_FONTPROPERTIES);
if (FAILED(ScriptGetFontProperties_pfn(hdc,&cache,&fpr))) return GDI_ERROR;
if (FAILED(ScriptGetFontProperties(hdc,&cache,&fpr))) return GDI_ERROR;
for (i = 0; i < c; i++)
{
if (*checkglyph == fpr.wgDefault) *checkglyph = 0xFFFF;
checkglyph++;
}
}
ScriptFreeCache_pfn(&cache);
ScriptFreeCache(&cache);
return c;
}
@ -234,9 +124,7 @@ BOOL WINAPI GetTextExtentExPointI_new(
int glyphwidth;
BOOL unfit = FALSE;
if (!ScriptGetGlyphABCWidth_pfn)
ScriptGetGlyphABCWidth_pfn = (PFNGETGABCWIDTH)LoadUniscribeProc("ScriptGetGlyphABCWidth");
if ( !hdc || !pgiIn || cgi<=0 || !lpSize || !ScriptGetGlyphABCWidth_pfn)
if ( !hdc || !pgiIn || cgi<=0 || !lpSize)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
@ -245,7 +133,7 @@ BOOL WINAPI GetTextExtentExPointI_new(
//so let's compute the info ourselves
for (i = 0; i < cgi; i++)
{
if ( ScriptGetGlyphABCWidth_pfn(hdc,&cache,*glyph,&abc) != S_OK ) break;
if ( ScriptGetGlyphABCWidth(hdc,&cache,*glyph,&abc) != S_OK ) break;
glyphwidth = abc.abcA + abc.abcB + abc.abcC;
sum += glyphwidth;
if ( !unfit )
@ -257,8 +145,8 @@ BOOL WINAPI GetTextExtentExPointI_new(
glyph++;
}
lpSize->cx = sum;
ScriptCacheGetHeight_pfn(hdc,&cache,&lpSize->cy);
ScriptFreeCache_pfn(&cache);
ScriptCacheGetHeight(hdc,&cache,&lpSize->cy);
ScriptFreeCache(&cache);
return TRUE;
}
@ -286,9 +174,7 @@ BOOL WINAPI GetCharWidthI_new(
ABC abc;
WORD glyph;
if (!ScriptGetGlyphABCWidth_pfn)
ScriptGetGlyphABCWidth_pfn = (PFNGETGABCWIDTH)LoadUniscribeProc("ScriptGetGlyphABCWidth");
if ( !hdc || !lpBuffer || cgi<=0 || !ScriptGetGlyphABCWidth_pfn)
if ( !hdc || !lpBuffer || cgi<=0)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
@ -297,7 +183,7 @@ BOOL WINAPI GetCharWidthI_new(
{
for ( glyph = giFirst; glyph < giFirst+cgi; glyph++)
{
ScriptGetGlyphABCWidth_pfn(hdc,&cache,glyph,&abc);
ScriptGetGlyphABCWidth(hdc,&cache,glyph,&abc);
*lpBuffer = abc.abcA + abc.abcB + abc.abcC;
lpBuffer++;
}
@ -306,13 +192,13 @@ BOOL WINAPI GetCharWidthI_new(
{
for ( glyph = 0; glyph < cgi; glyph++)
{
ScriptGetGlyphABCWidth_pfn(hdc,&cache,*pgi,&abc);
ScriptGetGlyphABCWidth(hdc,&cache,*pgi,&abc);
*lpBuffer = abc.abcA + abc.abcB + abc.abcC;
pgi++;
lpBuffer++;
}
}
ScriptFreeCache_pfn(&cache);
ScriptFreeCache(&cache);
return TRUE;
}
@ -328,6 +214,13 @@ DWORD WINAPI GetGlyphOutlineW_new(
)
{
UINT glyph = 0;
//GetGlyphOutlineW must receive same fix GetGlyphOutlineA received since apilibs interlinking changed
MAT2 matr;
if ( lpmat2 )
{
memcpy( &matr, lpmat2, sizeof(MAT2) );
lpmat2 = &matr;
}
if (uFormat & GGO_GLYPH_INDEX)
return GetGlyphOutlineA( hdc, uChar, uFormat, lpgm, cbBuffer, lpvBuffer, lpmat2 );
GetGlyphIndicesW_new( hdc, (LPWSTR)&uChar, 1, (LPWORD)&glyph, 0 );

2
apilibs/kexbasen/gdi32/_gdi32_apilist.c Executable file → Normal file
View File

@ -41,8 +41,6 @@ static const apilib_named_api gdi32_named_apis[] =
DECL_API("CreateICW", CreateICW_fwd),
DECL_API("CreateMetaFileW", CreateMetaFileW_fwd),
DECL_API("CreateScalableFontResourceW", CreateScalableFontResourceW_fwd),
DECL_API("EnumFontFamiliesExW", EnumFontFamiliesExW_fwd),
DECL_API("EnumFontFamiliesW", EnumFontFamiliesW_fwd),
DECL_API("EnumFontsW", EnumFontsW_fwd),
DECL_API("EnumICMProfilesW", EnumICMProfilesW_fwd),
DECL_API("GetCharABCWidthsW", GetCharABCWidthsW_fwd),

3
apilibs/kexbasen/gdi32/_gdi32_apilist.h Executable file → Normal file
View File

@ -22,7 +22,6 @@
#ifndef _GDI32_APILIST_H
#define _GDI32_APILIST_H
#include "auxdecl.h"
#include "kexcoresdk.h"
BOOL init_gdi32();
@ -45,8 +44,6 @@ FWDPROC CreateFontW_fwd;
FWDPROC CreateICW_fwd;
FWDPROC CreateMetaFileW_fwd;
FWDPROC CreateScalableFontResourceW_fwd;
FWDPROC EnumFontFamiliesExW_fwd;
FWDPROC EnumFontFamiliesW_fwd;
FWDPROC EnumFontsW_fwd;
FWDPROC EnumICMProfilesW_fwd;
FWDPROC GetCharABCWidthsW_fwd;

2
apilibs/kexbasen/gdi32/unigdi32.c Executable file → Normal file
View File

@ -31,8 +31,6 @@ FORWARD_TO_UNICOWS(CreateFontW);
FORWARD_TO_UNICOWS(CreateICW);
FORWARD_TO_UNICOWS(CreateMetaFileW);
FORWARD_TO_UNICOWS(CreateScalableFontResourceW);
FORWARD_TO_UNICOWS(EnumFontFamiliesExW);
FORWARD_TO_UNICOWS(EnumFontFamiliesW);
FORWARD_TO_UNICOWS(EnumFontsW);
FORWARD_TO_UNICOWS(EnumICMProfilesW);
FORWARD_TO_UNICOWS(GetCharABCWidthsW);

11
apilibs/kexbasen/kernel32/_kernel32_apilist.c Executable file → Normal file
View File

@ -35,7 +35,6 @@ static const apilib_named_api kernel32_named_apis[] =
DECL_API("BuildCommDCBW", BuildCommDCBW_fwd),
DECL_API("CallNamedPipeW", CallNamedPipeW_fwd),
DECL_API("CommConfigDialogW", CommConfigDialogW_fwd),
DECL_API("CompareStringW", CompareStringW_fwd),
DECL_API("CreateEventW", CreateEventW_fwd),
DECL_API("CreateFileMappingW", CreateFileMappingW_fwd),
DECL_API("CreateMailslotW", CreateMailslotW_fwd),
@ -54,7 +53,6 @@ static const apilib_named_api kernel32_named_apis[] =
DECL_API("FatalAppExitW", FatalAppExitW_fwd),
DECL_API("FillConsoleOutputCharacterW", FillConsoleOutputCharacterW_fwd),
DECL_API("FormatMessageW", FormatMessageW_fwd),
DECL_API("GetAtomNameW", GetAtomNameW_fwd),
DECL_API("GetCPInfoExW", GetCPInfoExW_fwd),
DECL_API("GetCalendarInfoW", GetCalendarInfoW_fwd),
DECL_API("GetComputerNameW", GetComputerNameW_fwd),
@ -65,8 +63,6 @@ static const apilib_named_api kernel32_named_apis[] =
DECL_API("GetEnvironmentVariableW", GetEnvironmentVariableW_fwd),
DECL_API("GetLocaleInfoW", GetLocaleInfoW_fwd),
DECL_API("GetLogicalDriveStringsW", GetLogicalDriveStringsW_fwd),
DECL_API("GetModuleFileNameW", GetModuleFileNameW_fwd),
DECL_API("GetModuleHandleW", GetModuleHandleW_fwd),
DECL_API("GetNamedPipeHandleStateW", GetNamedPipeHandleStateW_fwd),
DECL_API("GetNumberFormatW", GetNumberFormatW_fwd),
DECL_API("GetPrivateProfileIntW", GetPrivateProfileIntW_fwd),
@ -77,14 +73,9 @@ static const apilib_named_api kernel32_named_apis[] =
DECL_API("GetProfileIntW", GetProfileIntW_fwd),
DECL_API("GetProfileSectionW", GetProfileSectionW_fwd),
DECL_API("GetProfileStringW", GetProfileStringW_fwd),
DECL_API("GetStringTypeExW", GetStringTypeExW_fwd),
DECL_API("GetStringTypeW", GetStringTypeW_fwd),
DECL_API("GetTimeFormatW", GetTimeFormatW_fwd),
DECL_API("GetVolumeInformationW", GetVolumeInformationW_fwd),
DECL_API("IsBadStringPtrW", IsBadStringPtrW_fwd),
DECL_API("LCMapStringW", LCMapStringW_fwd),
DECL_API("LoadLibraryExW", LoadLibraryExW_fwd),
DECL_API("LoadLibraryW", LoadLibraryW_fwd),
DECL_API("OpenEventW", OpenEventW_fwd),
DECL_API("OpenFileMappingW", OpenFileMappingW_fwd),
DECL_API("OpenMutexW", OpenMutexW_fwd),
@ -113,8 +104,6 @@ static const apilib_named_api kernel32_named_apis[] =
DECL_API("WritePrivateProfileStructW", WritePrivateProfileStructW_fwd),
DECL_API("WriteProfileSectionW", WriteProfileSectionW_fwd),
DECL_API("WriteProfileStringW", WriteProfileStringW_fwd),
DECL_API("lstrcmpW", lstrcmpW_fwd),
DECL_API("lstrcmpiW", lstrcmpiW_fwd),
/*** AUTOGENERATED APILIST NAMED EXPORTS END ***/
};

12
apilibs/kexbasen/kernel32/_kernel32_apilist.h Executable file → Normal file
View File

@ -22,7 +22,6 @@
#ifndef _KERNEL32_APILIST_H
#define _KERNEL32_APILIST_H
#include "auxdecl.h"
#include "kexcoresdk.h"
BOOL init_kernel32();
@ -33,7 +32,6 @@ FWDPROC BuildCommDCBAndTimeoutsW_fwd;
FWDPROC BuildCommDCBW_fwd;
FWDPROC CallNamedPipeW_fwd;
FWDPROC CommConfigDialogW_fwd;
FWDPROC CompareStringW_fwd;
FWDPROC CreateEventW_fwd;
FWDPROC CreateFileMappingW_fwd;
FWDPROC CreateMailslotW_fwd;
@ -52,7 +50,6 @@ FWDPROC ExpandEnvironmentStringsW_fwd;
FWDPROC FatalAppExitW_fwd;
FWDPROC FillConsoleOutputCharacterW_fwd;
FWDPROC FormatMessageW_fwd;
FWDPROC GetAtomNameW_fwd;
FWDPROC GetCPInfoExW_fwd;
FWDPROC GetCalendarInfoW_fwd;
FWDPROC GetComputerNameW_fwd;
@ -63,8 +60,6 @@ FWDPROC GetDriveTypeW_fwd;
FWDPROC GetEnvironmentVariableW_fwd;
FWDPROC GetLocaleInfoW_fwd;
FWDPROC GetLogicalDriveStringsW_fwd;
FWDPROC GetModuleFileNameW_fwd;
FWDPROC GetModuleHandleW_fwd;
FWDPROC GetNamedPipeHandleStateW_fwd;
FWDPROC GetNumberFormatW_fwd;
FWDPROC GetPrivateProfileIntW_fwd;
@ -75,14 +70,9 @@ FWDPROC GetPrivateProfileStructW_fwd;
FWDPROC GetProfileIntW_fwd;
FWDPROC GetProfileSectionW_fwd;
FWDPROC GetProfileStringW_fwd;
FWDPROC GetStringTypeExW_fwd;
FWDPROC GetStringTypeW_fwd;
FWDPROC GetTimeFormatW_fwd;
FWDPROC GetVolumeInformationW_fwd;
FWDPROC IsBadStringPtrW_fwd;
FWDPROC LCMapStringW_fwd;
FWDPROC LoadLibraryExW_fwd;
FWDPROC LoadLibraryW_fwd;
FWDPROC OpenEventW_fwd;
FWDPROC OpenFileMappingW_fwd;
FWDPROC OpenMutexW_fwd;
@ -111,8 +101,6 @@ FWDPROC WritePrivateProfileStringW_fwd;
FWDPROC WritePrivateProfileStructW_fwd;
FWDPROC WriteProfileSectionW_fwd;
FWDPROC WriteProfileStringW_fwd;
FWDPROC lstrcmpW_fwd;
FWDPROC lstrcmpiW_fwd;
/*** AUTOGENERATED APILIST DECLARATIONS END ***/
#endif

11
apilibs/kexbasen/kernel32/unikernel32.c Executable file → Normal file
View File

@ -25,7 +25,6 @@ FORWARD_TO_UNICOWS(BuildCommDCBAndTimeoutsW);
FORWARD_TO_UNICOWS(BuildCommDCBW);
FORWARD_TO_UNICOWS(CallNamedPipeW);
FORWARD_TO_UNICOWS(CommConfigDialogW);
FORWARD_TO_UNICOWS(CompareStringW);
FORWARD_TO_UNICOWS(CreateEventW);
FORWARD_TO_UNICOWS(CreateFileMappingW);
FORWARD_TO_UNICOWS(CreateMailslotW);
@ -44,7 +43,6 @@ FORWARD_TO_UNICOWS(ExpandEnvironmentStringsW);
FORWARD_TO_UNICOWS(FatalAppExitW);
FORWARD_TO_UNICOWS(FillConsoleOutputCharacterW);
FORWARD_TO_UNICOWS(FormatMessageW);
FORWARD_TO_UNICOWS(GetAtomNameW);
FORWARD_TO_UNICOWS(GetCPInfoExW);
FORWARD_TO_UNICOWS(GetCalendarInfoW);
FORWARD_TO_UNICOWS(GetComputerNameW);
@ -55,8 +53,6 @@ FORWARD_TO_UNICOWS(GetDriveTypeW);
FORWARD_TO_UNICOWS(GetEnvironmentVariableW);
FORWARD_TO_UNICOWS(GetLocaleInfoW);
FORWARD_TO_UNICOWS(GetLogicalDriveStringsW);
FORWARD_TO_UNICOWS(GetModuleFileNameW);
FORWARD_TO_UNICOWS(GetModuleHandleW);
FORWARD_TO_UNICOWS(GetNamedPipeHandleStateW);
FORWARD_TO_UNICOWS(GetNumberFormatW);
FORWARD_TO_UNICOWS(GetPrivateProfileIntW);
@ -67,14 +63,9 @@ FORWARD_TO_UNICOWS(GetPrivateProfileStructW);
FORWARD_TO_UNICOWS(GetProfileIntW);
FORWARD_TO_UNICOWS(GetProfileSectionW);
FORWARD_TO_UNICOWS(GetProfileStringW);
FORWARD_TO_UNICOWS(GetStringTypeExW);
FORWARD_TO_UNICOWS(GetStringTypeW);
FORWARD_TO_UNICOWS(GetTimeFormatW);
FORWARD_TO_UNICOWS(GetVolumeInformationW);
FORWARD_TO_UNICOWS(IsBadStringPtrW);
FORWARD_TO_UNICOWS(LCMapStringW);
FORWARD_TO_UNICOWS(LoadLibraryExW);
FORWARD_TO_UNICOWS(LoadLibraryW);
FORWARD_TO_UNICOWS(OpenEventW);
FORWARD_TO_UNICOWS(OpenFileMappingW);
FORWARD_TO_UNICOWS(OpenMutexW);
@ -103,5 +94,3 @@ FORWARD_TO_UNICOWS(WritePrivateProfileStringW);
FORWARD_TO_UNICOWS(WritePrivateProfileStructW);
FORWARD_TO_UNICOWS(WriteProfileSectionW);
FORWARD_TO_UNICOWS(WriteProfileStringW);
FORWARD_TO_UNICOWS(lstrcmpW);
FORWARD_TO_UNICOWS(lstrcmpiW);

0
apilibs/kexbasen/kexbasen.def Executable file → Normal file
View File

90
apilibs/kexbasen/kexbasen.dsp Executable file → Normal file
View File

@ -47,13 +47,13 @@ RSC=rc.exe
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x415 /d "NDEBUG"
# ADD RSC /l 0x415 /d "NDEBUG"
# ADD RSC /l 0x415 /i "../../common" /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shlwapi.lib shell32.lib ../../common/KernelEx.lib ../../kexcrt/kexcrt.lib libc.lib /nologo /dll /map /machine:I386 /nodefaultlib /OPT:NOWIN98
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shlwapi.lib shell32.lib rpcrt4.lib usp10.lib ../../common/KernelEx.lib ../../kexcrt/kexcrt.lib libc.lib delayimp.lib /nologo /dll /map /machine:I386 /nodefaultlib /OPT:NOWIN98 /DELAYLOAD:shell32.dll /DELAYLOAD:rpcrt4.dll /DELAYLOAD:usp10.dll /DELAYLOAD:comdlg32.dll /DELAYLOAD:winspool.drv
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "KernelEx Base NonShared - Win32 Debug"
@ -74,13 +74,13 @@ LINK32=link.exe
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x415 /d "_DEBUG"
# ADD RSC /l 0x415 /d "_DEBUG"
# ADD RSC /l 0x415 /i "../../common" /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shlwapi.lib shell32.lib ../../common/KernelEx.lib ../../kexcrt/kexcrt.lib libc.lib /nologo /dll /map /debug /machine:I386 /nodefaultlib /pdbtype:sept /OPT:NOWIN98
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shlwapi.lib shell32.lib rpcrt4.lib usp10.lib ../../common/KernelEx.lib ../../kexcrt/kexcrt.lib libc.lib delayimp.lib /nologo /dll /map /debug /machine:I386 /nodefaultlib /pdbtype:sept /OPT:NOWIN98 /DELAYLOAD:shell32.dll /DELAYLOAD:rpcrt4.dll /DELAYLOAD:usp10.dll /DELAYLOAD:comdlg32.dll /DELAYLOAD:winspool.drv
# SUBTRACT LINK32 /pdb:none
!ENDIF
@ -173,6 +173,10 @@ SOURCE=.\comdlg32\_comdlg32_apilist.h
# End Source File
# Begin Source File
SOURCE=.\comdlg32\openfilename_fix.c
# End Source File
# Begin Source File
SOURCE=.\comdlg32\unicomdlg32.c
# End Source File
# End Group
@ -208,6 +212,38 @@ SOURCE=.\shell32\SHGetFolderPath.c
SOURCE=.\shell32\unishell32.c
# End Source File
# End Group
# Begin Group "rpcrt4"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\rpcrt4\_rpcrt4_apilist.c
# End Source File
# Begin Source File
SOURCE=.\rpcrt4\_rpcrt4_apilist.h
# End Source File
# Begin Source File
SOURCE=.\rpcrt4\unirpcrt4.c
# End Source File
# End Group
# Begin Group "winspool"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\winspool\_winspool_apilist.c
# End Source File
# Begin Source File
SOURCE=.\winspool\_winspool_apilist.h
# End Source File
# Begin Source File
SOURCE=.\winspool\DefaultPrinter.c
# End Source File
# End Group
# Begin Source File
SOURCE=.\common.c
@ -215,43 +251,6 @@ SOURCE=.\common.c
# Begin Source File
SOURCE=.\kexbasen.def
!IF "$(CFG)" == "KernelEx Base NonShared - Win32 Release"
# Begin Custom Build
OutDir=.\Release
ProjDir=.
InputPath=.\kexbasen.def
BuildCmds= \
link /LIB /NOLOGO /MACHINE:IX86 /DEF:$(ProjDir)\shell32ord.def /OUT:$(OutDir)\shell32ord.lib
"$(OutDir)\shell32ord.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(OutDir)\shell32ord.exp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ELSEIF "$(CFG)" == "KernelEx Base NonShared - Win32 Debug"
# Begin Custom Build
OutDir=.\Debug
ProjDir=.
InputPath=.\kexbasen.def
BuildCmds= \
link /LIB /NOLOGO /MACHINE:IX86 /DEF:$(ProjDir)\shell32ord.def /OUT:$(OutDir)\shell32ord.lib
"$(OutDir)\shell32ord.lib" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
"$(OutDir)\shell32ord.exp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
$(BuildCmds)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
@ -259,11 +258,6 @@ SOURCE=.\main.c
# End Source File
# Begin Source File
SOURCE=.\shell32ord.def
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File
SOURCE=.\unifwd.c
# End Source File
# End Group
@ -272,10 +266,6 @@ SOURCE=.\unifwd.c
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\auxdecl.h
# End Source File
# Begin Source File
SOURCE=.\common.h
# End Source File
# Begin Source File

11
apilibs/kexbasen/kexbasen.rc Executable file → Normal file
View File

@ -1,6 +1,5 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#include "version.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
@ -54,8 +53,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,0,1,2
PRODUCTVERSION 4,0,1,2
FILEVERSION RCVERSION
PRODUCTVERSION RCVERSION
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -73,14 +72,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Xeno86\0"
VALUE "FileDescription", "KernelEx Base Non-shared Api Library\0"
VALUE "FileVersion", "4, 0, 1, 2\0"
VALUE "FileVersion", _RCVERSION_ "\0"
VALUE "InternalName", "kexbasen\0"
VALUE "LegalCopyright", "Copyright <20> 2009, Xeno86\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "kexbasen.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "KernelEx\0"
VALUE "ProductVersion", "4, 0, 1, 2\0"
VALUE "ProductVersion", VERSION_STR "\0"
VALUE "SpecialBuild", "\0"
END
END

11
apilibs/kexbasen/main.c Executable file → Normal file
View File

@ -28,9 +28,11 @@
#include "advapi32/_advapi32_apilist.h"
#include "comdlg32/_comdlg32_apilist.h"
#include "shell32/_shell32_apilist.h"
#include "rpcrt4/_rpcrt4_apilist.h"
#include "winspool/_winspool_apilist.h"
//#include "/__apilist.h"
static apilib_api_table api_table[7];
static apilib_api_table api_table[9];
static void fill_apitable()
{
@ -40,6 +42,8 @@ static void fill_apitable()
api_table[3] = apitable_advapi32;
api_table[4] = apitable_comdlg32;
api_table[5] = apitable_shell32;
api_table[6] = apitable_rpcrt4;
api_table[7] = apitable_winspool;
//last entry is null terminator
}
@ -48,15 +52,12 @@ __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();
return common_init() && init_kernel32() && init_gdi32() && init_user32() && init_advapi32() && init_comdlg32() && init_shell32() && init_rpcrt4() && init_winspool();
}
BOOL APIENTRY DllMain(HINSTANCE instance, DWORD reason, BOOL load_static)

0
apilibs/kexbasen/resource.h Executable file → Normal file
View File

View File

@ -0,0 +1,48 @@
/*
* KernelEx
* Copyright (C) 2009, 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 "kexcoresdk.h"
#include "_rpcrt4_apilist.h"
BOOL init_rpcrt4()
{
return TRUE;
}
static const apilib_named_api rpcrt4_named_apis[] =
{
/*** AUTOGENERATED APILIST NAMED EXPORTS BEGIN ***/
DECL_API("RpcStringFreeW", RpcStringFreeW_new),
DECL_API("UuidFromStringW", UuidFromStringW_new),
DECL_API("UuidToStringW", UuidToStringW_new),
/*** AUTOGENERATED APILIST NAMED EXPORTS END ***/
};
#if 0
static const apilib_unnamed_api rpcrt4_ordinal_apis[] =
{
/*** AUTOGENERATED APILIST ORDINAL EXPORTS BEGIN ***/
/*** AUTOGENERATED APILIST ORDINAL EXPORTS END ***/
};
#endif
const apilib_api_table apitable_rpcrt4 = DECL_TAB("RPCRT4.DLL", rpcrt4_named_apis, 0 /*rpcrt4_ordinal_apis*/);

View File

@ -0,0 +1,36 @@
/*
* KernelEx
* Copyright (C) 2009, 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.
*
*/
#ifndef _RPCRT4_APILIST_H
#define _RPCRT4_APILIST_H
#include "kexcoresdk.h"
BOOL init_rpcrt4();
extern const apilib_api_table apitable_rpcrt4;
/*** AUTOGENERATED APILIST DECLARATIONS BEGIN ***/
RPC_STATUS RPC_ENTRY RpcStringFreeW_new(IN OUT unsigned short ** String);
RPC_STATUS RPC_ENTRY UuidFromStringW_new(IN unsigned short * StringUuidW, OUT UUID * Uuid);
RPC_STATUS RPC_ENTRY UuidToStringW_new(IN UUID * Uuid, OUT unsigned short ** StringUuid);
/*** AUTOGENERATED APILIST DECLARATIONS END ***/
#endif

View File

@ -0,0 +1,65 @@
/*
* KernelEx
* Copyright (C) 2009, 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 <rpc.h>
/* MAKE_EXPORT RpcStringFreeW_new=RpcStringFreeW */
RPC_STATUS
RPC_ENTRY
RpcStringFreeW_new(IN OUT unsigned short ** String)
{
HeapFree(GetProcessHeap(), 0, *String);
return RPC_S_OK;
}
/* MAKE_EXPORT UuidFromStringW_new=UuidFromStringW */
RPC_STATUS
RPC_ENTRY
UuidFromStringW_new(IN unsigned short * StringUuidW, OUT UUID * Uuid)
{
ALLOC_WtoA(StringUuid);
return UuidFromStringA((unsigned char*) StringUuidA, Uuid);
}
/* MAKE_EXPORT UuidToStringW_new=UuidToStringW */
RPC_STATUS
RPC_ENTRY
UuidToStringW_new(IN UUID * Uuid, OUT unsigned short ** StringUuid)
{
RPC_STATUS ret;
unsigned char* uuidA;
ret = UuidToStringA(Uuid, &uuidA);
if (ret == RPC_S_OK)
{
int size = (strlen((char*) uuidA) + 1) * sizeof(short);
*StringUuid = (unsigned short*) HeapAlloc(GetProcessHeap(), 0, size);
if (!*StringUuid)
{
RpcStringFreeA(&uuidA);
return RPC_S_OUT_OF_MEMORY;
}
MultiByteToWideChar(CP_ACP, 0, (char*)uuidA, -1, *StringUuid, size);
RpcStringFreeA(&uuidA);
}
return ret;
}

563
apilibs/kexbasen/shell32/SHGetFolderLocation.c Executable file → Normal file
View File

@ -1,23 +1,23 @@
/*
* Path Functions
*
* Copyright 1998, 1999, 2000 Juergen Schmied
* Copyright 2004 Juan Lang
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
/*
* Path Functions
*
* Copyright 1998, 1999, 2000 Juergen Schmied
* Copyright 2004 Juan Lang
*
* 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
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#ifdef _MSC_VER
@ -27,281 +27,274 @@
#define WARN() ((void)0)
#else
#define TRACE(...) do {} while(0)
#define TRACE_(x) TRACE
#define TRACE_(x) TRACE
#define WARN(...) do {} while(0)
#endif
#define _WIN32_IE 0x0500
#include <windows.h>
#include <windows.h>
#include <shlguid.h>
#include "auxshlguid.h"
#include "pidl.h"
#include <shlwapi.h>
#include "common.h"
#include "_shell32_apilist.h"
#include "auxdecl.h"
EXTERN_C HRESULT WINAPI SHILCreateFromPathA(LPCSTR path, LPITEMIDLIST *ppidl, DWORD *attributes); /* ORDINAL 28 */
EXTERN_C LPVOID WINAPI SHAlloc(DWORD len); /* ORDINAL 196 */
EXTERN_C void WINAPI SHFree(LPVOID pv); /* ORDINAL 195 */
EXTERN_C LPITEMIDLIST WINAPI ILGetNext(LPCITEMIDLIST pidl); /* ORDINAL 153 */
EXTERN_C LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2); /* ORDINAL 25 */
/**************************************************************************
*
* internal functions
*
* ### 1. section creating pidls ###
*
*************************************************************************
*/
LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
{
LPITEMIDLIST pidlOut = NULL;
pidlOut = (LPITEMIDLIST) SHAlloc(size + 5);
if(pidlOut)
{
LPPIDLDATA pData;
LPITEMIDLIST pidlNext;
ZeroMemory(pidlOut, size + 5);
pidlOut->mkid.cb = size + 3;
pData = _ILGetDataPointer(pidlOut);
if (pData)
pData->type = type;
pidlNext = ILGetNext(pidlOut);
if (pidlNext)
pidlNext->mkid.cb = 0x00;
TRACE("-- (pidl=%p, size=%u)\n", pidlOut, size);
}
return pidlOut;
}
LPITEMIDLIST _ILCreateDesktop()
{
LPITEMIDLIST ret;
TRACE("()\n");
ret = (LPITEMIDLIST) SHAlloc(2);
if (ret)
ret->mkid.cb = 0;
return ret;
}
LPITEMIDLIST _ILCreateMyComputer()
{
TRACE("()\n");
return _ILCreateGuid(PT_GUID, &CLSID_MyComputer);
}
LPITEMIDLIST _ILCreateMyDocuments()
{
TRACE("()\n");
return _ILCreateGuid(PT_GUID, &CLSID_MyDocuments);
}
LPITEMIDLIST _ILCreateIExplore()
{
TRACE("()\n");
return _ILCreateGuid(PT_GUID, &CLSID_Internet);
}
LPITEMIDLIST _ILCreateControlPanel()
{
LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
TRACE("()\n");
if (parent)
{
LPITEMIDLIST cpl = _ILCreateGuid(PT_SHELLEXT, &CLSID_ControlPanel);
if (cpl)
{
ret = ILCombine(parent, cpl);
SHFree(cpl);
}
SHFree(parent);
}
return ret;
}
LPITEMIDLIST _ILCreatePrinters()
{
LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
TRACE("()\n");
if (parent)
{
LPITEMIDLIST printers = _ILCreateGuid(PT_YAGUID, &CLSID_Printers);
if (printers)
{
ret = ILCombine(parent, printers);
SHFree(printers);
}
SHFree(parent);
}
return ret;
}
LPITEMIDLIST _ILCreateNetwork()
{
TRACE("()\n");
return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);
}
LPITEMIDLIST _ILCreateBitBucket()
{
TRACE("()\n");
return _ILCreateGuid(PT_GUID, &CLSID_RecycleBin);
}
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, const IID *guid)
{
LPITEMIDLIST pidlOut;
if (type == PT_SHELLEXT || type == PT_GUID || type == PT_YAGUID)
{
pidlOut = _ILAlloc(type, sizeof(GUIDStruct));
if (pidlOut)
{
LPPIDLDATA pData = _ILGetDataPointer(pidlOut);
memcpy(&(pData->u.guid.guid), guid, sizeof(GUID));
TRACE("-- create GUID-pidl %s\n",
debugstr_guid(&(pData->u.guid.guid)));
}
}
else
{
WARN("%d: invalid type for GUID\n", type);
pidlOut = NULL;
}
return pidlOut;
}
/**************************************************************************
*
* ### 4. getting pointers to parts of pidls ###
*
**************************************************************************
* _ILGetDataPointer()
*/
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
{
if(pidl && pidl->mkid.cb != 0x00)
return (LPPIDLDATA) &(pidl->mkid.abID);
return NULL;
}
/*************************************************************************
* SHGetFolderLocation [SHELL32.@]
*
* Gets the folder locations from the registry and creates a pidl.
*
* PARAMS
* hwndOwner [I]
* nFolder [I] CSIDL_xxxxx
* hToken [I] token representing user, or NULL for current user, or -1 for
* default user
* dwReserved [I] must be zero
* ppidl [O] PIDL of a special folder
*
* RETURNS
* Success: S_OK
* Failure: Standard OLE-defined error result, S_FALSE or E_INVALIDARG
*
* NOTES
* Creates missing reg keys and directories.
* Mostly forwards to SHGetFolderPathW, but a few values of nFolder return
* virtual folders that are handled here.
*/
/* MAKE_EXPORT SHGetFolderLocation_new=SHGetFolderLocation */
HRESULT WINAPI SHGetFolderLocation_new(
HWND hwndOwner,
int nFolder,
HANDLE hToken,
DWORD dwReserved,
LPVOID *_ppidl)
/**************************************************************************
*
* internal functions
*
* ### 1. section creating pidls ###
*
*************************************************************************
*/
LPITEMIDLIST _ILAlloc(PIDLTYPE type, unsigned int size)
{
LPITEMIDLIST *ppidl = (LPITEMIDLIST*) _ppidl;
HRESULT hr = E_INVALIDARG;
TRACE("%p 0x%08x %p 0x%08lx %p\n",
hwndOwner, nFolder, hToken, dwReserved, ppidl);
if (!ppidl)
return E_INVALIDARG;
if (dwReserved)
return E_INVALIDARG;
/* The virtual folders' locations are not user-dependent */
*ppidl = NULL;
switch (nFolder)
{
case CSIDL_DESKTOP:
*ppidl = _ILCreateDesktop();
break;
case CSIDL_PERSONAL:
*ppidl = _ILCreateMyDocuments();
break;
case CSIDL_INTERNET:
*ppidl = _ILCreateIExplore();
break;
case CSIDL_CONTROLS:
*ppidl = _ILCreateControlPanel();
break;
case CSIDL_PRINTERS:
*ppidl = _ILCreatePrinters();
break;
case CSIDL_BITBUCKET:
*ppidl = _ILCreateBitBucket();
break;
case CSIDL_DRIVES:
*ppidl = _ILCreateMyComputer();
break;
case CSIDL_NETWORK:
*ppidl = _ILCreateNetwork();
break;
default:
{
char szPath[MAX_PATH];
hr = SHGetFolderPathA_new(hwndOwner, nFolder, hToken,
SHGFP_TYPE_CURRENT, szPath);
if (SUCCEEDED(hr))
{
DWORD attributes=0;
TRACE("Value=%s\n", debugstr_w(szPath));
hr = SHILCreateFromPathA(szPath, ppidl, &attributes);
}
else if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
{
/* unlike SHGetFolderPath, SHGetFolderLocation in shell32
* version 6.0 returns E_FAIL for nonexistent paths
*/
hr = E_FAIL;
}
}
}
if(*ppidl)
hr = NOERROR;
TRACE("-- (new pidl %p)\n",*ppidl);
return hr;
}
LPITEMIDLIST pidlOut = NULL;
pidlOut = (LPITEMIDLIST) SHAlloc(size + 5);
if(pidlOut)
{
LPPIDLDATA pData;
LPITEMIDLIST pidlNext;
ZeroMemory(pidlOut, size + 5);
pidlOut->mkid.cb = size + 3;
pData = _ILGetDataPointer(pidlOut);
if (pData)
pData->type = type;
pidlNext = ILGetNext(pidlOut);
if (pidlNext)
pidlNext->mkid.cb = 0x00;
TRACE("-- (pidl=%p, size=%u)\n", pidlOut, size);
}
return pidlOut;
}
LPITEMIDLIST _ILCreateDesktop()
{
LPITEMIDLIST ret;
TRACE("()\n");
ret = (LPITEMIDLIST) SHAlloc(2);
if (ret)
ret->mkid.cb = 0;
return ret;
}
LPITEMIDLIST _ILCreateMyComputer()
{
TRACE("()\n");
return _ILCreateGuid(PT_GUID, &CLSID_MyComputer);
}
LPITEMIDLIST _ILCreateMyDocuments()
{
TRACE("()\n");
return _ILCreateGuid(PT_GUID, &CLSID_MyDocuments);
}
LPITEMIDLIST _ILCreateIExplore()
{
TRACE("()\n");
return _ILCreateGuid(PT_GUID, &CLSID_Internet);
}
LPITEMIDLIST _ILCreateControlPanel()
{
LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
TRACE("()\n");
if (parent)
{
LPITEMIDLIST cpl = _ILCreateGuid(PT_SHELLEXT, &CLSID_ControlPanel);
if (cpl)
{
ret = ILCombine(parent, cpl);
SHFree(cpl);
}
SHFree(parent);
}
return ret;
}
LPITEMIDLIST _ILCreatePrinters()
{
LPITEMIDLIST parent = _ILCreateGuid(PT_GUID, &CLSID_MyComputer), ret = NULL;
TRACE("()\n");
if (parent)
{
LPITEMIDLIST printers = _ILCreateGuid(PT_YAGUID, &CLSID_Printers);
if (printers)
{
ret = ILCombine(parent, printers);
SHFree(printers);
}
SHFree(parent);
}
return ret;
}
LPITEMIDLIST _ILCreateNetwork()
{
TRACE("()\n");
return _ILCreateGuid(PT_GUID, &CLSID_NetworkPlaces);
}
LPITEMIDLIST _ILCreateBitBucket()
{
TRACE("()\n");
return _ILCreateGuid(PT_GUID, &CLSID_RecycleBin);
}
LPITEMIDLIST _ILCreateGuid(PIDLTYPE type, const IID *guid)
{
LPITEMIDLIST pidlOut;
if (type == PT_SHELLEXT || type == PT_GUID || type == PT_YAGUID)
{
pidlOut = _ILAlloc(type, sizeof(GUIDStruct));
if (pidlOut)
{
LPPIDLDATA pData = _ILGetDataPointer(pidlOut);
memcpy(&(pData->u.guid.guid), guid, sizeof(GUID));
TRACE("-- create GUID-pidl %s\n",
debugstr_guid(&(pData->u.guid.guid)));
}
}
else
{
WARN("%d: invalid type for GUID\n", type);
pidlOut = NULL;
}
return pidlOut;
}
/**************************************************************************
*
* ### 4. getting pointers to parts of pidls ###
*
**************************************************************************
* _ILGetDataPointer()
*/
LPPIDLDATA _ILGetDataPointer(LPCITEMIDLIST pidl)
{
if(pidl && pidl->mkid.cb != 0x00)
return (LPPIDLDATA) &(pidl->mkid.abID);
return NULL;
}
/*************************************************************************
* SHGetFolderLocation [SHELL32.@]
*
* Gets the folder locations from the registry and creates a pidl.
*
* PARAMS
* hwndOwner [I]
* nFolder [I] CSIDL_xxxxx
* hToken [I] token representing user, or NULL for current user, or -1 for
* default user
* dwReserved [I] must be zero
* ppidl [O] PIDL of a special folder
*
* RETURNS
* Success: S_OK
* Failure: Standard OLE-defined error result, S_FALSE or E_INVALIDARG
*
* NOTES
* Creates missing reg keys and directories.
* Mostly forwards to SHGetFolderPathW, but a few values of nFolder return
* virtual folders that are handled here.
*/
/* MAKE_EXPORT SHGetFolderLocation_new=SHGetFolderLocation */
HRESULT WINAPI SHGetFolderLocation_new(
HWND hwndOwner,
int nFolder,
HANDLE hToken,
DWORD dwReserved,
LPVOID *_ppidl)
{
LPITEMIDLIST *ppidl = (LPITEMIDLIST*) _ppidl;
HRESULT hr = E_INVALIDARG;
TRACE("%p 0x%08x %p 0x%08lx %p\n",
hwndOwner, nFolder, hToken, dwReserved, ppidl);
if (!ppidl)
return E_INVALIDARG;
if (dwReserved)
return E_INVALIDARG;
/* The virtual folders' locations are not user-dependent */
*ppidl = NULL;
switch (nFolder)
{
case CSIDL_DESKTOP:
*ppidl = _ILCreateDesktop();
break;
case CSIDL_PERSONAL:
*ppidl = _ILCreateMyDocuments();
break;
case CSIDL_INTERNET:
*ppidl = _ILCreateIExplore();
break;
case CSIDL_CONTROLS:
*ppidl = _ILCreateControlPanel();
break;
case CSIDL_PRINTERS:
*ppidl = _ILCreatePrinters();
break;
case CSIDL_BITBUCKET:
*ppidl = _ILCreateBitBucket();
break;
case CSIDL_DRIVES:
*ppidl = _ILCreateMyComputer();
break;
case CSIDL_NETWORK:
*ppidl = _ILCreateNetwork();
break;
default:
{
char szPath[MAX_PATH];
hr = SHGetFolderPathA_new(hwndOwner, nFolder, hToken,
SHGFP_TYPE_CURRENT, szPath);
if (SUCCEEDED(hr))
{
DWORD attributes=0;
TRACE("Value=%s\n", debugstr_w(szPath));
hr = SHILCreateFromPath((LPWSTR)szPath, ppidl, &attributes);
}
else if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND))
{
/* unlike SHGetFolderPath, SHGetFolderLocation in shell32
* version 6.0 returns E_FAIL for nonexistent paths
*/
hr = E_FAIL;
}
}
}
if(*ppidl)
hr = NOERROR;
TRACE("-- (new pidl %p)\n",*ppidl);
return hr;
}

34
apilibs/kexbasen/shell32/SHGetFolderPath.c Executable file → Normal file
View File

@ -28,31 +28,31 @@ typedef HRESULT (WINAPI *SHGetFolderPathW_t)(HWND, int, HANDLE, DWORD, LPWSTR);
static SHGetFolderPathA_t SHGetFolderPathA_pfn = (SHGetFolderPathA_t)-1;
static SHGetFolderPathW_t SHGetFolderPathW_pfn = (SHGetFolderPathW_t)-1;
BOOL init_shfolder(void)
{
DWORD lasterr = GetLastError();
HMODULE hShell32 = GetModuleHandle("SHELL32.DLL");
PROC pfn = kexGetProcAddress(hShell32, "SHGetFolderPathA");
if (pfn)
SHGetFolderPathA_pfn = (SHGetFolderPathA_t) pfn;
pfn = kexGetProcAddress(hShell32, "SHGetFolderPathW");
if (pfn)
SHGetFolderPathW_pfn = (SHGetFolderPathW_t) pfn;
SetLastError(lasterr);
return TRUE;
}
static PROC LoadShfolderProc(const char* proc)
{
static const char ShfolderFn[] = "SHFOLDER.DLL";
static const char Shell32Fn[] = "SHELL32.DLL";
static HMODULE hShfolder;
static HMODULE hShell32;
PROC ret = NULL;
DWORD lasterr = GetLastError();
if (!hShfolder)
//first try with shell32
if (!hShell32)
{
hShfolder = GetModuleHandle(ShfolderFn);
if (!hShfolder) hShfolder = LoadLibrary(ShfolderFn);
hShell32 = GetModuleHandle(Shell32Fn);
if (!hShell32) hShell32 = LoadLibrary(Shell32Fn);
}
if (hShell32) ret = kexGetProcAddress(hShell32, proc);
//fallback to shfolder
if (!ret)
{
if (!hShfolder)
{
hShfolder = GetModuleHandle(ShfolderFn);
if (!hShfolder) hShfolder = LoadLibrary(ShfolderFn);
}
if (hShfolder) ret = kexGetProcAddress(hShfolder, proc);
}
SetLastError(lasterr);

4
apilibs/kexbasen/shell32/_shell32_apilist.c Executable file → Normal file
View File

@ -23,11 +23,9 @@
#include "kexcoresdk.h"
#include "_shell32_apilist.h"
extern BOOL init_shfolder(void);
BOOL init_shell32()
{
return init_shfolder();
return TRUE;
}
static const apilib_named_api shell32_named_apis[] =

1
apilibs/kexbasen/shell32/_shell32_apilist.h Executable file → Normal file
View File

@ -22,7 +22,6 @@
#ifndef _SHELL32_APILIST_H
#define _SHELL32_APILIST_H
#include "auxdecl.h"
#include "kexcoresdk.h"
BOOL init_shell32();

0
apilibs/kexbasen/shell32/auxshlguid.h Executable file → Normal file
View File

0
apilibs/kexbasen/shell32/pidl.h Executable file → Normal file
View File

0
apilibs/kexbasen/shell32/unishell32.c Executable file → Normal file
View File

View File

@ -1,8 +0,0 @@
LIBRARY SHELL32.dll
EXPORTS
SHILCreateFromPathA@12 @28 NONAME
SHAlloc@4 @196 NONAME
SHFree@4 @195 NONAME
ILGetNext@4 @153 NONAME
ILCombine@8 @25 NONAME

13
apilibs/kexbasen/unifwd.c Executable file → Normal file
View File

@ -20,6 +20,7 @@
*/
#include <windows.h>
#include <float.h>
#include "unifwd.h"
#include "kexcoresdk.h"
#include "common.h"
@ -28,9 +29,21 @@ static HMODULE hUnicows;
int unifwd_init(void)
{
DWORD lasterror = GetLastError();
hUnicows = GetModuleHandle("UNICOWS.DLL");
if (!hUnicows)
{
//Some DLLs that are loaded in conjunction with
//unicows.dll may blow the FPU's control word.
//Save it here...
unsigned int fpu_cw;
fpu_cw = _control87(0, 0);
hUnicows = LoadLibrary("UNICOWS.DLL");
//...and restore afterwards
if (_control87(0, 0) != fpu_cw)
_control87(fpu_cw, 0xfffff);
}
SetLastError(lasterror);
return (hUnicows != NULL);
}

0
apilibs/kexbasen/unifwd.h Executable file → Normal file
View File

21
apilibs/kexbasen/user32/_user32_apilist.c Executable file → Normal file
View File

@ -33,21 +33,10 @@ static const apilib_named_api user32_named_apis[] =
/*** AUTOGENERATED APILIST NAMED EXPORTS BEGIN ***/
DECL_API("AppendMenuW", AppendMenuW_fwd),
DECL_API("BroadcastSystemMessageW", BroadcastSystemMessageW_fwd),
DECL_API("CallMsgFilterW", CallMsgFilterW_fwd),
DECL_API("CallWindowProcW", CallWindowProcW_fwd),
DECL_API("ChangeDisplaySettingsExW", ChangeDisplaySettingsExW_fwd),
DECL_API("ChangeDisplaySettingsW", ChangeDisplaySettingsW_fwd),
DECL_API("ChangeMenuW", ChangeMenuW_fwd),
DECL_API("CharLowerBuffW", CharLowerBuffW_fwd),
DECL_API("CharLowerW", CharLowerW_fwd),
DECL_API("CharNextW", CharNextW_fwd),
DECL_API("CharPrevW", CharPrevW_fwd),
DECL_API("CharToOemBuffW", CharToOemBuffW_fwd),
DECL_API("CharToOemW", CharToOemW_fwd),
DECL_API("CharUpperBuffW", CharUpperBuffW_fwd),
DECL_API("CharUpperW", CharUpperW_fwd),
DECL_API("CopyAcceleratorTableW", CopyAcceleratorTableW_fwd),
DECL_API("CreateAcceleratorTableW", CreateAcceleratorTableW_fwd),
DECL_API("CreateDialogIndirectParamW", CreateDialogIndirectParamW_fwd),
DECL_API("CreateDialogParamW", CreateDialogParamW_new),
DECL_API("CreateMDIWindowW", CreateMDIWindowW_fwd),
@ -61,7 +50,6 @@ static const apilib_named_api user32_named_apis[] =
DECL_API("DefWindowProcW", DefWindowProcW_new),
DECL_API("DialogBoxIndirectParamW", DialogBoxIndirectParamW_fwd),
DECL_API("DialogBoxParamW", DialogBoxParamW_fwd),
DECL_API("DispatchMessageW", DispatchMessageW_fwd),
DECL_API("DlgDirListComboBoxW", DlgDirListComboBoxW_fwd),
DECL_API("DlgDirListW", DlgDirListW_fwd),
DECL_API("DlgDirSelectComboBoxExW", DlgDirSelectComboBoxExW_fwd),
@ -96,11 +84,6 @@ static const apilib_named_api user32_named_apis[] =
DECL_API("GrayStringW", GrayStringW_fwd),
DECL_API("InsertMenuItemW", InsertMenuItemW_fwd),
DECL_API("InsertMenuW", InsertMenuW_fwd),
DECL_API("IsCharAlphaNumericW", IsCharAlphaNumericW_fwd),
DECL_API("IsCharAlphaW", IsCharAlphaW_fwd),
DECL_API("IsCharLowerW", IsCharLowerW_fwd),
DECL_API("IsCharUpperW", IsCharUpperW_fwd),
DECL_API("IsDialogMessageW", IsDialogMessageW_fwd),
DECL_API("IsWindowUnicode", IsWindowUnicode_fwd),
DECL_API("LoadAcceleratorsW", LoadAcceleratorsW_fwd),
DECL_API("LoadBitmapW", LoadBitmapW_fwd),
@ -115,9 +98,6 @@ static const apilib_named_api user32_named_apis[] =
DECL_API("MapVirtualKeyW", MapVirtualKeyW_fwd),
DECL_API("MessageBoxIndirectW", MessageBoxIndirectW_fwd),
DECL_API("ModifyMenuW", ModifyMenuW_fwd),
DECL_API("OemToCharBuffW", OemToCharBuffW_fwd),
DECL_API("OemToCharW", OemToCharW_fwd),
DECL_API("PeekMessageW", PeekMessageW_fwd),
DECL_API("PostMessageW", PostMessageW_fwd),
DECL_API("PostThreadMessageW", PostThreadMessageW_fwd),
DECL_API("RegisterClassExW", RegisterClassExW_fwd),
@ -141,7 +121,6 @@ static const apilib_named_api user32_named_apis[] =
DECL_API("SetWindowsHookW", SetWindowsHookW_fwd),
DECL_API("SystemParametersInfoW", SystemParametersInfoW_fwd),
DECL_API("TabbedTextOutW", TabbedTextOutW_fwd),
DECL_API("TranslateAcceleratorW", TranslateAcceleratorW_fwd),
DECL_API("UnregisterClassW", UnregisterClassW_fwd),
DECL_API("VkKeyScanExW", VkKeyScanExW_fwd),
DECL_API("VkKeyScanW", VkKeyScanW_fwd),

22
apilibs/kexbasen/user32/_user32_apilist.h Executable file → Normal file
View File

@ -22,7 +22,6 @@
#ifndef _USER32_APILIST_H
#define _USER32_APILIST_H
#include "auxdecl.h"
#include "kexcoresdk.h"
BOOL init_user32();
@ -31,21 +30,10 @@ extern const apilib_api_table apitable_user32;
/*** AUTOGENERATED APILIST DECLARATIONS BEGIN ***/
FWDPROC AppendMenuW_fwd;
FWDPROC BroadcastSystemMessageW_fwd;
FWDPROC CallMsgFilterW_fwd;
FWDPROC CallWindowProcW_fwd;
FWDPROC ChangeDisplaySettingsExW_fwd;
FWDPROC ChangeDisplaySettingsW_fwd;
FWDPROC ChangeMenuW_fwd;
FWDPROC CharLowerBuffW_fwd;
FWDPROC CharLowerW_fwd;
FWDPROC CharNextW_fwd;
FWDPROC CharPrevW_fwd;
FWDPROC CharToOemBuffW_fwd;
FWDPROC CharToOemW_fwd;
FWDPROC CharUpperBuffW_fwd;
FWDPROC CharUpperW_fwd;
FWDPROC CopyAcceleratorTableW_fwd;
FWDPROC CreateAcceleratorTableW_fwd;
FWDPROC CreateDialogIndirectParamW_fwd;
FWDPROC CreateMDIWindowW_fwd;
FWDPROC CreateWindowExW_fwd;
@ -57,7 +45,6 @@ FWDPROC DefFrameProcW_fwd;
FWDPROC DefMDIChildProcW_fwd;
FWDPROC DialogBoxIndirectParamW_fwd;
FWDPROC DialogBoxParamW_fwd;
FWDPROC DispatchMessageW_fwd;
FWDPROC DlgDirListComboBoxW_fwd;
FWDPROC DlgDirListW_fwd;
FWDPROC DlgDirSelectComboBoxExW_fwd;
@ -92,11 +79,6 @@ FWDPROC GetWindowTextW_fwd;
FWDPROC GrayStringW_fwd;
FWDPROC InsertMenuItemW_fwd;
FWDPROC InsertMenuW_fwd;
FWDPROC IsCharAlphaNumericW_fwd;
FWDPROC IsCharAlphaW_fwd;
FWDPROC IsCharLowerW_fwd;
FWDPROC IsCharUpperW_fwd;
FWDPROC IsDialogMessageW_fwd;
FWDPROC IsWindowUnicode_fwd;
FWDPROC LoadAcceleratorsW_fwd;
FWDPROC LoadBitmapW_fwd;
@ -111,9 +93,6 @@ FWDPROC MapVirtualKeyExW_fwd;
FWDPROC MapVirtualKeyW_fwd;
FWDPROC MessageBoxIndirectW_fwd;
FWDPROC ModifyMenuW_fwd;
FWDPROC OemToCharBuffW_fwd;
FWDPROC OemToCharW_fwd;
FWDPROC PeekMessageW_fwd;
FWDPROC PostMessageW_fwd;
FWDPROC PostThreadMessageW_fwd;
FWDPROC RegisterClassExW_fwd;
@ -137,7 +116,6 @@ FWDPROC SetWindowsHookW_fwd;
FWDPROC SetWindowTextW_fwd;
FWDPROC SystemParametersInfoW_fwd;
FWDPROC TabbedTextOutW_fwd;
FWDPROC TranslateAcceleratorW_fwd;
FWDPROC UnregisterClassW_fwd;
FWDPROC VkKeyScanExW_fwd;
FWDPROC VkKeyScanW_fwd;

21
apilibs/kexbasen/user32/uniuser32.c Executable file → Normal file
View File

@ -25,21 +25,10 @@
FORWARD_TO_UNICOWS(AppendMenuW);
FORWARD_TO_UNICOWS(BroadcastSystemMessageW);
FORWARD_TO_UNICOWS(CallMsgFilterW);
FORWARD_TO_UNICOWS(CallWindowProcW);
FORWARD_TO_UNICOWS(ChangeDisplaySettingsExW);
FORWARD_TO_UNICOWS(ChangeDisplaySettingsW);
FORWARD_TO_UNICOWS(ChangeMenuW);
FORWARD_TO_UNICOWS(CharLowerBuffW);
FORWARD_TO_UNICOWS(CharLowerW);
FORWARD_TO_UNICOWS(CharNextW);
FORWARD_TO_UNICOWS(CharPrevW);
FORWARD_TO_UNICOWS(CharToOemBuffW);
FORWARD_TO_UNICOWS(CharToOemW);
FORWARD_TO_UNICOWS(CharUpperBuffW);
FORWARD_TO_UNICOWS(CharUpperW);
FORWARD_TO_UNICOWS(CopyAcceleratorTableW);
FORWARD_TO_UNICOWS(CreateAcceleratorTableW);
FORWARD_TO_UNICOWS(CreateDialogIndirectParamW);
static BOOL CALLBACK SetUnicode(HWND hwnd, LPARAM lParam)
@ -80,7 +69,6 @@ LRESULT WINAPI DefWindowProcW_new(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPa
FORWARD_TO_UNICOWS(DialogBoxIndirectParamW);
FORWARD_TO_UNICOWS(DialogBoxParamW);
FORWARD_TO_UNICOWS(DispatchMessageW);
FORWARD_TO_UNICOWS(DlgDirListComboBoxW);
FORWARD_TO_UNICOWS(DlgDirListW);
FORWARD_TO_UNICOWS(DlgDirSelectComboBoxExW);
@ -115,11 +103,6 @@ FORWARD_TO_UNICOWS(GetWindowTextW);
FORWARD_TO_UNICOWS(GrayStringW);
FORWARD_TO_UNICOWS(InsertMenuItemW);
FORWARD_TO_UNICOWS(InsertMenuW);
FORWARD_TO_UNICOWS(IsCharAlphaNumericW);
FORWARD_TO_UNICOWS(IsCharAlphaW);
FORWARD_TO_UNICOWS(IsCharLowerW);
FORWARD_TO_UNICOWS(IsCharUpperW);
FORWARD_TO_UNICOWS(IsDialogMessageW);
FORWARD_TO_UNICOWS(IsWindowUnicode);
FORWARD_TO_UNICOWS(LoadAcceleratorsW);
FORWARD_TO_UNICOWS(LoadBitmapW);
@ -134,9 +117,6 @@ FORWARD_TO_UNICOWS(MapVirtualKeyExW);
FORWARD_TO_UNICOWS(MapVirtualKeyW);
FORWARD_TO_UNICOWS(MessageBoxIndirectW);
FORWARD_TO_UNICOWS(ModifyMenuW);
FORWARD_TO_UNICOWS(OemToCharBuffW);
FORWARD_TO_UNICOWS(OemToCharW);
FORWARD_TO_UNICOWS(PeekMessageW);
FORWARD_TO_UNICOWS(PostMessageW);
FORWARD_TO_UNICOWS(PostThreadMessageW);
FORWARD_TO_UNICOWS(RegisterClassExW);
@ -160,7 +140,6 @@ FORWARD_TO_UNICOWS(SetWindowsHookW);
FORWARD_TO_UNICOWS(SetWindowTextW);
FORWARD_TO_UNICOWS(SystemParametersInfoW);
FORWARD_TO_UNICOWS(TabbedTextOutW);
FORWARD_TO_UNICOWS(TranslateAcceleratorW);
FORWARD_TO_UNICOWS(UnregisterClassW);
FORWARD_TO_UNICOWS(VkKeyScanExW);
FORWARD_TO_UNICOWS(VkKeyScanW);

View File

@ -0,0 +1,70 @@
/*
* KernelEx
* Copyright (C) 2009, 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"
/* MAKE_EXPORT GetDefaultPrinterA=GetDefaultPrinterA */
BOOL WINAPI GetDefaultPrinterA(LPSTR buf, LPDWORD size)
{
DWORD needed, returned;
BOOL ret;
DWORD len;
EnumPrinters(PRINTER_ENUM_DEFAULT, NULL, 1, NULL, 0, &needed, &returned);
if (needed == 0)
{
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
}
PRINTER_INFO_1* ppi = (PRINTER_INFO_1*) alloca(needed);
ret = EnumPrinters(PRINTER_ENUM_DEFAULT, NULL, 1, (BYTE*) ppi, needed, &needed, &returned);
if (!ret)
{
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
}
len = strlen(ppi->pName);
if (len >= *size)
{
*size = len + 1;
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return FALSE;
}
strcpy(buf, ppi->pName);
*size = len + 1;
return TRUE;
}
/* MAKE_EXPORT GetDefaultPrinterW=GetDefaultPrinterW */
BOOL WINAPI GetDefaultPrinterW(LPWSTR bufW, LPDWORD sizeW)
{
BOOL ret;
DWORD sizeA = *sizeW;
ALLOC_A(buf, sizeA);
ret = GetDefaultPrinterA(bufA, &sizeA);
if (ret)
{
*sizeW = ABUFtoW(buf, sizeA, *sizeW);
if (!ret)
*sizeW = ABUFtoW(buf, sizeA, 0);
}
return FALSE;
}

View File

@ -0,0 +1,47 @@
/*
* KernelEx
* Copyright (C) 2009, 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 "kexcoresdk.h"
#include "_winspool_apilist.h"
BOOL init_winspool()
{
return TRUE;
}
static const apilib_named_api winspool_named_apis[] =
{
/*** AUTOGENERATED APILIST NAMED EXPORTS BEGIN ***/
DECL_API("GetDefaultPrinterA", GetDefaultPrinterA),
DECL_API("GetDefaultPrinterW", GetDefaultPrinterW),
/*** AUTOGENERATED APILIST NAMED EXPORTS END ***/
};
#if 0
static const apilib_unnamed_api winspool_ordinal_apis[] =
{
/*** AUTOGENERATED APILIST ORDINAL EXPORTS BEGIN ***/
/*** AUTOGENERATED APILIST ORDINAL EXPORTS END ***/
};
#endif
const apilib_api_table apitable_winspool = DECL_TAB("WINSPOOL.DRV", winspool_named_apis, 0 /*winspool_ordinal_apis*/);

View File

@ -0,0 +1,35 @@
/*
* KernelEx
* Copyright (C) 2009, 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.
*
*/
#ifndef _WINSPOOL_APILIST_H
#define _WINSPOOL_APILIST_H
#include "kexcoresdk.h"
BOOL init_winspool();
extern const apilib_api_table apitable_winspool;
/*** AUTOGENERATED APILIST DECLARATIONS BEGIN ***/
BOOL WINAPI GetDefaultPrinterA(LPSTR buf, LPDWORD size);
BOOL WINAPI GetDefaultPrinterW(LPWSTR bufW, LPDWORD sizeW);
/*** AUTOGENERATED APILIST DECLARATIONS END ***/
#endif