ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

dplayx_main.c
Go to the documentation of this file.
00001 /*
00002  * DPLAYX.DLL LibMain
00003  *
00004  * Copyright 1999,2000 - Peter Hunnisett
00005  *
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  * NOTES
00022  *  o DPMSGCMD_ENUMSESSIONSREPLY & DPMSGCMD_ENUMSESSIONSREQUEST
00023  *    Have most fields understood, but not all.  Everything seems to work.
00024  *  o DPMSGCMD_REQUESTNEWPLAYERID & DPMSGCMD_NEWPLAYERIDREPLY
00025  *    Barely work. This needs to be completed for sessions to start.
00026  *  o A small issue will be the fact that DirectX 6.1(ie. DirectPlay4)
00027  *    introduces a layer of functionality inside the DP objects which
00028  *    provide guaranteed protocol delivery.  This is even if the native
00029  *    protocol, IPX or modem for instance, doesn't guarantee it. I'm going
00030  *    to leave this kind of implementation to as close to the end as
00031  *    possible. However, I will implement an abstraction layer, where
00032  *    possible, for this functionality. It will do nothing to start, but
00033  *    will require only the implementation of the guaranteness to give
00034  *    final implementation.
00035  *
00036  * TODO:
00037  *  - Implement mutual exclusion on object data for existing functions
00038  *  - Ensure that all dll stubs are present and the ordinals are correct
00039  *  - Addition of DirectX 7.0 functionality for direct play
00040  *  - Implement some WineLib test programs using sdk programs as a skeleton
00041  *  - Change RegEnumKeyEx enumeration pattern to allow error handling and to
00042  *    share registry implementation (or at least simplify).
00043  *  - Add in appropriate RegCloseKey calls for all the opening we're doing...
00044  *  - Fix all the buffer sizes for registry calls. They're off by one -
00045  *    but in a safe direction.
00046  *  - Fix race condition on interface destruction
00047  *  - Handles need to be correctly reference counted
00048  *  - Check if we need to deallocate any list objects when destroying
00049  *    a dplay interface
00050  *  - RunApplication process spawning needs to have correct syncronization.
00051  *  - Need to get inter lobby messages working.
00052  *  - Decypher dplay messages between applications and implement...
00053  *  - Need to implement lobby session spawning.
00054  *  - Improve footprint and realtime blocking by setting up a separate data share
00055  *    between lobby application and client since there can be multiple apps per
00056  *    client. Also get rid of offset dependency by making data offset independent
00057  *    somehow.
00058  */
00059 #include <stdarg.h>
00060 
00061 #include "winerror.h"
00062 #include "windef.h"
00063 #include "winbase.h"
00064 #include "wine/debug.h"
00065 #include "dplayx_global.h"
00066 
00067 WINE_DEFAULT_DEBUG_CHANNEL(dplay);
00068 
00069 /* This is a globally exported variable at ordinal 6 of DPLAYX.DLL */
00070 DWORD gdwDPlaySPRefCount = 0; /* FIXME: Should it be initialized here? */
00071 
00072 
00073 BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
00074 {
00075 
00076   TRACE( "(%p,%ld,%p)\n", hinstDLL, fdwReason, lpvReserved );
00077 
00078   switch ( fdwReason )
00079   {
00080     case DLL_PROCESS_ATTACH:
00081         DisableThreadLibraryCalls(hinstDLL);
00082         /* First instance perform construction of global processor data */
00083         return DPLAYX_ConstructData();
00084 
00085     case DLL_PROCESS_DETACH:
00086         /* Last instance performs destruction of global processor data */
00087         return DPLAYX_DestructData();
00088 
00089     default:
00090       break;
00091 
00092   }
00093 
00094   return TRUE;
00095 }
00096 
00097 /***********************************************************************
00098  *              DllCanUnloadNow (DPLAYX.@)
00099  */
00100 HRESULT WINAPI DllCanUnloadNow(void)
00101 {
00102   HRESULT hr = ( gdwDPlaySPRefCount > 0 ) ? S_FALSE : S_OK;
00103 
00104   /* FIXME: Should I be putting a check in for class factory objects
00105    *        as well
00106    */
00107 
00108   TRACE( ": returning 0x%08lx\n", hr );
00109 
00110   return hr;
00111 }

Generated on Sun May 27 2012 04:21:38 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.