Minor fixes

svn path=/trunk/; revision=1016
This commit is contained in:
Jason Filby 2000-02-27 11:04:36 +00:00
parent fa81b6d260
commit 48db9468eb
3 changed files with 29 additions and 85 deletions

View file

@ -7,8 +7,10 @@
int main (void) int main (void)
{ {
GdiDllInitialize (NULL, DLL_PROCESS_ATTACH, NULL); HDC Desktop;
GdiDllInitialize (NULL, DLL_PROCESS_ATTACH, NULL);
Desktop = CreateDCA("DISPLAY", NULL, NULL, NULL);
return 0; return 0;
} }

View file

@ -1,4 +1,4 @@
# $Id: makefile,v 1.9 2000/02/20 22:52:48 ea Exp $ # $Id: makefile,v 1.10 2000/02/27 11:04:36 jfilby Exp $
# #
# Makefile for ReactOS gdi32.dll # Makefile for ReactOS gdi32.dll
# #
@ -40,6 +40,7 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
--output-lib $(TARGET).a --output-lib $(TARGET).a
$(CC) $(TARGET).o \ $(CC) $(TARGET).o \
../kernel32/kernel32.a \ ../kernel32/kernel32.a \
../ntdll/ntdll.a \
-specs=$(TARGET)_specs \ -specs=$(TARGET)_specs \
-mdll \ -mdll \
-o junk.tmp \ -o junk.tmp \
@ -54,6 +55,7 @@ $(TARGET).dll: $(DLLMAIN) $(OBJECTS) $(TARGET).def
- $(RM) base.tmp - $(RM) base.tmp
$(CC) $(TARGET).o \ $(CC) $(TARGET).o \
../kernel32/kernel32.a \ ../kernel32/kernel32.a \
../ntdll/ntdll.a \
-specs=$(TARGET)_specs \ -specs=$(TARGET)_specs \
-mdll \ -mdll \
-o $(TARGET).dll \ -o $(TARGET).dll \

View file

@ -1,4 +1,4 @@
/* $Id: stubsa.c,v 1.2 2000/02/20 22:52:48 ea Exp $ /* $Id: stubsa.c,v 1.3 2000/02/27 11:04:36 jfilby Exp $
* *
* reactos/lib/gdi32/misc/stubs.c * reactos/lib/gdi32/misc/stubs.c
* *
@ -11,54 +11,11 @@
#ifdef UNICODE #ifdef UNICODE
#undef UNICODE #undef UNICODE
#endif #endif
#undef WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <ddk/ntddk.h>
static
LPWSTR
STDCALL
AnsiStringToUnicodeString (
LPCSTR AnsiString,
LPWSTR UnicodeString,
BOOLEAN AllocateBuffer
)
{
int Length;
LPWSTR _UnicodeString = UnicodeString;
if ( (NULL == UnicodeString)
&& (FALSE == AllocateBuffer)
)
{
return NULL;
}
Length = (lstrlenA (AnsiString) + 1);
if (TRUE == AllocateBuffer)
{
_UnicodeString = LocalAlloc (
LMEM_ZEROINIT,
Length
);
if (NULL == _UnicodeString)
{
return NULL;
}
}
Length = MultiByteToWideChar (
CP_ACP,
0,
AnsiString,
-1,
_UnicodeString,
Length
);
if (0 == Length)
{
return NULL;
}
return _UnicodeString;
}
int int
STDCALL STDCALL
AddFontResourceA( AddFontResourceA(
@ -91,70 +48,53 @@ CreateDCA (
CONST DEVMODE * lpInitData CONST DEVMODE * lpInitData
) )
{ {
LPCWSTR lpwszDriver = NULL; ANSI_STRING DriverA, DeviceA, OutputA;
LPCWSTR lpwszDevice = NULL; UNICODE_STRING DriverU, DeviceU, OutputU;
LPCWSTR lpwszOutput = NULL;
HDC hDC; HDC hDC;
/* /*
* If needed, convert to Unicode * If needed, convert to Unicode
* any string parameter. * any string parameter.
*/ */
if (NULL != lpszDriver) if (NULL != lpszDriver)
{ {
lpwszDriver = AnsiStringToUnicodeString ( RtlInitAnsiString(&DriverA, (LPSTR)lpszDriver);
lpszDriver, RtlAnsiStringToUnicodeString(&DriverU, &DriverA, TRUE);
NULL,
TRUE
);
if (NULL == lpwszDriver)
{
return 0;
}
} }
if (NULL != lpszDevice) if (NULL != lpszDevice)
{ {
lpwszDevice = AnsiStringToUnicodeString ( RtlInitAnsiString(&DeviceA, (LPSTR)lpszDevice);
lpszDevice, RtlAnsiStringToUnicodeString(&DeviceU, &DeviceA, TRUE);
NULL,
TRUE
);
if (NULL == lpwszDevice)
{
return 0;
}
} }
if (NULL != lpszOutput) if (NULL != lpszOutput)
{ {
lpwszOutput = AnsiStringToUnicodeString ( RtlInitAnsiString(&OutputA, (LPSTR)lpszOutput);
lpszOutput, RtlAnsiStringToUnicodeString(&OutputU, &OutputA, TRUE);
NULL,
TRUE
);
if (NULL == lpwszOutput)
{
return 0;
}
} }
/* /*
* Call the Unicode version * Call the Unicode version
* of CreateDC. * of CreateDC.
*/ */
hDC = CreateDCW ( hDC = CreateDCW (
lpwszDriver, DriverU.Buffer,
lpwszDevice, DeviceU.Buffer,
lpwszOutput, OutputU.Buffer,
lpInitData lpInitData
); );
/* /*
* Free Unicode parameters. * Free Unicode parameters.
*/ */
if (NULL != lpszDriver) LocalFree (lpwszDriver); RtlFreeUnicodeString(&DriverU);
if (NULL != lpszDevice) LocalFree (lpwszDevice); RtlFreeUnicodeString(&DeviceU);
if (NULL != lpszOutput) LocalFree (lpwszOutput); RtlFreeUnicodeString(&OutputU);
/* /*
* Return the possible DC handle. * Return the possible DC handle.
*/ */
return hDC; return hDC;
} }