Author: greatlrd
Date: Fri Jul 20 20:59:44 2007
New Revision: 27758
URL:
http://svn.reactos.org/svn/reactos?rev=27758&view=rev
Log:
reform the code.
less warings and errors in vc
Modified:
trunk/reactos/subsystems/win32/win32k/objects/metafile.c
trunk/reactos/subsystems/win32/win32k/objects/path.c
trunk/reactos/subsystems/win32/win32k/objects/text.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/metafile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/metafile.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/metafile.c Fri Jul 20 20:59:44 2007
@@ -293,27 +293,28 @@
LPCWSTR Description)
{
PDC Dc;
- HDC ret = NULL;
+ HDC ret = NULL;
DWORD length = 0;
HDC tempHDC;
DWORD MemSize;
+ DWORD dwDesiredAccess;
tempHDC = hDCRef;
if (hDCRef == NULL)
{
- /* FIXME ??
- * Shall we create hdc NtGdiHdcCompatible hdc ??
- */
- UNICODE_STRING DriverName;
- RtlInitUnicodeString(&DriverName, L"DISPLAY");
- //IntGdiCreateDC(&DriverName, NULL, NULL, NULL, FALSE);
+ /* FIXME ??
+ * Shall we create hdc NtGdiHdcCompatible hdc ??
+ */
+ UNICODE_STRING DriverName;
+ RtlInitUnicodeString(&DriverName, L"DISPLAY");
+ //IntGdiCreateDC(&DriverName, NULL, NULL, NULL, FALSE);
tempHDC = NtGdiOpenDCW( &DriverName,
NULL,
NULL,
0, // DCW 0 and ICW 1.
NULL,
(PVOID) NULL,
- (PVOID) NULL );
+ (PVOID) NULL );
}
GDIOBJ_SetOwnership(GdiHandleTable, tempHDC, PsGetCurrentProcess());
@@ -407,45 +408,44 @@
DPRINT1("Trying Create EnhMetaFile\n");
/* disk based metafile */
- DWORD dwDesiredAccess = GENERIC_WRITE | GENERIC_READ | SYNCHRONIZE |
FILE_READ_ATTRIBUTES;
+ dwDesiredAccess = GENERIC_WRITE | GENERIC_READ | SYNCHRONIZE |
FILE_READ_ATTRIBUTES;
OBJECT_ATTRIBUTES ObjectAttributes;
IO_STATUS_BLOCK IoStatusBlock;
- IO_STATUS_BLOCK Iosb;
+ IO_STATUS_BLOCK Iosb;
UNICODE_STRING NtPathU;
- NTSTATUS Status;
+ NTSTATUS Status;
ULONG FileAttributes = (FILE_ATTRIBUTE_VALID_FLAGS &
~FILE_ATTRIBUTE_DIRECTORY);
-
- if (!RtlDosPathNameToNtPathName_U (File, &NtPathU, NULL, NULL))
- {
+
+ if (!RtlDosPathNameToNtPathName_U (File, &NtPathU, NULL, NULL))
+ {
DC_UnlockDc(Dc);
if (hDCRef == NULL)
{
- NtGdiDeleteObjectApp(tempHDC);
- }
+ NtGdiDeleteObjectApp(tempHDC);
+ }
DPRINT1("Can not Create EnhMetaFile\n");
SetLastWin32Error(ERROR_PATH_NOT_FOUND);
return NULL;
}
-
-
- InitializeObjectAttributes(&ObjectAttributes, &NtPathU, 0, NULL, NULL);
+
+ InitializeObjectAttributes(&ObjectAttributes, &NtPathU, 0, NULL, NULL);
Status = NtCreateFile (&Dc->hFile, dwDesiredAccess, &ObjectAttributes,
&IoStatusBlock,
- NULL, FileAttributes, 0, FILE_OVERWRITE_IF, FILE_NON_DIRECTORY_FILE,
- NULL, 0);
+ NULL, FileAttributes, 0, FILE_OVERWRITE_IF,
FILE_NON_DIRECTORY_FILE,
+ NULL, 0);
RtlFreeHeap(RtlGetProcessHeap(), 0, NtPathU.Buffer);
if (!NT_SUCCESS(Status))
- {
- Dc->hFile = NULL;
- DC_UnlockDc(Dc);
+ {
+ Dc->hFile = NULL;
+ DC_UnlockDc(Dc);
if (hDCRef == NULL)
{
- NtGdiDeleteObjectApp(tempHDC);
+ NtGdiDeleteObjectApp(tempHDC);
}
- DPRINT1("Create EnhMetaFile fail\n");
- SetLastWin32Error(ERROR_INVALID_HANDLE);
+ DPRINT1("Create EnhMetaFile fail\n");
+ SetLastWin32Error(ERROR_INVALID_HANDLE);
return NULL;
}
@@ -462,20 +462,20 @@
}
if (NT_SUCCESS(Status))
- {
- ret = tempHDC;
- DC_UnlockDc(Dc);
+ {
+ ret = tempHDC;
+ DC_UnlockDc(Dc);
}
else
{
Dc->hFile = NULL;
- DPRINT1("Write to EnhMetaFile fail\n");
- SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
- ret = NULL;
- DC_UnlockDc(Dc);
+ DPRINT1("Write to EnhMetaFile fail\n");
+ SetLastWin32Error(ERROR_CAN_NOT_COMPLETE);
+ ret = NULL;
+ DC_UnlockDc(Dc);
if (hDCRef == NULL)
{
- NtGdiDeleteObjectApp(tempHDC);
+ NtGdiDeleteObjectApp(tempHDC);
}
}
}
@@ -483,8 +483,8 @@
{
DC_UnlockDc(Dc);
}
-
- return ret;
+
+ return ret;
}
Modified: trunk/reactos/subsystems/win32/win32k/objects/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/path.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/path.c Fri Jul 20 20:59:44 2007
@@ -212,9 +212,7 @@
{
INT ret = -1;
GdiPath *pPath;
-
- DPRINT("Enter NtGdiGetPath\n");
-
+
DC *dc = DC_LockDc(hDC);
if(!dc)
{
Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/text.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/text.c Fri Jul 20 20:59:44 2007
@@ -2502,6 +2502,8 @@
INT adv, lsb, bbx; /* These three hold to widths of the unrotated chars */
OUTLINETEXTMETRICW *potm;
PVOID pvBuf = NULL;
+ int n = 0;
+ FT_CharMap found = 0, charmap;
DPRINT("%p, %d, %08x, %p, %08lx, %p, %p\n", hdc, wch, iFormat, pgm,
cjBuf, UnsafeBuf, pmat2);
@@ -2544,8 +2546,8 @@
{
DPRINT("WARNING: No charmap selected!\n");
DPRINT("This font face has %d charmaps\n", ft_face->num_charmaps);
- int n;
- FT_CharMap found = 0, charmap;
+
+
for (n = 0; n < ft_face->num_charmaps; n++)
{
@@ -4159,13 +4161,15 @@
{
/* Ulta-Ugly Hax! */
INT Ret = 0x80000000;
- DPRINT("TextCharacterExtra %d", CharExtra);
+
PDC dc = DC_LockDc ( hDC );
if (!dc)
- {
+ {
+ DPRINT("TextCharacterExtra %d", CharExtra);
SetLastWin32Error(ERROR_INVALID_HANDLE);
return Ret;
- }
+ }
+ DPRINT("TextCharacterExtra %d", CharExtra);
Ret = dc->w.charExtra;
if( Set ) dc->w.charExtra = CharExtra;
DC_UnlockDc(dc);