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.
 

svn path=/trunk/; revision=28542
This commit is contained in:
Magnus Olsen 2007-08-25 14:07:00 +00:00
parent 1adba33d1e
commit 96fc91c2b8
3 changed files with 82 additions and 70 deletions

View file

@ -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>

View file

@ -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

View file

@ -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;
}