ReactOS 0.4.15-dev-5666-gc548b97
eng.c File Reference
#include <precomp.h>
Include dependency graph for eng.c:

Go to the source code of this file.

Functions

VOID WINAPI EngAcquireSemaphore (IN HSEMAPHORE hsem)
 
BOOL copy_my_glyphset (FD_GLYPHSET *dst_glyphset, FD_GLYPHSET *src_glyphset, ULONG Size)
 
FD_GLYPHSET *WINAPI EngComputeGlyphSet (INT nCodePage, INT nFirstChar, INT cChars)
 
HSEMAPHORE WINAPI EngCreateSemaphore (VOID)
 
VOID WINAPI EngDeleteSemaphore (IN HSEMAPHORE hsem)
 
PVOID WINAPI EngFindResource (HANDLE h, int iName, int iType, PULONG pulSize)
 
VOID WINAPI EngFreeModule (HANDLE h)
 
VOID WINAPI EngGetCurrentCodePage (OUT PUSHORT OemCodePage, OUT PUSHORT AnsiCodePage)
 
LPWSTR WINAPI EngGetDriverName (HDEV hdev)
 
LPWSTR WINAPI EngGetPrinterDataFileName (HDEV hdev)
 
HANDLE WINAPI EngLoadModule (LPWSTR pwsz)
 
INT WINAPI EngMultiByteToWideChar (UINT CodePage, LPWSTR WideCharString, INT BytesInWideCharString, LPSTR MultiByteString, INT BytesInMultiByteString)
 
VOID WINAPI EngQueryLocalTime (PENG_TIME_FIELDS etf)
 
VOID WINAPI EngReleaseSemaphore (IN HSEMAPHORE hsem)
 
INT WINAPI EngWideCharToMultiByte (UINT CodePage, LPWSTR WideCharString, INT BytesInWideCharString, LPSTR MultiByteString, INT BytesInMultiByteString)
 
ULONG *WINAPI XLATEOBJ_piVector (XLATEOBJ *XlateObj)
 

Function Documentation

◆ copy_my_glyphset()

BOOL copy_my_glyphset ( FD_GLYPHSET dst_glyphset,
FD_GLYPHSET src_glyphset,
ULONG  Size 
)

Definition at line 26 of file eng.c.

27{
28 BOOL retValue = FALSE;
29
30 memcpy(src_glyphset, dst_glyphset, Size);
31 if (src_glyphset->cRuns == 0)
32 {
33 retValue = TRUE;
34 }
35
36 /* FIXME copy wrun */
37 return retValue;
38}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
ULONG cRuns
Definition: winddi.h:644
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

Referenced by EngComputeGlyphSet().

◆ EngAcquireSemaphore()

VOID WINAPI EngAcquireSemaphore ( IN HSEMAPHORE  hsem)

Definition at line 16 of file eng.c.

17{
19}
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)

◆ EngComputeGlyphSet()

FD_GLYPHSET *WINAPI EngComputeGlyphSet ( INT  nCodePage,
INT  nFirstChar,
INT  cChars 
)

Definition at line 45 of file eng.c.

46{
47 FD_GLYPHSET * ntfd_glyphset;
48 FD_GLYPHSET * myfd_glyphset = NULL;
49
50 ntfd_glyphset = NtGdiEngComputeGlyphSet(nCodePage,nFirstChar,cChars);
51
52 if (ntfd_glyphset)
53 {
54 if (ntfd_glyphset->cjThis)
55 {
56 myfd_glyphset = GlobalAlloc(0,ntfd_glyphset->cjThis);
57 if (myfd_glyphset)
58 {
59 if (copy_my_glyphset(myfd_glyphset,ntfd_glyphset,ntfd_glyphset->cjThis) == FALSE)
60 {
61 GlobalFree(myfd_glyphset);
62 myfd_glyphset = NULL;
63 }
64 }
65 }
66 }
67 return myfd_glyphset;
68}
#define NULL
Definition: types.h:112
BOOL copy_my_glyphset(FD_GLYPHSET *dst_glyphset, FD_GLYPHSET *src_glyphset, ULONG Size)
Definition: eng.c:26
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
__kernel_entry W32KAPI FD_GLYPHSET *APIENTRY NtGdiEngComputeGlyphSet(_In_ INT nCodePage, _In_ INT nFirstChar, _In_ INT cChars)
Definition: umpdstubs.c:142
ULONG cjThis
Definition: winddi.h:641
_In_ INT nFirstChar
Definition: winddi.h:1485

