ReactOS  0.4.14-dev-49-gfb4591c
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
ULONG cRuns
Definition: winddi.h:644
unsigned int BOOL
Definition: ntddk_ex.h:94
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359

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 }
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
_In_ INT nFirstChar
Definition: winddi.h:1485
BOOL copy_my_glyphset(FD_GLYPHSET *dst_glyphset, FD_GLYPHSET *src_glyphset, ULONG Size)
Definition: eng.c:26
smooth NULL
Definition: ftsmooth.c:416
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
__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

◆ 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 }
CRITICAL_SECTION CritSect
smooth NULL
Definition: ftsmooth.c:416
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
#define GetProcessHeap()
Definition: compat.h:395
DWORD_PTR HSEMAPHORE
Definition: axcore.idl:60
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
#define GetProcessHeap()
Definition: compat.h:395
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 }
_In_ ULONG iType
Definition: winddi.h:3748
_Check_return_ _Out_ PULONG pulSize
Definition: winddi.h:2120
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#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 }
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define FreeLibrary(x)
Definition: compat.h:405

◆ EngGetCurrentCodePage()

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

Definition at line 147 of file eng.c.

149 {
150  *OemCodePage = GetOEMCP();
151  *AnsiCodePage = GetACP();
152 }
static CODEPAGE_ENTRY AnsiCodePage
Definition: nls.c:46
UINT WINAPI GetACP(VOID)
Definition: nls.c:2169
static CODEPAGE_ENTRY OemCodePage
Definition: nls.c:47
UINT WINAPI GetOEMCP(VOID)
Definition: nls.c:2184

◆ 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 }
LPWSTR pDriverPath
Definition: winspool.h:480
PDRIVER_INFO_5W pdi5Info
Definition: gdi32p.h:157
struct _UMPDEV * PUMPDEV
smooth NULL
Definition: ftsmooth.c:416
DWORD_PTR Sig
Definition: gdi32p.h:155
#define PDEV_UMPD_ID
Definition: gdi32p.h:149
_In_ HDEV hdev
Definition: winddi.h:3449
__kernel_entry W32KAPI DHPDEV APIENTRY NtGdiGetDhpdev(_In_ HDEV hdev)

◆ 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 }
PDRIVER_INFO_5W pdi5Info
Definition: gdi32p.h:157
struct _UMPDEV * PUMPDEV
smooth NULL
Definition: ftsmooth.c:416
LPWSTR pDataFile
Definition: winspool.h:481
DWORD_PTR Sig
Definition: gdi32p.h:155
#define PDEV_UMPD_ID
Definition: gdi32p.h:149
_In_ HDEV hdev
Definition: winddi.h:3449
__kernel_entry W32KAPI DHPDEV APIENTRY NtGdiGetDhpdev(_In_ HDEV hdev)

◆ 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
smooth NULL
Definition: ftsmooth.c:416
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:338

◆ 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 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
*BytesInMultiByteString PCHAR MultiByteString
Definition: rtlfuncs.h:1528
#define MultiByteToWideChar
Definition: compat.h:100
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG _In_ ULONG BytesInMultiByteString
Definition: rtlfuncs.h:2464

◆ 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 }
WORD wMonth
Definition: winbase.h:871
WORD wDayOfWeek
Definition: winbase.h:872
WORD wYear
Definition: winbase.h:870
WORD wMinute
Definition: winbase.h:875
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:276
WORD wSecond
Definition: winbase.h:876
WORD wMilliseconds
Definition: winbase.h:877
WORD wDay
Definition: winbase.h:873
WORD wHour
Definition: winbase.h:874

◆ 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:101
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
*BytesInMultiByteString PCHAR MultiByteString
Definition: rtlfuncs.h:1528
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG _In_ ULONG BytesInMultiByteString
Definition: rtlfuncs.h:2464

◆ 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