moved USER32_DevModeA2W to lib/rosrtl/misc/devmode.c and renamed to RosRtlDevModeA2W...
authorRoyce Mitchell III <royce3@ev1.net>
Mon, 21 Jul 2003 01:59:51 +0000 (01:59 +0000)
committerRoyce Mitchell III <royce3@ev1.net>
Mon, 21 Jul 2003 01:59:51 +0000 (01:59 +0000)
svn path=/trunk/; revision=5198

12 files changed:
reactos/include/rosrtl/devmode.h [new file with mode: 0644]
reactos/include/unicode.h
reactos/lib/gdi32/gdi32.def
reactos/lib/gdi32/gdi32.edf
reactos/lib/gdi32/misc/stubsa.c
reactos/lib/gdi32/misc/stubsw.c
reactos/lib/rosrtl/makefile
reactos/lib/rosrtl/misc/devmode.c [moved from reactos/lib/user32/misc/devmode.c with 95% similarity]
reactos/lib/user32/Makefile
reactos/lib/user32/include/user32.h
reactos/lib/user32/misc/desktop.c
reactos/lib/user32/misc/display.c

diff --git a/reactos/include/rosrtl/devmode.h b/reactos/include/rosrtl/devmode.h
new file mode 100644 (file)
index 0000000..0b6b996
--- /dev/null
@@ -0,0 +1,16 @@
+/* devmode.h
+ */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+void
+RosRtlDevModeA2W ( LPDEVMODEW pW, const LPDEVMODEA pA );
+
+#ifdef __cplusplus
+}
+#endif
+
+/* EOF */
index e63610f..29cc1de 100644 (file)
@@ -1856,6 +1856,10 @@ SystemParametersInfoW(
     PVOID pvParam,
     UINT fWinIni);
 
     PVOID pvParam,
     UINT fWinIni);
 
+int
+STDCALL
+AddFontResourceExW ( LPCWSTR, DWORD, PVOID );
+
 int
 STDCALL
 AddFontResourceW(LPCWSTR);
 int
 STDCALL
 AddFontResourceW(LPCWSTR);
index f244276..bd9669d 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: gdi32.def,v 1.5 2000/02/22 20:55:23 ekohl Exp $
+; $Id: gdi32.def,v 1.6 2003/07/21 01:59:51 royce Exp $
 ;
 ; gdi32.def
 ;
 ;
 ; gdi32.def
 ;
@@ -11,6 +11,8 @@ EXPORTS
 AbortDoc@4
 AbortPath@4
 AddFontResourceA@4
 AbortDoc@4
 AbortPath@4
 AddFontResourceA@4
+AddFontResourceExA@12
+AddFontResourceExW@12
 AddFontResourceW@4
 AngleArc@24
 AnimatePalette@16
 AddFontResourceW@4
 AngleArc@24
 AnimatePalette@16
index 606a382..ca50da8 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: gdi32.edf,v 1.3 2000/02/22 20:55:23 ekohl Exp $
+; $Id: gdi32.edf,v 1.4 2003/07/21 01:59:51 royce Exp $
 ;
 ; gdi32.def
 ;
 ;
 ; gdi32.def
 ;
@@ -11,6 +11,8 @@ EXPORTS
 AbortDoc=AbortDoc@4
 AbortPath=AbortPath@4
 AddFontResourceA=AddFontResourceA@4
 AbortDoc=AbortDoc@4
 AbortPath=AbortPath@4
 AddFontResourceA=AddFontResourceA@4
+AddFontResourceExA=AddFontResourceExA@12
+AddFontResourceExW=AddFontResourceExW@12
 AddFontResourceW=AddFontResourceW@4
 AngleArc=AngleArc@24
 AnimatePalette=AnimatePalette@16
 AddFontResourceW=AddFontResourceW@4
 AngleArc=AngleArc@24
 AnimatePalette=AnimatePalette@16
index bedcced..9eb90f6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: stubsa.c,v 1.11 2003/07/10 15:35:49 chorns Exp $
+/* $Id: stubsa.c,v 1.12 2003/07/21 01:59:51 royce Exp $
  *
  * reactos/lib/gdi32/misc/stubs.c
  *
  *
  * reactos/lib/gdi32/misc/stubs.c
  *
 #undef WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <ddk/ntddk.h>
 #undef WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <ddk/ntddk.h>
+#include <win32k/text.h>
+#include <win32k/metafile.h>
 
 /*
 
 /*
- * @unimplemented
+ * @implemented
  */
 int
 STDCALL
  */
 int
 STDCALL
-AddFontResourceA(
-       LPCSTR          a0
-       )
+AddFontResourceExA ( LPCSTR lpszFilename, DWORD fl, PVOID pvReserved )
 {
 {
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+  NTSTATUS Status;
+  UNICODE_STRING FilenameU;
+  int rc;
+
+  Status = RtlCreateUnicodeStringFromAsciiz ( &FilenameU,
+                                             (PCSZ)lpszFilename );
+  if (!NT_SUCCESS (Status))
+    {
+      SetLastError (RtlNtStatusToDosError(Status));
+      return 0;
+    }
+
+  rc = AddFontResourceExW ( FilenameU.Buffer, fl, pvReserved );
+
+  RtlFreeUnicodeString ( &FilenameU );
+
+  return rc;
+}
+
+/*
+ * @implemented
+ */
+int
+STDCALL
+AddFontResourceA ( LPCSTR lpszFilename )
+{
+  return AddFontResourceExA ( lpszFilename, 0, 0 );
 }
 
 
 /*
 }
 
 
 /*
- * @unimplemented
+ * @implemented
  */
 HMETAFILE
 STDCALL
 CopyMetaFileA(
  */
 HMETAFILE
 STDCALL
 CopyMetaFileA(
-       HMETAFILE       a0,
-       LPCSTR          a1
+       HMETAFILE       Src,
+       LPCSTR          lpszFile
        )
 {
        )
 {
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+  NTSTATUS Status;
+  UNICODE_STRING FileU;
+  HMETAFILE rc;
+
+  Status = RtlCreateUnicodeStringFromAsciiz ( &FileU,
+                                             (PCSZ)lpszFile );
+  if (!NT_SUCCESS (Status))
+    {
+      SetLastError (RtlNtStatusToDosError(Status));
+      return 0;
+    }
+
+  rc = W32kCopyMetaFile ( Src, FileU.Buffer );
+
+  RtlFreeUnicodeString ( &FileU );
+
+  return rc;
 }
 
 
 }
 
 
@@ -51,14 +91,45 @@ CopyMetaFileA(
 HDC
 STDCALL
 CreateICA(
 HDC
 STDCALL
 CreateICA(
-       LPCSTR                  a0,
-       LPCSTR                  a1,
-       LPCSTR                  a2,
-       CONST DEVMODEA *        a3
-       )
-{
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+       LPCSTR                  lpszDriver,
+       LPCSTR                  lpszDevice,
+       LPCSTR                  lpszOutput,
+       CONST DEVMODEA *        lpdvmInit
+       )
+{
+  NTSTATUS Status;
+  UNICODE_STRING Driver, Device, Output;
+  DEVMODEW dvmInitW;
+  HDC rc;
+
+  Status = RtlCreateUnicodeStringFromAsciiz ( &Driver,
+                                             (PCSZ)lpszDriver );
+  if (!NT_SUCCESS (Status))
+    {
+      SetLastError (RtlNtStatusToDosError(Status));
+      return 0;
+    }
+
+  Status = RtlCreateUnicodeStringFromAsciiz ( &Device,
+                                             (PCSZ)lpszDevice );
+  if (!NT_SUCCESS (Status))
+    {
+      SetLastError (RtlNtStatusToDosError(Status));
+      return 0;
+    }
+
+  Status = RtlCreateUnicodeStringFromAsciiz ( &Output,
+                                             (PCSZ)lpszOutput );
+  if (!NT_SUCCESS (Status))
+    {
+      SetLastError (RtlNtStatusToDosError(Status));
+      return 0;
+    }
+
+  if ( lpdvmInit )
+    RosRtlDevModeA2W ( &dvmInitW, lpdvmInit );
+
+  return 0;
 }
 
 
 }
 
 
index 7e631e7..40913d9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: stubsw.c,v 1.10 2003/07/10 15:35:49 chorns Exp $
+/* $Id: stubsw.c,v 1.11 2003/07/21 01:59:51 royce Exp $
  *
  * reactos/lib/gdi32/misc/stubs.c
  *
  *
  * reactos/lib/gdi32/misc/stubs.c
  *
  */
 int
 STDCALL
  */
 int
 STDCALL
-AddFontResourceW(
-       LPCWSTR         a0
-       )
+AddFontResourceExW ( LPCWSTR lpszFilename, DWORD fl, PVOID pvReserved )
 {
 {
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+  /* FIXME handle fl parameter */
+  return W32kAddFontResource ( lpszFilename );
+}
+
+/*
+ * @implemented
+ */
+int
+STDCALL
+AddFontResourceW ( LPCWSTR lpszFilename )
+{
+       return AddFontResourceExW ( lpszFilename, 0, 0 );
 }
 
 
 /*
 }
 
 
 /*
- * @unimplemented
+ * @implemented
  */
 HMETAFILE
 STDCALL
 CopyMetaFileW(
  */
 HMETAFILE
 STDCALL
 CopyMetaFileW(
-       HMETAFILE       a0,
-       LPCWSTR         a1
+       HMETAFILE       Src,
+       LPCWSTR         File
        )
 {
        )
 {
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+       return W32kCopyMetaFile ( Src, File );
 }
 
 
 }
 
 
@@ -439,22 +446,6 @@ StartDocW(
 }
 
 
 }
 
 
-/*
- * @unimplemented
- */
-int   
-STDCALL 
-GetObjectW(
-       HGDIOBJ         a0, 
-       int             a1, 
-       LPVOID          a2
-       )
-{
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-
 /*
  * @unimplemented
  */
 /*
  * @unimplemented
  */
index 388963b..315f203 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.3 2003/07/11 20:55:43 gvg Exp $
+# $Id: makefile,v 1.4 2003/07/21 01:59:51 royce Exp $
 
 PATH_TO_TOP = ../..
 
 
 PATH_TO_TOP = ../..
 
@@ -12,6 +12,7 @@ THREAD_OBJECTS = \
  thread/stack.o
 
 MISC_OBJECTS = \
  thread/stack.o
 
 MISC_OBJECTS = \
+ misc/devmode.o \
  misc/qsort.o
 
 TARGET_OBJECTS = $(THREAD_OBJECTS) $(MISC_OBJECTS)
  misc/qsort.o
 
 TARGET_OBJECTS = $(THREAD_OBJECTS) $(MISC_OBJECTS)
similarity index 95%
rename from reactos/lib/user32/misc/devmode.c
rename to reactos/lib/rosrtl/misc/devmode.c
index 645669b..d9e5fef 100644 (file)
@@ -1,9 +1,8 @@
 #include <string.h>
 #include <windows.h>
 #include <string.h>
 #include <windows.h>
-#include <user32.h>
 
 void
 
 void
-USER32_DevModeA2W ( LPDEVMODEW pW, const LPDEVMODEA pA )
+RosRtlDevModeA2W ( LPDEVMODEW pW, const LPDEVMODEA pA )
 {
 #define SIZEOF_DEVMODEA_300 124
 #define SIZEOF_DEVMODEA_400 148
 {
 #define SIZEOF_DEVMODEA_300 124
 #define SIZEOF_DEVMODEA_400 148
index c6c0172..f6496f1 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.20 2003/07/20 00:06:27 ekohl Exp $
+# $Id: Makefile,v 1.21 2003/07/21 01:59:51 royce Exp $
 
 PATH_TO_TOP = ../..
 
 
 PATH_TO_TOP = ../..
 
@@ -8,7 +8,7 @@ TARGET_NAME = user32
 
 TARGET_BASE = 0x77e70000
 
 
 TARGET_BASE = 0x77e70000
 
-TARGET_SDKLIBS = ntdll.a kernel32.a gdi32.a
+TARGET_SDKLIBS = ntdll.a kernel32.a gdi32.a rosrtl.a
 
 TARGET_CFLAGS = \
  -I./include \
 
 TARGET_CFLAGS = \
  -I./include \
@@ -32,7 +32,6 @@ CONTROLS_OBJECTS = \
 MISC_OBJECTS = \
        misc/dde.o \
        misc/desktop.o \
 MISC_OBJECTS = \
        misc/dde.o \
        misc/desktop.o \
-       misc/devmode.o \
        misc/display.o \
        misc/dllmain.o \
        misc/exit.o \
        misc/display.o \
        misc/dllmain.o \
        misc/exit.o \
index afcac74..ddc9630 100644 (file)
@@ -6,7 +6,3 @@
  */
 #include <windows.h>
 #include <win32k/win32k.h>
  */
 #include <windows.h>
 #include <win32k/win32k.h>
-
-/* see lib/user32/misc/devmode.c */
-void
-USER32_DevModeA2W ( LPDEVMODEW pW, const LPDEVMODEA pA );
index 42f6ec1..e750b73 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: desktop.c,v 1.14 2003/07/19 01:35:27 royce Exp $
+/* $Id: desktop.c,v 1.15 2003/07/21 01:59:51 royce Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS user32.dll
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS user32.dll
@@ -12,6 +12,7 @@
 #include <windows.h>
 #include <user32.h>
 #include <debug.h>
 #include <windows.h>
 #include <user32.h>
 #include <debug.h>
+#include <rosrtl/devmode.h>
 
 /*
  * @implemented
 
 /*
  * @implemented
@@ -112,7 +113,7 @@ CreateDesktopA(LPCSTR lpszDesktop,
       RtlInitUnicodeString(&DesktopNameU, NULL);
     }
 
       RtlInitUnicodeString(&DesktopNameU, NULL);
     }
 
-  USER32_DevModeA2W ( &DevmodeW, pDevmode );
+  RosRtlDevModeA2W ( &DevmodeW, pDevmode );
 
   hDesktop = CreateDesktopW(DesktopNameU.Buffer,
                            NULL,
 
   hDesktop = CreateDesktopW(DesktopNameU.Buffer,
                            NULL,
index b9fe9b2..3ec29ea 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: display.c,v 1.6 2003/07/19 01:35:27 royce Exp $
+/* $Id: display.c,v 1.7 2003/07/21 01:59:51 royce Exp $
  *
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/misc/dde.c
  *
  * PROJECT:         ReactOS user32.dll
  * FILE:            lib/user32/misc/dde.c
@@ -31,6 +31,7 @@
 #include <windows.h>
 #include <user32.h>
 #include <debug.h>
 #include <windows.h>
 #include <user32.h>
 #include <debug.h>
+#include <rosrtl/devmode.h>
 
 /* FUNCTIONS *****************************************************************/
 
 
 /* FUNCTIONS *****************************************************************/
 
@@ -128,7 +129,7 @@ EnumDisplaySettingsExA(
       return FALSE;
     }
 
       return FALSE;
     }
 
-  USER32_DevModeA2W ( &DevModeW, lpDevMode );
+  RosRtlDevModeA2W ( &DevModeW, lpDevMode );
 
   rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, &DevModeW, dwFlags );
 
 
   rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, &DevModeW, dwFlags );
 
@@ -240,7 +241,7 @@ ChangeDisplaySettingsExA(
       return DISP_CHANGE_BADPARAM; /* FIXME what to return? */
     }
 
       return DISP_CHANGE_BADPARAM; /* FIXME what to return? */
     }
 
-  USER32_DevModeA2W ( &DevModeW, lpDevMode );
+  RosRtlDevModeA2W ( &DevModeW, lpDevMode );
 
   rc = NtUserChangeDisplaySettings ( &DeviceName, &DevModeW, hwnd, dwflags, lParam );
 
 
   rc = NtUserChangeDisplaySettings ( &DeviceName, &DevModeW, hwnd, dwflags, lParam );