Skip to content

Commit 441eb0f

Browse files
committed
[ARWINSS]
- Bring in Eng functions from trunk's gdi32 - Add GetFontResourceInfoW() because base/applications/fontviewer started to depend on it - Stub InitializeLpkHooks() in user32 - Arwinss now builds in trunk. I hope the cat is happier now and gets off my window. svn path=/branches/arwinss/; revision=62759
2 parents 6b3de3f + df0f048 commit 441eb0f

File tree

6 files changed

+235
-19
lines changed

6 files changed

+235
-19
lines changed

arwinss/client/gdi32/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ list(APPEND SOURCE
2323
dc.c
2424
dib.c
2525
driver.c
26+
eng.c
2627
enhmetafile.c
2728
enhmeta2.c
2829
font.c

arwinss/client/gdi32/eng.c

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
/*
2+
* reactos/lib/gdi32/misc/eng.c
3+
*
4+
* GDI32.DLL eng part
5+
*
6+
*
7+
*/
8+
9+
#include "config.h"
10+
11+
/* Definitions */
12+
#define WIN32_NO_STATUS
13+
#define _INC_WINDOWS
14+
#define COM_NO_WINDOWS_H
15+
#define NTOS_MODE_USER
16+
17+
#include <stdarg.h>
18+
19+
/* SDK/DDK/NDK Headers. */
20+
#include <windef.h>
21+
#include <winbase.h>
22+
#include <winnls.h>
23+
#include <objbase.h>
24+
#include <ndk/rtlfuncs.h>
25+
#include <wingdi.h>
26+
#define _ENGINE_EXPORT_
27+
#include <winddi.h>
28+
#include <winuser.h>
29+
30+
#include "gdi_private.h"
31+
32+
33+
/*
34+
* @implemented
35+
*/
36+
VOID
37+
WINAPI
38+
EngAcquireSemaphore ( IN HSEMAPHORE hsem )
39+
{
40+
RtlEnterCriticalSection((PRTL_CRITICAL_SECTION)hsem);
41+
}
42+
43+
44+
/*
45+
* @implemented
46+
*/
47+
HSEMAPHORE
48+
WINAPI
49+
EngCreateSemaphore ( VOID )
50+
{
51+
PRTL_CRITICAL_SECTION CritSect = RtlAllocateHeap(GetProcessHeap(), 0, sizeof(RTL_CRITICAL_SECTION));
52+
if (!CritSect)
53+
{
54+
return NULL;
55+
}
56+
57+
RtlInitializeCriticalSection( CritSect );
58+
return (HSEMAPHORE)CritSect;
59+
}
60+
61+
/*
62+
* @implemented
63+
*/
64+
VOID
65+
WINAPI
66+
EngDeleteSemaphore ( IN HSEMAPHORE hsem )
67+
{
68+
if (hsem)
69+
{
70+
RtlDeleteCriticalSection( (PRTL_CRITICAL_SECTION) hsem );
71+
RtlFreeHeap( GetProcessHeap(), 0, hsem );
72+
}
73+
}
74+
75+
/*
76+
* @implemented
77+
*/
78+
PVOID WINAPI
79+
EngFindResource(HANDLE h,
80+
int iName,
81+
int iType,
82+
PULONG pulSize)
83+
{
84+
HRSRC HRSrc;
85+
DWORD Size = 0;
86+
HGLOBAL Hg;
87+
LPVOID Lock = NULL;
88+
89+
HRSrc = FindResourceW((HMODULE)h, MAKEINTRESOURCEW(iName), MAKEINTRESOURCEW(iType));
90+
if (HRSrc != NULL)
91+
{
92+
Size = SizeofResource((HMODULE)h, HRSrc);
93+
if (Size != 0)
94+
{
95+
Hg = LoadResource((HMODULE)h, HRSrc);
96+
if (Hg != NULL)
97+
{
98+
Lock = LockResource( Hg );
99+
}
100+
}
101+
}
102+
103+
*pulSize = Size;
104+
return (PVOID) Lock;
105+
}
106+
107+
/*
108+
* @implemented
109+
*/
110+
VOID WINAPI
111+
EngFreeModule(HANDLE h)
112+
{
113+
FreeLibrary(h);
114+
}
115+
116+
/*
117+
* @implemented
118+
*/
119+
120+
VOID WINAPI
121+
EngGetCurrentCodePage( OUT PUSHORT OemCodePage,
122+
OUT PUSHORT AnsiCodePage)
123+
{
124+
*OemCodePage = GetOEMCP();
125+
*AnsiCodePage = GetACP();
126+
}
127+
128+
/*
129+
* @implemented
130+
*/
131+
HANDLE WINAPI
132+
EngLoadModule(LPWSTR pwsz)
133+
{
134+
return LoadLibraryExW ( pwsz, NULL, LOAD_LIBRARY_AS_DATAFILE);
135+
}
136+
137+
/*
138+
* @implemented
139+
*/
140+
INT WINAPI
141+
EngMultiByteToWideChar(UINT CodePage,
142+
LPWSTR WideCharString,
143+
INT BytesInWideCharString,
144+
LPSTR MultiByteString,
145+
INT BytesInMultiByteString)
146+
{
147+
return MultiByteToWideChar(CodePage,0,MultiByteString,BytesInMultiByteString,WideCharString,BytesInWideCharString / sizeof(WCHAR));
148+
}
149+
150+
/*
151+
* @implemented
152+
*/
153+
VOID WINAPI
154+
EngQueryLocalTime(PENG_TIME_FIELDS etf)
155+
{
156+
SYSTEMTIME SystemTime;
157+
GetLocalTime( &SystemTime );
158+
etf->usYear = SystemTime.wYear;
159+
etf->usMonth = SystemTime.wMonth;
160+
etf->usWeekday = SystemTime.wDayOfWeek;
161+
etf->usDay = SystemTime.wDay;
162+
etf->usHour = SystemTime.wHour;
163+
etf->usMinute = SystemTime.wMinute;
164+
etf->usSecond = SystemTime.wSecond;
165+
etf->usMilliseconds = SystemTime.wMilliseconds;
166+
}
167+
168+
/*
169+
* @implemented
170+
*/
171+
VOID
172+
WINAPI
173+
EngReleaseSemaphore ( IN HSEMAPHORE hsem )
174+
{
175+
RtlLeaveCriticalSection( (PRTL_CRITICAL_SECTION) hsem);
176+
}
177+
178+
179+
180+
181+
/*
182+
* @implemented
183+
*/
184+
INT
185+
WINAPI
186+
EngWideCharToMultiByte( UINT CodePage,
187+
LPWSTR WideCharString,
188+
INT BytesInWideCharString,
189+
LPSTR MultiByteString,
190+
INT BytesInMultiByteString)
191+
{
192+
return WideCharToMultiByte(CodePage, 0, WideCharString, (BytesInWideCharString/sizeof(WCHAR)),
193+
MultiByteString, BytesInMultiByteString, NULL, NULL);
194+
}

arwinss/client/gdi32/font.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3480,3 +3480,16 @@ GdiAddFontResourceW(
34803480
return 0;
34813481
}
34823482

3483+
3484+
BOOL
3485+
WINAPI
3486+
GetFontResourceInfoW(
3487+
LPCWSTR lpFileName,
3488+
DWORD *pdwBufSize,
3489+
void* lpBuffer,
3490+
DWORD dwType
3491+
)
3492+
{
3493+
FIXME("GetFontResourceInfoW(%S) UNIMPLEMENTED\n", lpFileName);
3494+
return FALSE;
3495+
}

arwinss/client/gdi32/gdi32.spec

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
@ stub EndFormPage
155155
@ stdcall EndPage(long)
156156
@ stdcall EndPath(long)
157-
@ stub EngAcquireSemaphore
157+
@ stdcall EngAcquireSemaphore(ptr)
158158
@ stub EngAlphaBlend
159159
@ stub EngAssociateSurface
160160
@ stub EngBitBlt
@@ -166,31 +166,31 @@
166166
@ stub EngCreateDeviceBitmap
167167
@ stub EngCreateDeviceSurface
168168
@ stub EngCreatePalette
169-
@ stub EngCreateSemaphore
169+
@ stdcall EngCreateSemaphore()
170170
@ stub EngDeleteClip
171171
@ stub EngDeletePalette
172172
@ stub EngDeletePath
173-
@ stub EngDeleteSemaphore
173+
@ stdcall EngDeleteSemaphore(ptr)
174174
@ stub EngDeleteSurface
175175
@ stub EngEraseSurface
176176
@ stub EngFillPath
177-
@ stub EngFindResource
178-
@ stub EngFreeModule
179-
@ stub EngGetCurrentCodePage
177+
@ stdcall EngFindResource(ptr long long ptr)
178+
@ stdcall EngFreeModule(ptr)
179+
@ stdcall EngGetCurrentCodePage(ptr ptr)
180180
@ stub EngGetDriverName
181181
@ stub EngGetPrinterDataFileName
182182
@ stub EngGradientFill
183183
@ stub EngLineTo
184-
@ stub EngLoadModule
184+
@ stdcall EngLoadModule(ptr)
185185
@ stub EngLockSurface
186186
@ stub EngMarkBandingSurface
187187
@ stub EngMultiByteToUnicodeN
188-
@ stub EngMultiByteToWideChar
188+
@ stdcall EngMultiByteToWideChar(long wstr long str long)
189189
@ stub EngPaint
190190
@ stub EngPlgBlt
191191
@ stub EngQueryEMFInfo
192-
@ stub EngQueryLocalTime
193-
@ stub EngReleaseSemaphore
192+
@ stdcall EngQueryLocalTime(ptr)
193+
@ stdcall EngReleaseSemaphore(ptr)
194194
@ stub EngStretchBlt
195195
@ stub EngStretchBltROP
196196
@ stub EngStrokeAndFillPath
@@ -249,15 +249,15 @@
249249
@ stdcall GdiComment(long long ptr)
250250
@ stub GdiConsoleTextOut
251251
@ stub GdiConvertAndCheckDC
252-
@ stub GdiConvertBitmap
252+
@ stdcall GdiConvertBitmap(ptr)
253253
@ stub GdiConvertBitmapV5
254-
@ stub GdiConvertBrush
255-
@ stub GdiConvertDC
254+
@ stdcall GdiConvertBrush(ptr)
255+
@ stdcall GdiConvertDC(ptr)
256256
@ stub GdiConvertEnhMetaFile
257-
@ stub GdiConvertFont
257+
@ stdcall GdiConvertFont(ptr)
258258
@ stub GdiConvertMetaFilePict
259-
@ stub GdiConvertPalette
260-
@ stub GdiConvertRegion
259+
@ stdcall GdiConvertPalette(ptr)
260+
@ stdcall GdiConvertRegion(ptr)
261261
@ stdcall GdiConvertToDevmodeW(ptr)
262262
@ stub GdiCreateLocalBitmap
263263
@ stub GdiCreateLocalBrush
@@ -335,7 +335,7 @@
335335
@ stub GdiQueryTable
336336
@ stdcall GdiRealizationInfo(long ptr)
337337
@ stub GdiReleaseDC
338-
@ stub GdiReleaseLocalDC
338+
@ stdcall GdiReleaseLocalDC(ptr)
339339
@ stub GdiResetDCEMF
340340
@ stdcall GdiSetAttrs(ptr)
341341
@ stdcall GdiSetBatchLimit(long)
@@ -405,7 +405,7 @@
405405
@ stdcall GetFontData(long long long ptr long)
406406
@ stdcall GetFontLanguageInfo(long)
407407
@ stub GetFontResourceInfo
408-
@ stub GetFontResourceInfoW
408+
@ stdcall GetFontResourceInfoW(str ptr ptr long)
409409
@ stdcall GetFontUnicodeRanges(ptr ptr)
410410
@ stdcall GetGlyphIndicesA(long ptr long ptr long)
411411
@ stdcall GetGlyphIndicesW(long ptr long ptr long)

arwinss/client/user32/legacy.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ RestoreThunkLock(DWORD mutex_count)
2323
{
2424
}
2525

26+
VOID
27+
WINAPI
28+
InitializeLpkHooks(FARPROC *hookfuncs)
29+
{
30+
UNIMPLEMENTED;
31+
}
32+
33+
2634
/*
2735
* Private calls for CSRSS
2836
*/

arwinss/client/user32/user32.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@
411411
@ stdcall InflateRect(ptr long long)
412412
# @ stub InitSharedTable
413413
# @ stub InitTask
414-
@ stub InitializeLpkHooks
414+
@ stdcall InitializeLpkHooks(ptr)
415415
@ stub InitializeWin32EntryTable
416416
@ stdcall InsertMenuA(long long long long ptr)
417417
@ stdcall InsertMenuItemA(long long long ptr)

0 commit comments

Comments
 (0)