Sha256: 7d261a3f8bd203186d5591b9467c69479c83a811ab746e1c135aff5942b38dd8

Contents?: true

Size: 893 Bytes

Versions: 1

Compression:

Stored size: 893 Bytes

Contents

// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"

IUIAutomation *pAutomation ;

IUIAutomation* getGlobalIUIAutomation() {
	return pAutomation ;
}


BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH: 
	case DLL_THREAD_ATTACH:
		HRESULT hr ;
		hr = CoInitialize(NULL) ;
		if (FAILED(hr)) {
			printf("UiaDll: CoInitialize failed. hr = 0x%x", hr) ;
			return FALSE ;
		}
		hr = CoCreateInstance(__uuidof(CUIAutomation), NULL, CLSCTX_INPROC_SERVER, __uuidof(IUIAutomation), (void**)&pAutomation);
		if (FAILED(hr)) {
			printf("UiaDll: CoCreateInstance failed. hr = 0x%x", hr) ;
			return FALSE ;
		}
		break ;
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		CoUninitialize() ;
		break;
	}
	return TRUE;
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rdp-rautomation-0.6.3.1 ext/UiaDll/UiaDll/dllmain.cpp