◆ EngCreateSemaphore()

HSEMAPHORE WINAPI EngCreateSemaphore ( VOID  )

Definition at line 75 of file eng.c.

76{
78 if (!CritSect)
79 {
80 return NULL;
81 }
82
84 return (HSEMAPHORE)CritSect;
85}
static CRITICAL_SECTION CritSect
DWORD_PTR HSEMAPHORE
Definition: axcore.idl:60
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
#define GetProcessHeap()
Definition: compat.h:736
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)

Referenced by DdHmgCreate(), DxDdStartupDxGraphics(), DxEngLockShareSem(), EngInitializeSafeSemaphore(), InitDeviceImpl(), InitLDEVImpl(), InitPDEVImpl(), PDEVOBJ_AllocPDEV(), Test_EngAcquireSemaphore(), Test_EngCreateSemaphore(), and Test_EngReleaseSemaphore().

◆ EngDeleteSemaphore()

VOID WINAPI EngDeleteSemaphore ( IN HSEMAPHORE  hsem)

Definition at line 92 of file eng.c.

93{
94 if (hsem)
95 {
97 RtlFreeHeap( GetProcessHeap(), 0, hsem );
98 }
99}
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)

◆ EngFindResource()

PVOID WINAPI EngFindResource ( HANDLE  h,
int  iName,
int  iType,
PULONG  pulSize 
)

Definition at line 105 of file eng.c.

109{
110 HRSRC HRSrc;
111 DWORD Size = 0;
112 HGLOBAL Hg;
113 LPVOID Lock = NULL;
114
116 if (HRSrc != NULL)
117 {
118 Size = SizeofResource((HMODULE)h, HRSrc);
119 if (Size != 0)
120 {
121 Hg = LoadResource((HMODULE)h, HRSrc);
122 if (Hg != NULL)
123 {
124 Lock = LockResource( Hg );
125 }
126 }
127 }
128
129 *pulSize = Size;
130 return (PVOID) Lock;
131}
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
unsigned long DWORD
Definition: ntddk_ex.h:95
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
_Check_return_ _Out_ PULONG pulSize
Definition: winddi.h:2120
_In_ ULONG iType
Definition: winddi.h:3748
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ EngFreeModule()

VOID WINAPI EngFreeModule ( HANDLE  h)

Definition at line 137 of file eng.c.

138{
139 FreeLibrary(h);
140}
#define FreeLibrary(x)
Definition: compat.h:748

◆ EngGetCurrentCodePage()

VOID WINAPI EngGetCurrentCodePage ( OUT PUSHORT  OemCodePage,
OUT PUSHORT  AnsiCodePage 
)

Definition at line 147 of file eng.c.

149{
151 *AnsiCodePage = GetACP();
152}
static CODEPAGE_ENTRY AnsiCodePage
Definition: nls.c:46
static CODEPAGE_ENTRY OemCodePage
Definition: nls.c:47
UINT WINAPI GetACP(void)
Definition: nls.c:2307
UINT WINAPI GetOEMCP(void)
Definition: nls.c:2322

◆ EngGetDriverName()

LPWSTR WINAPI EngGetDriverName ( HDEV  hdev)

Definition at line 159 of file eng.c.

