javaswarm.dll.c
上传用户:shenzhenrh
上传日期:2013-05-12
资源大小:2904k
文件大小:3k
源码类别:

信息检索与抽取

开发平台:

Unix_Linux

  1. /* dllinit.c -- Portable DLL initialization. 
  2.    Copyright (C) 1998, 1999 Free Software Foundation, Inc.
  3.    Contributed by Mumit Khan (khan@xraylith.wisc.edu).
  4.    I've used DllMain as the DLL "main" since that's the most common 
  5.    usage. MSVC and Mingw32 both default to DllMain as the standard
  6.    callback from the linker entry point. Cygwin, as of b20.1, also
  7.    uses DllMain as the default callback from the entry point.
  8.    The real entry point is typically always defined by the runtime 
  9.    library, and usually never overridden by (casual) user. What you can 
  10.    override however is the callback routine that the entry point calls, 
  11.    and this file provides such a callback function, DllMain.
  12.    Mingw32: The default entry point for mingw32 is DllMainCRTStartup
  13.    which is defined in libmingw32.a This in turn calls DllMain which is
  14.    defined here. If not defined, there is a stub in libmingw32.a which
  15.    does nothing.
  16.    Cygwin: The default entry point for Cygwin b20.1 or newer is
  17.    __cygwin_dll_entry which is defined in libcygwin.a. This in turn
  18.    calls the routine DllMain. If not defined, there is a stub in
  19.    libcygwin.a which does nothing. 
  20.    MSVC: MSVC runtime calls DllMain, just like Mingw32.
  21.    Summary: If you need to do anything special in DllMain, just add it
  22.    here. Otherwise, the default setup should be just fine for 99%+ of
  23.    the time. I strongly suggest that you *not* change the entry point,
  24.    but rather change DllMain as appropriate.
  25.  */
  26. #define WIN32_LEAN_AND_MEAN
  27. #include <windows.h>
  28. #undef WIN32_LEAN_AND_MEAN
  29. #include <stdio.h>
  30. BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, 
  31.                        LPVOID reserved /* Not used. */ );
  32. /*
  33.  *----------------------------------------------------------------------
  34.  *
  35.  * DllMain --
  36.  *
  37.  * This routine is called by the Mingw32, Cygwin32 or VC++ C run 
  38.  * time library init code, or the Borland DllEntryPoint routine. It 
  39.  * is responsible for initializing various dynamically loaded 
  40.  * libraries.
  41.  *
  42.  * Results:
  43.  *      TRUE on sucess, FALSE on failure.
  44.  *
  45.  * Side effects:
  46.  *
  47.  *----------------------------------------------------------------------
  48.  */
  49. BOOL APIENTRY
  50. DllMain (
  51.  HINSTANCE hInst /* Library instance handle. */ ,
  52.  DWORD reason /* Reason this function is being called. */ ,
  53.  LPVOID reserved /* Not used. */ )
  54. {
  55.   switch (reason)
  56.     {
  57.     case DLL_PROCESS_ATTACH:
  58.       break;
  59.     case DLL_PROCESS_DETACH:
  60.       break;
  61.     case DLL_THREAD_ATTACH:
  62.       break;
  63.     case DLL_THREAD_DETACH:
  64.       break;
  65.     }
  66.   return TRUE;
  67. }
  68. #if 0
  69. #include <cygwin/cygwin_dll.h>
  70. DECLARE_CYGWIN_DLL (DllMain);
  71. #endif