Changeset 802 in dev
- Timestamp:
- Feb 6, 2011, 10:07:24 PM (14 years ago)
- Location:
- branches/egtra/ab5.0/abdev
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/egtra/ab5.0/abdev/OldWindowsHelper.asm
r801 r802 20 20 ImportTrap InterlockedPopEntrySList, 4 21 21 ImportTrap InterlockedCompareExchange, 12 22 ImportTrap GetModuleHandleW, 423 ImportTrap GetStartupInfoW, 424 ImportTrap GetEnvironmentStringsW, 025 ImportTrap FreeEnvironmentStringsW, 426 22 TrapTableLast LABEL DWORD 27 23 -
branches/egtra/ab5.0/abdev/OldWindowsHelperImpl.cpp
r801 r802 17 17 extern FARPROC alias__imp__InterlockedPushEntrySList; 18 18 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;23 19 extern void* TrapTableLast; 24 20 } // extern "C" … … 88 84 } 89 85 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 132 86 #define FUNCTION_INIT(name) \ 133 87 if (auto f = ::GetProcAddress(GetKernelModule(), #name)) { \ … … 159 113 alias__imp__InterlockedPushEntrySList = ::GetProcAddress(GetKernelModule(), "InterlockedPushEntrySList"); 160 114 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);165 115 166 116 ::VirtualProtect(&TrapTableFirst, -
branches/egtra/ab5.0/abdev/compiler.vcxproj
r801 r802 112 112 </ResourceCompile> 113 113 <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> 115 115 <AdditionalLibraryDirectories>..\jenga\lib\x86;lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> 116 116 <GenerateDebugInformation>true</GenerateDebugInformation> … … 192 192 </ResourceCompile> 193 193 <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> 195 195 <AdditionalLibraryDirectories>..\jenga\lib\x86;lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> 196 196 <GenerateDebugInformation>true</GenerateDebugInformation>
Note:
See TracChangeset
for help on using the changeset viewer.