160{
161 // DHPDEV from NtGdiGetDhpdev must be from print driver.
163
164 if (!pPDev) return NULL;
165
166 if (pPDev->Sig != PDEV_UMPD_ID)
167 {
168 pPDev = (PUMPDEV)pPDev->Sig;
169 }
170 return pPDev->pdi5Info->pDriverPath;
171}
#define PDEV_UMPD_ID
Definition: gdi32p.h:149
struct _UMPDEV * PUMPDEV
__kernel_entry W32KAPI DHPDEV APIENTRY NtGdiGetDhpdev(_In_ HDEV hdev)
LPWSTR pDriverPath
Definition: winspool.h:480
DWORD_PTR Sig
Definition: gdi32p.h:155
PDRIVER_INFO_5W pdi5Info
Definition: gdi32p.h:157
_In_ HDEV hdev
Definition: winddi.h:3449

◆ EngGetPrinterDataFileName()

LPWSTR WINAPI EngGetPrinterDataFileName ( HDEV  hdev)

Definition at line 177 of file eng.c.

178{
180
181 if (!pPDev) return NULL;
182
183 if (pPDev->Sig != PDEV_UMPD_ID)
184 {
185 pPDev = (PUMPDEV)pPDev->Sig;
186 }
187 return pPDev->pdi5Info->pDataFile;
188}
LPWSTR pDataFile
Definition: winspool.h:481

◆ EngLoadModule()

HANDLE WINAPI EngLoadModule ( LPWSTR  pwsz)

Definition at line 194 of file eng.c.

195{
197}
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:342

◆ EngMultiByteToWideChar()

INT WINAPI EngMultiByteToWideChar ( UINT  CodePage,
LPWSTR  WideCharString,
INT  BytesInWideCharString,
LPSTR  MultiByteString,
INT  BytesInMultiByteString 
)

Definition at line 203 of file eng.c.

208{
209 return MultiByteToWideChar(CodePage,0,MultiByteString,BytesInMultiByteString,WideCharString,BytesInWideCharString / sizeof(WCHAR));
210}
#define MultiByteToWideChar
Definition: compat.h:110
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG _In_ ULONG BytesInMultiByteString
Definition: rtlfuncs.h:2564
*BytesInMultiByteString PCHAR MultiByteString
Definition: rtlfuncs.h:1527
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ EngQueryLocalTime()

VOID WINAPI EngQueryLocalTime ( PENG_TIME_FIELDS  etf)

Definition at line 216 of file eng.c.

217{
218 SYSTEMTIME SystemTime;
219 GetLocalTime( &SystemTime );
220 etf->usYear = SystemTime.wYear;
221 etf->usMonth = SystemTime.wMonth;
222 etf->usWeekday = SystemTime.wDayOfWeek;
223 etf->usDay = SystemTime.wDay;
224 etf->usHour = SystemTime.wHour;
225 etf->usMinute = SystemTime.wMinute;
226 etf->usSecond = SystemTime.wSecond;
227 etf->usMilliseconds = SystemTime.wMilliseconds;
228}
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
WORD wYear
Definition: winbase.h:905
WORD wMilliseconds
Definition: winbase.h:912
WORD wMonth
Definition: winbase.h:906
WORD wHour
Definition: winbase.h:909
WORD wSecond
Definition: winbase.h:911
WORD wMinute
Definition: winbase.h:910
WORD wDay
Definition: winbase.h:908
WORD wDayOfWeek
Definition: winbase.h:907

◆ EngReleaseSemaphore()

◆ EngWideCharToMultiByte()

INT WINAPI EngWideCharToMultiByte ( UINT  CodePage,
LPWSTR  WideCharString,
INT  BytesInWideCharString,
LPSTR  MultiByteString,
INT  BytesInMultiByteString 
)

Definition at line 245 of file eng.c.

250{
251 return WideCharToMultiByte(CodePage, 0, WideCharString, (BytesInWideCharString/sizeof(WCHAR)),
253}
#define WideCharToMultiByte
Definition: compat.h:111

◆ XLATEOBJ_piVector()

ULONG *WINAPI XLATEOBJ_piVector ( XLATEOBJ XlateObj)

Definition at line 260 of file eng.c.

261{
262 return XlateObj->pulXlate;
263}
ULONG * pulXlate
Definition: winddi.h:1260