Author: greatlrd Date: Sat Aug 25 18:07:00 2007 New Revision: 28542
URL: http://svn.reactos.org/svn/reactos?rev=28542&view=rev Log: add a new file call eng.c remove EngAcquireSemaphore, EngCreateSemaphore, EngDeleteSemaphore, EngFindResource implement from stub.c to eng.c rewrite smaller part of EngFindResource so it works likes windows xp.
Added: trunk/reactos/dll/win32/gdi32/objects/eng.c (with props) Modified: trunk/reactos/dll/win32/gdi32/gdi32.rbuild trunk/reactos/dll/win32/gdi32/misc/stubs.c
Modified: trunk/reactos/dll/win32/gdi32/gdi32.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/gdi32.rbuil... ============================================================================== --- trunk/reactos/dll/win32/gdi32/gdi32.rbuild (original) +++ trunk/reactos/dll/win32/gdi32/gdi32.rbuild Sat Aug 25 18:07:00 2007 @@ -32,6 +32,7 @@ <file>brush.c</file> <file>coord.c</file> <file>dc.c</file> + <file>eng.c</file> <file>enhmfile.c</file> <file>font.c</file> <file>linedda.c</file>
Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs.... ============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c Sat Aug 25 18:07:00 2007 @@ -2445,15 +2445,7 @@ 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 @@ 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
Added: trunk/reactos/dll/win32/gdi32/objects/eng.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/eng... ============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/eng.c (added) +++ trunk/reactos/dll/win32/gdi32/objects/eng.c Sat Aug 25 18:07:00 2007 @@ -1,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; +} +
Propchange: trunk/reactos/dll/win32/gdi32/objects/eng.c ------------------------------------------------------------------------------ svn:eol-style = native