PATCH: Fix some return values of API calls

Sami Aario sami.aario at surfeu.fi
Sat Dec 27 17:52:27 CST 2003


Regression tests for these soon to follow.

ChangeLog:
Fix some return values of dplayx API calls. This behavior is undocumented as
far as
I can tell. However, at least one application (Icewind Dale) relies on it.
This is not an
all-inclusive list; I simply wrote these patches to get that one application
working.
-------------- next part --------------
Index: dplay.c
===================================================================
RCS file: /home/wine/wine/dlls/dplayx/dplay.c,v
retrieving revision 1.46
diff -u -r1.46 dplay.c
--- dplay.c	7 Oct 2003 03:30:47 -0000	1.46
+++ dplay.c	27 Dec 2003 23:21:00 -0000
@@ -1853,6 +1853,11 @@
   FIXME( "(%p)->(%p,0x%08lx,%u): semi stub\n",
          This, lpMsgHdr, idPlayer, bAnsi );
 
+  if( This->dp2->connectionInitialized == NO_PROVIDER )
+  {
+    return DPERR_UNINITIALIZED;
+  }
+
   if( DP_FindPlayer( This, idPlayer ) == NULL )
   {
     return DPERR_INVALIDPLAYER;
@@ -1950,6 +1955,11 @@
           This, idGroup, lpguidInstance, lpEnumPlayersCallback2,
           lpContext, dwFlags, bAnsi );
 
+  if( This->dp2->connectionInitialized == NO_PROVIDER )
+  {
+    return DPERR_UNINITIALIZED;
+  }
+
   /* Find the group */
   if( ( lpGData = DP_FindAnyGroup( This, idGroup ) ) == NULL )
   {
@@ -2609,6 +2619,11 @@
   TRACE( "(%p)->(0x%08lx,%p,%p,0x%08lx,%u)\n",
          This, idPlayer, lpData, lpdwDataSize, dwFlags, bAnsi );
 
+  if( This->dp2->connectionInitialized == NO_PROVIDER )
+  {
+    return DPERR_UNINITIALIZED;
+  }
+
   if( ( lpPList = DP_FindPlayer( This, idPlayer ) ) == NULL )
   {
     return DPERR_INVALIDPLAYER;
@@ -2750,6 +2765,11 @@
 
   TRACE( "(%p)->(%p,%p,%u)\n", This, lpData, lpdwDataSize, bAnsi );
 
+  if( This->dp2->connectionInitialized == NO_PROVIDER )
+  {
+    return DPERR_UNINITIALIZED;
+  }
+
   if( ( lpData == NULL ) && ( lpdwDataSize == NULL ) )
   {
     return DPERR_INVALIDPARAMS;
@@ -2930,6 +2950,11 @@
   FIXME( "(%p)->(%p,%p,0x%08lx,%p,%p,%u): stub\n",
          This, lpidFrom, lpidTo, dwFlags, lpData, lpdwDataSize, bAnsi );
 
+  if( This->dp2->connectionInitialized == NO_PROVIDER )
+  {
+    return DPERR_UNINITIALIZED;
+  }
+
   if( dwFlags == 0 )
   {
     dwFlags = DPRECEIVE_ALL;
@@ -3212,6 +3237,11 @@
 
   TRACE( "(%p)->(%p,0x%08lx,%u,%u)\n",
          This, lpSessDesc, dwFlags, bInitial, bAnsi );
+
+  if( This->dp2->connectionInitialized == NO_PROVIDER )
+  {
+    return DPERR_UNINITIALIZED;
+  }
 
   if( dwFlags )
   {


More information about the wine-patches mailing list