ReactOS  0.4.13-dev-551-gf37fb1f
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  */
14 VOID
15 WINAPI
17 {
19 }
20 
21 
22 /*
23  * @unimplemented
24  */
25 BOOL
26 copy_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  */
44 WINAPI
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  */
74 WINAPI
76 {
78  if (!CritSect)
79  {
80  return NULL;
81  }
82 
84  return (HSEMAPHORE)CritSect;
85 }
86 
87 /*
88  * @implemented
89  */
90 VOID
91 WINAPI
93 {
94  if (hsem)
95  {
97  RtlFreeHeap( GetProcessHeap(), 0, hsem );
98  }
99 }
100 
101 /*
102  * @implemented
103  */
106  int iName,
107  int iType,
108  PULONG pulSize)
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  */
136 VOID WINAPI
138 {
139  FreeLibrary(h);
140 }
141 
142 /*
143  * @implemented
144  */
145 
146 VOID WINAPI
149 {
150  *OemCodePage = GetOEMCP();
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  */
202 INT WINAPI
204  LPWSTR WideCharString,
205  INT BytesInWideCharString,
208 {
209  return MultiByteToWideChar(CodePage,0,MultiByteString,BytesInMultiByteString,WideCharString,BytesInWideCharString / sizeof(WCHAR));
210 }
211 
212 /*
213  * @implemented
214  */
215 VOID WINAPI
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  */
233 VOID
234 WINAPI
236 {
238 }
239 
240 /*
241  * @implemented
242  */
243 INT
244 WINAPI
246  LPWSTR WideCharString,
247  INT BytesInWideCharString,
250 {
251  return WideCharToMultiByte(CodePage, 0, WideCharString, (BytesInWideCharString/sizeof(WCHAR)),
253 }
254 
255 /*
256  * @unimplemented
257  */
258 ULONG *
259 WINAPI
261 {
262  return XlateObj->pulXlate;
263 }
264 
VOID WINAPI EngReleaseSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:235
FD_GLYPHSET *WINAPI EngComputeGlyphSet(INT nCodePage, INT nFirstChar, INT cChars)
Definition: eng.c:45
#define IN
Definition: typedefs.h:38
static CODEPAGE_ENTRY AnsiCodePage
Definition: nls.c:46
#define TRUE
Definition: types.h:120
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
LPWSTR WINAPI EngGetDriverName(HDEV hdev)
Definition: eng.c:159
#define WideCharToMultiByte
Definition: compat.h:101
WORD wMonth
Definition: winbase.h:871
CRITICAL_SECTION CritSect
HANDLE WINAPI EngLoadModule(LPWSTR pwsz)
Definition: eng.c:194
VOID WINAPI EngDeleteSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:92
ULONG *WINAPI XLATEOBJ_piVector(XLATEOBJ *XlateObj)
Definition: eng.c:260
_In_ ULONG iType
Definition: winddi.h:3748
_In_ INT nFirstChar
Definition: winddi.h:1485
ULONG cRuns
Definition: winddi.h:644
WORD wDayOfWeek
Definition: winbase.h:872
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:286
LPWSTR pDriverPath
Definition: winspool.h:480
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:603
INT WINAPI EngMultiByteToWideChar(UINT CodePage, LPWSTR WideCharString, INT BytesInWideCharString, LPSTR MultiByteString, INT BytesInMultiByteString)
Definition: eng.c:203
_Check_return_ _Out_ PULONG pulSize
Definition: winddi.h:2120
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
ULONG * pulXlate
Definition: winddi.h:1260
char * LPSTR
Definition: xmlstorage.h:182
int32_t INT
Definition: typedefs.h:56
PDRIVER_INFO_5W pdi5Info
Definition: gdi32p.h:157
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
BOOL copy_my_glyphset(FD_GLYPHSET *dst_glyphset, FD_GLYPHSET *src_glyphset, ULONG Size)
Definition: eng.c:26
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
WORD wYear
Definition: winbase.h:870
struct _UMPDEV * PUMPDEV
unsigned int BOOL
Definition: ntddk_ex.h:94
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
VOID WINAPI EngFreeModule(HANDLE h)
Definition: eng.c:137
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
WORD wMinute
Definition: winbase.h:875
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI GetACP(VOID)
Definition: nls.c:2169
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:276
LPWSTR pDataFile
Definition: winspool.h:481
VOID WINAPI EngQueryLocalTime(PENG_TIME_FIELDS etf)
Definition: eng.c:216
PVOID WINAPI EngFindResource(HANDLE h, int iName, int iType, PULONG pulSize)
Definition: eng.c:105
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:585
static SCRIPT_CACHE SCRIPT_ANALYSIS OPENTYPE_TAG OPENTYPE_TAG int TEXTRANGE_PROPERTIES int const WCHAR int cChars
Definition: usp10.c:64
#define FreeLibrary(x)
Definition: compat.h:405
#define GetProcessHeap()
Definition: compat.h:395
DWORD_PTR HSEMAPHORE
Definition: axcore.idl:60
__wchar_t WCHAR
Definition: xmlstorage.h:180
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
DWORD_PTR Sig
Definition: gdi32p.h:155
#define WINAPI
Definition: msvc.h:8
unsigned long DWORD
Definition: ntddk_ex.h:95
#define PDEV_UMPD_ID
Definition: gdi32p.h:149
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
WORD wSecond
Definition: winbase.h:876
WORD wMilliseconds
Definition: winbase.h:877
static CODEPAGE_ENTRY OemCodePage
Definition: nls.c:47
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
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
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:338
WORD wDay
Definition: winbase.h:873
VOID WINAPI EngAcquireSemaphore(IN HSEMAPHORE hsem)
Definition: eng.c:16
LPWSTR WINAPI EngGetPrinterDataFileName(HDEV hdev)
Definition: eng.c:177
WORD wHour
Definition: winbase.h:874
unsigned int * PULONG
Definition: retypes.h:1
unsigned int UINT
Definition: ndis.h:50
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
*BytesInMultiByteString PCHAR MultiByteString
Definition: rtlfuncs.h:1528
#define MultiByteToWideChar
Definition: compat.h:100
VOID WINAPI EngGetCurrentCodePage(OUT PUSHORT OemCodePage, OUT PUSHORT AnsiCodePage)
Definition: eng.c:147
#define OUT
Definition: typedefs.h:39
HSEMAPHORE WINAPI EngCreateSemaphore(VOID)
Definition: eng.c:75
unsigned int ULONG
Definition: retypes.h:1
ULONG cjThis
Definition: winddi.h:641
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WCHAR * LPWSTR
Definition: xmlstorage.h:184
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
INT WINAPI EngWideCharToMultiByte(UINT CodePage, LPWSTR WideCharString, INT BytesInWideCharString, LPSTR MultiByteString, INT BytesInMultiByteString)
Definition: eng.c:245
_In_ HDEV hdev
Definition: winddi.h:3449
unsigned short * PUSHORT
Definition: retypes.h:2
__kernel_entry W32KAPI DHPDEV APIENTRY NtGdiGetDhpdev(_In_ HDEV hdev)
*BytesInUnicodeString PWCH _In_ ULONG _Out_opt_ PULONG _In_ ULONG BytesInMultiByteString
Definition: rtlfuncs.h:2448
UINT WINAPI GetOEMCP(VOID)
Definition: nls.c:2184