mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:25:39 +00:00
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:
parent
1adba33d1e
commit
96fc91c2b8
3 changed files with 82 additions and 70 deletions
|
@ -32,6 +32,7 @@
|
||||||
<file>brush.c</file>
|
<file>brush.c</file>
|
||||||
<file>coord.c</file>
|
<file>coord.c</file>
|
||||||
<file>dc.c</file>
|
<file>dc.c</file>
|
||||||
|
<file>eng.c</file>
|
||||||
<file>enhmfile.c</file>
|
<file>enhmfile.c</file>
|
||||||
<file>font.c</file>
|
<file>font.c</file>
|
||||||
<file>linedda.c</file>
|
<file>linedda.c</file>
|
||||||
|
|
|
@ -2445,15 +2445,7 @@ CreateBitmap(
|
||||||
return NtGdiCreateBitmap(Width, Height, Planes, BitsPixel, (LPBYTE) pUnsafeBits);
|
return NtGdiCreateBitmap(Width, Height, Planes, BitsPixel, (LPBYTE) pUnsafeBits);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @implemented
|
|
||||||
*/
|
|
||||||
VOID
|
|
||||||
STDCALL
|
|
||||||
EngAcquireSemaphore ( IN HSEMAPHORE hsem )
|
|
||||||
{
|
|
||||||
RtlEnterCriticalSection((PRTL_CRITICAL_SECTION)hsem);
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* @unimplemented
|
* @unimplemented
|
||||||
*/
|
*/
|
||||||
|
@ -2465,67 +2457,6 @@ EngComputeGlyphSet(INT nCodePage,INT nFirstChar,INT cChars)
|
||||||
return 0;
|
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
|
* @implemented
|
||||||
|
|
80
reactos/dll/win32/gdi32/objects/eng.c
Normal file
80
reactos/dll/win32/gdi32/objects/eng.c
Normal 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;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue