Fix the DCICreatePrimary() prototype

Francois Gouget fgouget at free.fr
Wed Apr 20 10:00:51 CDT 2005



Changelog:

  * dlls/dciman32/dciman_main.c
    include/Makefile.in
    include/dciddi.h
    include/dciman.h
    tools/winapi/win32.api

    Francois Gouget <fgouget at free.fr>
    Fix the DCICreatePrimary() prototype. It's supposed to return an int 
so have it return DCI_FAIL_UNSUPPORTED.
    Add the needed error codes and the DCISURFACEINFO definition to dciddi.h
    Add dciman.h and put the function prototypes there.
    dciddi.h and dciman.h should be installed with the other Windows headers.
    Fixes a winapi_check warning.

-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
May your Tongue stick to the Roof of your Mouth with the Force of a Thousand Caramels.
-------------- next part --------------
Index: dlls/dciman32/dciman_main.c
===================================================================
RCS file: /var/cvs/wine/dlls/dciman32/dciman_main.c,v
retrieving revision 1.9
diff -u -p -r1.9 dciman_main.c
--- dlls/dciman32/dciman_main.c	15 Apr 2005 16:11:56 -0000	1.9
+++ dlls/dciman32/dciman_main.c	20 Apr 2005 10:01:26 -0000
@@ -25,6 +25,7 @@
 #include "windef.h"
 #include "winbase.h"
 #include "winerror.h"
+#include "dciman.h"
 #include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(dciman);
@@ -47,7 +48,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWO
 HDC WINAPI
 DCIOpenProvider(void) {
     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-    return 0;
+    return NULL;
 }
 
 /***********************************************************************
@@ -62,10 +63,10 @@ DCICloseProvider(HDC hdc) {
 /**************************************************************************
  *                 DCICreatePrimary (DCIMAN32.@)
  */
-void WINAPI 
-DCICreatePrimary(HDC hdc, LPVOID pDciSurfaceInfo)
+int WINAPI 
+DCICreatePrimary(HDC hdc, LPDCISURFACEINFO *pDciSurfaceInfo)
 {
     SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
     FIXME("%p %p\n", hdc, pDciSurfaceInfo);
-    return;
+    return DCI_FAIL_UNSUPPORTED;
 }
Index: include/Makefile.in
===================================================================
RCS file: /var/cvs/wine/include/Makefile.in,v
retrieving revision 1.165
diff -u -p -r1.165 Makefile.in
--- include/Makefile.in	20 Apr 2005 12:52:24 -0000	1.165
+++ include/Makefile.in	20 Apr 2005 14:56:38 -0000
@@ -76,6 +76,8 @@ WINDOWS_INCLUDES = \
 	d3dx8core.h \
 	dbghelp.h \
 	dbt.h \
+	dciddi.h \
+	dciman.h \
 	dde.h \
 	ddeml.h \
 	ddraw.h \
Index: include/dciddi.h
===================================================================
RCS file: /var/cvs/wine/include/dciddi.h,v
retrieving revision 1.2
diff -u -p -r1.2 dciddi.h
--- include/dciddi.h	10 Mar 2002 00:02:34 -0000	1.2
+++ include/dciddi.h	20 Apr 2005 10:00:27 -0000
@@ -36,7 +36,11 @@ extern "C" {
 #define DCIESCAPE			5
 
 /* DCI Errors */
-#define DCI_OK		0
+#define DCI_OK		                0
+#define DCI_FAIL_GENERIC               -1
+#define DCI_FAIL_UNSUPPORTEDVERSION    -2
+#define DCI_FAIL_INVALIDSURFACE        -3
+#define DCI_FAIL_UNSUPPORTED           -4
 
 
 typedef int DCIRVAL; /* DCI callback return type */
@@ -52,6 +56,26 @@ typedef struct _DCICMD {
     DWORD dwReserved;
 } DCICMD,*LPDCICMD;
 
+typedef struct _DCISURFACEINFO {
+    DWORD dwSize;
+    DWORD dwDCICaps;
+    DWORD dwCompression;
+    DWORD dwMask[3];
+    DWORD dwWidth;
+    DWORD dwHeight;
+    LONG  lStride;
+    DWORD dwBitCount;
+    ULONG_PTR dwOffSurface;
+    WORD  wSelSurface;
+    WORD  wReserved;
+    DWORD dwReserved1;
+    DWORD dwReserved2;
+    DWORD dwReserved3;
+    DCIRVAL (CALLBACK *BeginAccess)(LPVOID, LPRECT);
+    void (CALLBACK *EndAccess)(LPVOID);
+    void (CALLBACK *DestroySurface)(LPVOID);
+} DCISURFACEINFO, *LPDCISURFACEINFO;
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif
Index: tools/winapi/win32.api
===================================================================
RCS file: /var/cvs/wine/tools/winapi/win32.api,v
retrieving revision 1.25
diff -u -p -r1.25 win32.api
--- tools/winapi/win32.api	29 Mar 2005 11:31:39 -0000	1.25
+++ tools/winapi/win32.api	20 Apr 2005 12:02:46 -0000
@@ -707,6 +712,11 @@ PSTR
 %long
 
 HDC
+int
+
+%ptr
+
+LPDCISURFACEINFO *
 
 %void
 
--- /dev/null	2005-04-10 00:59:21.000000000 +0200
+++ include/dciman.h	2005-04-20 11:57:01.000000000 +0200
@@ -0,0 +1,36 @@
+/*
+ * DCI driver interface
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __WINE_DCIMAN_H
+#define __WINE_DCIMAN_H
+
+#include <dciddi.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+HDC         WINAPI DCIOpenProvider(void);
+void        WINAPI DCICloseProvider(HDC);
+int         WINAPI DCICreatePrimary(HDC,LPDCISURFACEINFO*);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* __WINE_DCIMAN_H */


More information about the wine-patches mailing list