Differences From Artifact [8bbe4efdd1d3598d]:
- File        
src/qbga32.d
- 2015-04-30 23:34:45 - part of checkin [c0856e8ace] on branch trunk - v0.05 (user: kinaba) [annotate]
 
 
To Artifact [1c734ac63ab48040]:
- File        
src/qbga32.d
- 
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
The problem was __gshared. Replacing it with TLS fixed the issue. Remaining problem is that "hack.d"'s CloseHandle hack is not working anymore.
(user: kinaba) [annotate] 
 - 
2015-05-05 06:49:05
- part of checkin
[9b639cf2d6]
on branch trunk
- Working version for update to 2.067.
 
    1  import core.sys.windows.dll;                                                     <
    2  import win32.windows;                                                                  1  import win32.windows;
    3  import win32.winuser;                                                            <
    4  import std.string;                                                                     2  import std.string;
    5  import std.file;                                                                       3  import std.file;
    6  import util;                                                                           4  import util;
    7  import windll;                                                                         5  import windll;
    8  import bga_melter;                                                                     6  import bga_melter;
    9  import qbga_gui;                                                                       7  import qbga_gui;
   10                                                                                         8  
   11  //----------------------------------------------------------------                     9  //----------------------------------------------------------------
   12  // おきまりのDLL初期化ルーチン                                                               |    10  // API転送処理
   13  //----------------------------------------------------------------                    11  //----------------------------------------------------------------
   14                                                                                        12  
   15  __gshared HINSTANCE g_hinst;                                                     <
   16                                                                                   <
   17  extern (Windows)                                                                 <
   18  BOOL DllMain( HINSTANCE inst, ULONG reason, void* reserved )                     <
   19  {                                                                                <
   20          switch( reason )                                                         <
   21          {                                                                        <
   22          case DLL_PROCESS_ATTACH:                                                 <
   23                  g_hinst = inst;                                                  <
   24                  dll_process_attach( inst, true );                                <
   25                  if( g_orig_dll is null )                                         <
   26                          return false;                                            <
   27                  break;                                                           <
   28                                                                                   <
   29          case DLL_PROCESS_DETACH:                                                 <
   30                  dll_process_detach( inst, true );                                <
   31                  break;                                                           <
   32                                                                                   <
   33          case DLL_THREAD_ATTACH:                                                  <
   34                  dll_thread_attach( true, true );                                 <
   35                  break;                                                           <
   36                                                                                   <
   37          case DLL_THREAD_DETACH:                                                  <
   38                  dll_thread_detach( true, true );                                 <
   39                  break;                                                           <
   40                                                                                   <
   41          default:                                                                 <
   42          }                                                                        <
   43          return true;                                                             <
   44  }                                                                                <
   45                                                                                   <
   46  //----------------------------------------------------------------               <
   47  // API転送処理                                                                       <
   48  //----------------------------------------------------------------               <
   49                                                                                   <
   50  __gshared WinDLL g_orig_dll = null;                                              |    13  WinDLL g_orig_dll = null;
   51  __gshared UINT   WM_ARCEXTRACT;                                                  |    14  UINT   WM_ARCEXTRACT;
   52                                                                                        15  
   53  static this()                                                                         16  static this()
   54  {                                                                                     17  {
   55          g_orig_dll = WinDLL.load( "_Bga32.DLL" );                                     18          g_orig_dll = WinDLL.load( "_Bga32.DLL" );
   56          WM_ARCEXTRACT = RegisterWindowMessage("wm_arcextract");                       19          WM_ARCEXTRACT = RegisterWindowMessage("wm_arcextract");
   57  }                                                                                     20  }
   58                                                                                        21