ReactOS 0.4.15-dev-8422-g6219a1a
eng.c
Go to the documentation of this file.
1/*
2 * reactos/lib/gdi32/misc/eng.c
3 *
4 * GDI32.DLL eng part
5 *
6 *
7 */
8
9#include <precomp.h>
10
11/*
12 * @implemented
13 */
14VOID
17{
19}
20
21
22/*
23 * @unimplemented
24 */
25BOOL
26copy_my_glyphset( FD_GLYPHSET *dst_glyphset , FD_GLYPHSET * src_glyphset, ULONG Size)
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}
39
40/*
41 * @implemented
42 */
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}
69
70/*
71 * @implemented
72 */
76{
78 if (!CritSect)
79 {
80 return NULL;
81 }
82
84 return (HSEMAPHORE)CritSect;
85}
86
87/*
88 * @implemented
89 */
90VOID
93{
94 if (hsem)
95 {
97 RtlFreeHeap( GetProcessHeap(), 0, hsem );
98 }
99}
100
101/*
102 * @implemented
103 */
106 int iName,
107 int iType,
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}
132
133/*
134 * @implemented
135 */
138{
139 FreeLibrary(h);
140}
141
142/*
143 * @implemented
144 */
145
149{
151 *AnsiCodePage = GetACP();
152}
153
154
155/*
156 * @implemented
157 */
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}
172
173/*
174 * @implemented
175 */
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}
189
190/*
191 * @implemented
192 */
195{
197}
198
199/*
200 * @implemented
201 */
204 LPWSTR WideCharString,
205 INT BytesInWideCharString,
208{
209 return MultiByteToWideChar(CodePage,0,MultiByteString,BytesInMultiByteString,WideCharString,BytesInWideCharString / sizeof(WCHAR));
210}
211
212/*
213 * @implemented
214 */
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}
229
230/*
231 * @implemented
232 */
233VOID
234WINAPI
236{
238}
239
240/*
241 * @implemented
242 */
243INT
244WINAPI
246 LPWSTR WideCharString,
247 INT BytesInWideCharString,
250{
251 return WideCharToMultiByte(CodePage, 0, WideCharString, (BytesInWideCharString/sizeof(WCHAR)),
253}
254
255/*
256 * @unimplemented
257 */
258ULONG *
259WINAPI
261{
262 return XlateObj->pulXlate;
263}
264
RTL_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:590
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define GetProcessHeap()
Definition: compat.h:736
#define FreeLibrary(x)
Definition: compat.h:748
#define WideCharToMultiByte
Definition: compat.h:111
#define MultiByteToWideChar
Definition: compat.h:110
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
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
UINT WINAPI GetACP(void)
Definition: locale.c:2020
UINT WINAPI GetOEMCP(void)
Definition: locale.c:2059
static CODEPAGE_ENTRY AnsiCodePage
Definition: nls.c:46
static CODEPAGE_ENTRY OemCodePage
Definition: nls.c:47
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define PDEV_UMPD_ID
Definition: gdi32p.h:149
struct _UMPDEV * PUMPDEV
PVOID WINAPI EngFindResource(HANDLE h, int iName, int iType, PULONG pulSize)
Definition: eng.c:105
VOID WINAPI EngAcquireSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:16
INT WINAPI EngWideCharToMultiByte(UINT CodePage, LPWSTR WideCharString, INT BytesInWideCharString, LPSTR MultiByteString, INT BytesInMultiByteString)
Definition: eng.c:245
INT WINAPI EngMultiByteToWideChar(UINT CodePage, LPWSTR WideCharString, INT BytesInWideCharString, LPSTR MultiByteString, INT BytesInMultiByteString)
Definition: eng.c:203
VOID WINAPI EngFreeModule(HANDLE h)
Definition: eng.c:137
ULONG *WINAPI XLATEOBJ_piVector(XLATEOBJ *XlateObj)
Definition: eng.c:260
VOID WINAPI EngReleaseSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:235
VOID WINAPI EngDeleteSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:92
VOID WINAPI EngGetCurrentCodePage(OUT PUSHORT OemCodePage, OUT PUSHORT AnsiCodePage)
Definition: eng.c:147
HANDLE WINAPI EngLoadModule(LPWSTR pwsz)
Definition: eng.c:194
LPWSTR WINAPI EngGetPrinterDataFileName(HDEV hdev)
Definition: eng.c:177
HSEMAPHORE WINAPI EngCreateSemaphore(VOID)
Definition: eng.c:75
BOOL copy_my_glyphset(FD_GLYPHSET *dst_glyphset, FD_GLYPHSET *src_glyphset, ULONG Size)
Definition: eng.c:26
FD_GLYPHSET *WINAPI EngComputeGlyphSet(INT nCodePage, INT nFirstChar, INT cChars)
Definition: eng.c:45
LPWSTR WINAPI EngGetDriverName(HDEV hdev)
Definition: eng.c:159
VOID WINAPI EngQueryLocalTime(PENG_TIME_FIELDS etf)
Definition: eng.c:216
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
unsigned int UINT
Definition: ndis.h:50
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG _In_ ULONG BytesInMultiByteString
Definition: rtlfuncs.h:2588
__kernel_entry W32KAPI FD_GLYPHSET *APIENTRY NtGdiEngComputeGlyphSet(_In_ INT nCodePage, _In_ INT nFirstChar, _In_ INT cChars)
Definition: umpdstubs.c:142
__kernel_entry W32KAPI DHPDEV APIENTRY NtGdiGetDhpdev(_In_ HDEV hdev)
LPWSTR pDriverPath
Definition: winspool.h:480
LPWSTR pDataFile
Definition: winspool.h:481
ULONG cjThis
Definition: winddi.h:641
ULONG cRuns
Definition: winddi.h:644
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
DWORD_PTR Sig
Definition: gdi32p.h:155
PDRIVER_INFO_5W pdi5Info
Definition: gdi32p.h:157
ULONG * pulXlate
Definition: winddi.h:1260
uint32_t * PULONG
Definition: typedefs.h:59
int32_t INT
Definition: typedefs.h:58
uint16_t * PUSHORT
Definition: typedefs.h:56
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:342
_Check_return_ _Out_ PULONG pulSize
Definition: winddi.h:2120
_In_ HDEV hdev
Definition: winddi.h:3449
_In_ INT nFirstChar
Definition: winddi.h:1485
_In_ ULONG iType
Definition: winddi.h:3748
#define WINAPI
Definition: msvc.h:6
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
*BytesInMultiByteString PCHAR MultiByteString
Definition: rtlfuncs.h:1527
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184