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

31
apilibs/kexbases/Gdi32/TextOut.c Normal file → Executable file
View File

@ -28,8 +28,7 @@
#include <windows.h>
#include <malloc.h>
#include "gdi9x.h"
#include "k32ord.h"
#include "GdiObjects.h"
#ifdef _MSC_VER
#ifdef __cplusplus
@ -42,11 +41,6 @@ __declspec(selectany) int _fltused=1;
#define ETO_PDY 0x2000
#endif
static DWORD g_GdiBase;
#define REBASEGDI(x) ( g_GdiBase + (DWORD)(x) )
/* MAKE_EXPORT GetFontUnicodeRanges_new=GetFontUnicodeRanges */
DWORD WINAPI GetFontUnicodeRanges_new(
HDC hdc,
@ -93,29 +87,6 @@ int WINAPI GetRandomRgn_NT(
return result;
}
PDCOBJ GetDCObj( HDC hDC )
{
PDCOBJ retobj;
PLHENTRY entry;
if (!hDC) return NULL;
if (!g_GdiBase) g_GdiBase = MapSL( LoadLibrary16("gdi") << 16 );
entry = (PLHENTRY)REBASEGDI(LOWORD(hDC));
if ( !entry->wBlock || entry->bFlags == LHE_FREEHANDLE ) return NULL;
if ( entry->bFlags & LHE_DISCARDED )
{
if ( entry->wBlock & 3 ) return NULL; //32-bit handles have to divide by 4
DWORD* highDC = (DWORD*)REBASEGDI( 0x10000 + entry->wBlock );
if ( IsBadReadPtr(highDC,sizeof(DWORD)) ) return NULL; //oops dead handle
retobj = (PDCOBJ)REBASEGDI(*highDC);
if ( IsBadReadPtr(retobj,sizeof(DCOBJ)) ) return NULL; //oops?!
}
else
retobj = (PDCOBJ)REBASEGDI(entry->wBlock);
WORD checktype = (retobj->wType & GDI_OBJTYPE_MASK);
if ( checktype != GDI_OBJTYPE_DC && checktype != GDI_OBJTYPE_DC_NO ) return NULL;
return retobj;
}
void floattofrac( float f, int* m, int* d)
{
float absf = f > 0 ? f : -f;