Changeset 802 in dev


Ignore:
Timestamp:
Feb 6, 2011, 10:07:24 PM (13 years ago)
Author:
イグトランス (egtra)
Message:

コンパイラでもMSLUを使用するように変更

Location:
branches/egtra/ab5.0/abdev
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/egtra/ab5.0/abdev/OldWindowsHelper.asm

    r801 r802  
    2020    ImportTrap InterlockedPopEntrySList, 4
    2121    ImportTrap InterlockedCompareExchange, 12
    22     ImportTrap GetModuleHandleW, 4
    23     ImportTrap GetStartupInfoW, 4
    24     ImportTrap GetEnvironmentStringsW, 0
    25     ImportTrap FreeEnvironmentStringsW, 4
    2622    TrapTableLast LABEL DWORD
    2723
  • branches/egtra/ab5.0/abdev/OldWindowsHelperImpl.cpp

    r801 r802  
    1717    extern FARPROC alias__imp__InterlockedPushEntrySList;
    1818    extern FARPROC alias__imp__InterlockedPopEntrySList;
    19     extern FARPROC alias__imp__GetModuleHandleW;
    20     extern FARPROC alias__imp__GetStartupInfoW;
    21     extern FARPROC alias__imp__GetEnvironmentStringsW;
    22     extern FARPROC alias__imp__FreeEnvironmentStringsW;
    2319    extern void* TrapTableLast;
    2420} // extern "C"
     
    8884}
    8985
    90 HMODULE WINAPI Alternative_GetModuleHandleW(LPCWSTR moduleName)
    91 {
    92     HMODULE ret = nullptr;
    93     auto size = std::wcslen(moduleName) + 1;
    94     auto mbsSize = size * 2;
    95     if (auto buffer = static_cast<LPSTR>(::HeapAlloc(::GetProcessHeap(), HEAP_ZERO_MEMORY, mbsSize)))
    96     {
    97         if (::WideCharToMultiByte(CP_ACP, 0, moduleName, static_cast<int>(size), buffer, static_cast<int>(mbsSize), nullptr, nullptr) > 0)
    98         {
    99             ret = ::GetModuleHandleA(buffer);
    100         }
    101         ::HeapFree(::GetProcessHeap(), 0, buffer);
    102     }
    103     return ret;
    104 }
    105 
    106 // CRT用に最小限の実装
    107 void WINAPI Alternative_GetStartupInfoW(LPSTARTUPINFOW psi)
    108 {
    109     STARTUPINFOA sia;
    110     ::GetStartupInfoA(&sia);
    111 
    112     *psi = STARTUPINFOW();
    113     psi->cb = sizeof *psi;
    114     if (sia.dwFlags & STARTF_USESHOWWINDOW)
    115     {
    116         psi->dwFlags = STARTF_USESHOWWINDOW;
    117         psi->wShowWindow = sia.wShowWindow;
    118     }
    119 }
    120 
    121 LPWCH WINAPI Alternative_GetEnvironmentStringsW()
    122 {
    123     static WCHAR c[2];
    124     return c;
    125 }
    126 
    127 BOOL WINAPI Alternative_FreeEnvironmentStringsW(LPWCH)
    128 {
    129     return TRUE;
    130 }
    131 
    13286#define FUNCTION_INIT(name) \
    13387    if (auto f = ::GetProcAddress(GetKernelModule(), #name)) { \
     
    159113    alias__imp__InterlockedPushEntrySList = ::GetProcAddress(GetKernelModule(), "InterlockedPushEntrySList");
    160114    alias__imp__InterlockedPopEntrySList = ::GetProcAddress(GetKernelModule(), "InterlockedPopEntrySList");
    161     FUNCTION_INIT_9X(GetModuleHandleW);
    162     FUNCTION_INIT_9X(GetStartupInfoW);
    163     FUNCTION_INIT_9X(GetEnvironmentStringsW);
    164     FUNCTION_INIT_9X(FreeEnvironmentStringsW);
    165115
    166116    ::VirtualProtect(&TrapTableFirst,
  • branches/egtra/ab5.0/abdev/compiler.vcxproj

    r801 r802  
    112112    </ResourceCompile>
    113113    <Link>
    114       <AdditionalDependencies>comctl32.lib;psapi.lib;imagehlp.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
     114      <AdditionalDependencies>unicows.lib;comctl32.lib;psapi.lib;imagehlp.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
    115115      <AdditionalLibraryDirectories>..\jenga\lib\x86;lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    116116      <GenerateDebugInformation>true</GenerateDebugInformation>
     
    192192    </ResourceCompile>
    193193    <Link>
    194       <AdditionalDependencies>comctl32.lib;psapi.lib;imagehlp.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
     194      <AdditionalDependencies>unicows.lib;comctl32.lib;psapi.lib;imagehlp.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
    195195      <AdditionalLibraryDirectories>..\jenga\lib\x86;lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
    196196      <GenerateDebugInformation>true</GenerateDebugInformation>
Note: See TracChangeset for help on using the changeset viewer.