diff --git a/reactos/dll/win32/gdi32/gdi32.rbuild b/reactos/dll/win32/gdi32/gdi32.rbuild index 1f660b7000a..f36b5fd8e48 100644 --- a/reactos/dll/win32/gdi32/gdi32.rbuild +++ b/reactos/dll/win32/gdi32/gdi32.rbuild @@ -32,6 +32,7 @@ brush.c coord.c dc.c + eng.c enhmfile.c font.c linedda.c diff --git a/reactos/dll/win32/gdi32/misc/stubs.c b/reactos/dll/win32/gdi32/misc/stubs.c index f68ab515cfc..97f5eb41a28 100644 --- a/reactos/dll/win32/gdi32/misc/stubs.c +++ b/reactos/dll/win32/gdi32/misc/stubs.c @@ -2445,15 +2445,7 @@ CreateBitmap( return NtGdiCreateBitmap(Width, Height, Planes, BitsPixel, (LPBYTE) pUnsafeBits); } -/* - * @implemented - */ -VOID -STDCALL -EngAcquireSemaphore ( IN HSEMAPHORE hsem ) -{ - RtlEnterCriticalSection((PRTL_CRITICAL_SECTION)hsem); -} + /* * @unimplemented */ @@ -2465,67 +2457,6 @@ EngComputeGlyphSet(INT nCodePage,INT nFirstChar,INT cChars) return 0; } -/* - * @unimplemented - */ -HSEMAPHORE -STDCALL -EngCreateSemaphore ( VOID ) -{ - PRTL_CRITICAL_SECTION CritSect = RtlAllocateHeap(GetProcessHeap(), 0, sizeof(RTL_CRITICAL_SECTION)); - if (!CritSect) return NULL; - RtlInitializeCriticalSection( CritSect ); - return (HSEMAPHORE)CritSect; -} - - - - - -/* - * @unimplemented - */ -VOID -STDCALL -EngDeleteSemaphore ( IN HSEMAPHORE hsem ) -{ - if (!hsem) return; - - RtlDeleteCriticalSection( (PRTL_CRITICAL_SECTION) hsem ); - RtlFreeHeap( GetProcessHeap(), 0, hsem ); -} - - - - - - - -/* - * @unimplemented - */ -PVOID STDCALL -EngFindResource(HANDLE h, - int iName, - int iType, - PULONG pulSize) -{ - HRSRC HRSrc; - DWORD Size; - HGLOBAL Hg; - LPVOID Lock; - - if (!(HRSrc = FindResourceW( (HMODULE) h, - MAKEINTRESOURCEW(iName), - MAKEINTRESOURCEW(iType) - ))) - return NULL; - if (!(Size = SizeofResource( (HMODULE) h, HRSrc ))) return NULL; - if (!(Hg = LoadResource( (HMODULE) h, HRSrc ))) return NULL; - Lock = LockResource( Hg ); - pulSize = (PULONG) Size; - return (PVOID) Lock; -} /* * @implemented diff --git a/reactos/dll/win32/gdi32/objects/eng.c b/reactos/dll/win32/gdi32/objects/eng.c new file mode 100644 index 00000000000..67a198a46eb --- /dev/null +++ b/reactos/dll/win32/gdi32/objects/eng.c @@ -0,0 +1,80 @@ +/* $Id: stubs.c 28533 2007-08-24 22:44:36Z greatlrd $ + * + * reactos/lib/gdi32/misc/eng.c + * + * GDI32.DLL eng part + * + * + */ + +#include "precomp.h" + +/* + * @implemented + */ +VOID +STDCALL +EngAcquireSemaphore ( IN HSEMAPHORE hsem ) +{ + RtlEnterCriticalSection((PRTL_CRITICAL_SECTION)hsem); +} + +/* + * @implemented + */ +HSEMAPHORE +STDCALL +EngCreateSemaphore ( VOID ) +{ + PRTL_CRITICAL_SECTION CritSect = RtlAllocateHeap(GetProcessHeap(), 0, sizeof(RTL_CRITICAL_SECTION)); + if (!CritSect) + { + return NULL; + } + + RtlInitializeCriticalSection( CritSect ); + return (HSEMAPHORE)CritSect; +} + +/* + * @implemented + */ +VOID +STDCALL +EngDeleteSemaphore ( IN HSEMAPHORE hsem ) +{ + if (!hsem) return; + + RtlDeleteCriticalSection( (PRTL_CRITICAL_SECTION) hsem ); + RtlFreeHeap( GetProcessHeap(), 0, hsem ); +} + +/* + * @implemented + */ +PVOID STDCALL +EngFindResource(HANDLE h, + int iName, + int iType, + PULONG pulSize) +{ + HRSRC HRSrc; + DWORD Size = 0; + HGLOBAL Hg; + LPVOID Lock = NULL; + + if ((HRSrc = FindResourceW( (HMODULE) h, MAKEINTRESOURCEW(iName), MAKEINTRESOURCEW(iType)))) + { + if ((Size = SizeofResource( (HMODULE) h, HRSrc ))) + { + if ((Hg = LoadResource( (HMODULE) h, HRSrc ))) + { + Lock = LockResource( Hg ); + } + } + } + + *pulSize = Size; + return (PVOID) Lock; +} +