예제 #1
0
void DynamicLinkLibrary::Open(const wchar_t *pwszPath){
	UniqueHandle<X_LibraryFreer> hDll;
	if(!hDll.Reset(reinterpret_cast<X_LibraryFreer::Handle>(::LoadLibraryW(pwszPath)))){
		DEBUG_THROW(SystemError, "LoadLibraryW"_rcs);
	}

	x_hDll = std::move(hDll);
}
예제 #2
0
	xDelegate(std::size_t uInitCount, std::size_t uMaxCount, const wchar_t *pwszName){
		ASSERT((uInitCount <= LONG_MAX) && (uMaxCount <= LONG_MAX));

		xm_hSemaphore.Reset(::CreateSemaphoreW(nullptr, (long)uInitCount, (long)uMaxCount, pwszName));
		if(!xm_hSemaphore){
			MCF_THROW(::GetLastError(), L"CreateSemaphoreW() 失败。");
		}
	}