Пример #1
0
BOOL WINAPI DllMain(HINSTANCE hInst, DWORD fdwReason, LPVOID lpvReserved)
{
	g_xvid_hInst = hInst;

	/* Call directshow DllEntryPoint@12 */
    return DllEntryPoint(hInst, fdwReason, lpvReserved);
}
Пример #2
0
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
{
  if (reason == DLL_PROCESS_ATTACH)
  {
    ac3filter_instance = hinst;

    // Init NLS
    // Search NLS DLL at the filter's folder
    size_t path_size = MAX_PATH;
    char path[MAX_PATH];

    path_size = GetModuleFileName(hinst, path, (DWORD)path_size);
    if (path_size)
      if (cut_last_name(path, path_size))
        init_nls(path);

    // Init logging
    init_logging();
  }
  if (reason == DLL_PROCESS_DETACH)
  {
    uninit_logging();
  }
  return DllEntryPoint(hinst, reason, reserved);
}
Пример #3
0
__declspec(noinline) WINBOOL
__DllMainCRTStartup (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
{
  WINBOOL retcode = TRUE;

  __native_dllmain_reason = dwReason;
  if (dwReason == DLL_PROCESS_DETACH && __proc_attached == 0)
    {
	retcode = FALSE;
	goto i__leave;
    }
  if (dwReason == DLL_PROCESS_ATTACH || dwReason == DLL_THREAD_ATTACH)
    {
        retcode = DllEntryPoint (hDllHandle, dwReason, lpreserved);
	if (retcode)
	  retcode = _CRT_INIT (hDllHandle, dwReason, lpreserved);
	if (! retcode)
	  goto i__leave;
    }
  _pei386_runtime_relocator ();
  if (retcode && dwReason == DLL_PROCESS_ATTACH)
    __main ();
  retcode = DllMain(hDllHandle,dwReason,lpreserved);
  if ((dwReason == DLL_PROCESS_ATTACH) && ! retcode)
    {
	DllMain (hDllHandle, DLL_PROCESS_DETACH, lpreserved);
	_CRT_INIT (hDllHandle, DLL_PROCESS_DETACH, lpreserved);
	DllEntryPoint (hDllHandle, DLL_PROCESS_DETACH, lpreserved);
    }
  if (dwReason == DLL_PROCESS_DETACH || dwReason == DLL_THREAD_DETACH)
    {
	if (_CRT_INIT (hDllHandle, dwReason, lpreserved) == FALSE)
	  {
	    retcode = FALSE;
	  }
	if (retcode)
	  {
	    retcode = DllEntryPoint (hDllHandle, dwReason, lpreserved);
	  }
    }
i__leave:
  __native_dllmain_reason = UINT_MAX;
  return retcode ;
}
Пример #4
0
int __stdcall ___lscrtl_startup(HINSTANCE hInst, DWORD fdwReason, LPVOID lpvReserved)
{
    int flags;
    int rv;
    unsigned exceptBlock[2];
    char quote;
    char *cmd;
    asm mov [flags],edx;
    quote = 0;
    ___lsdllinit(flags, _dorundown, exceptBlock);
    if (!(flags & DLL) || fdwReason == DLL_PROCESS_ATTACH)
    {   
        if (flags & DLL)
        {
            if (!dllexists)
                dllexists++;
            else
            {
                MessageBox(0,"NonShared data segment required","Error",0);
                return 1;
            }
        }
    }
    __srproc(INITSTART, INITEND);
    if (flags & DLL)
    {
        rv = DllEntryPoint(hInst, fdwReason, lpvReserved) + 1;
    }
    else if (flags & GUI)
    {
        cmd = _oscmd;
        while ((!quote || *cmd != ' ') && *cmd)
        {
            if (*cmd == '"')
                quote ^= *cmd;
            cmd++;
        }
        while (*cmd && *cmd == ' ') cmd++;
        rv = WinMain(hInst, 0, cmd, 10) + 1;
    }
    else
    {
        rv = main(_argc, _argv, _environ) + 1;
    }
    if ((flags & DLL) && fdwReason == DLL_PROCESS_DETACH)
    {
        __srproc(EXITSTART, EXITEND);
    }
    rv--;
    if (!(flags & DLL))
    {
        _exit(rv);
        ExitProcess(rv); // needed to satisfy the debugger
    }
    return rv;
}
Пример #5
0
BOOL CFilterApp::InitInstance()
{
	if(!__super::InitInstance()) 
		return FALSE;
	
	SetRegistryKey(_T("SPlayer"));
	
	DllEntryPoint(AfxGetInstanceHandle(), DLL_PROCESS_ATTACH, 0);
	
	return TRUE;
}
Пример #6
0
BOOL APIENTRY DllMain(HANDLE hModule, 
                      DWORD  dwReason, 
                      LPVOID lpReserved)
{
	DbgSetModuleLevel(LOG_ERROR,5);
	DbgSetModuleLevel(LOG_TRACE,5); // comment this to remove trace
	//DbgSetModuleLevel(LOG_MEMORY,2);
	DbgSetModuleLevel(LOG_LOCKING,2);
	//DbgSetModuleLevel(LOG_TIMING,5);

	return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
}
Пример #7
0
BOOL CFilterApp::InitInstance()
{
    if (!__super::InitInstance()) {
        return FALSE;
    }

    WorkAroundMathLibraryBug();

    SetRegistryKey(_T("Gabest"));

    DllEntryPoint(AfxGetInstanceHandle(), DLL_PROCESS_ATTACH, 0);

    return TRUE;
}
Пример #8
0
BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  dwReason,
                       LPVOID lpReserved
					 )
{
	switch (dwReason)
	{
	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
}
Пример #9
0
BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
	try {
		if (ul_reason_for_call==DLL_PROCESS_ATTACH)
			CoInitializeEx(NULL, COINIT_MULTITHREADED);
		if (ul_reason_for_call==DLL_PROCESS_DETACH)
			CoUninitialize();
		return DllEntryPoint((HINSTANCE)(hModule), ul_reason_for_call, lpReserved);
	}
	catch( ... ) {
		return FALSE; // exception catched
	}
}
Пример #10
0
BOOL CVSFilterApp::InitInstance()
{
	if(!CWinApp::InitInstance())
		return FALSE;

	SetRegistryKey(_T("Gabest"));

	DllEntryPoint(AfxGetInstanceHandle(), DLL_PROCESS_ATTACH, 0); // "DllMain" of the dshow baseclasses

	STARTUPINFO si;
	GetStartupInfo(&si);
	m_AppName = CString(si.lpTitle);
	m_AppName.Replace('\\', '/');
	m_AppName = m_AppName.Mid(m_AppName.ReverseFind('/')+1);
	m_AppName.MakeLower();

	return TRUE;
}
Пример #11
0
BOOL APIENTRY DllMain(HANDLE hModule, 
					  DWORD  dwReason, 
					  LPVOID lpReserved)
{
	if (dwReason == DLL_PROCESS_DETACH)
	{
		xnLogClose();
	}

	BOOL bRes = DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);

	// init log from local file (if it exists)
	if (dwReason == DLL_PROCESS_ATTACH)
	{
		xnLogInitFromXmlFile("OpenNIConfig.xml");
	}

	return bRes;
}
Пример #12
0
BOOL APIENTRY DllMain(HANDLE hModule, 
					  DWORD  dwReason, 
					  LPVOID lpReserved)
{
    switch (dwReason)
    {
    case DLL_PROCESS_ATTACH:
		{
			//DbgSetModuleLevel(LOG_TRACE|LOG_MEMORY , 5); 
			FUNCTION_BLOCK_INIT();
		}
        break;
    case DLL_PROCESS_DETACH:
		{
			FUNCTION_BLOCK_UNINIT();
		}
        break;
    }
	return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
}
Пример #13
0
BOOL APIENTRY FilterDllMain(HMODULE hModule, 
							DWORD  dwReason, 
							LPVOID lpReserved)
{

	switch (dwReason)
	{
	case DLL_PROCESS_ATTACH:
		g_hModule = hModule;
		break;
	case DLL_THREAD_DETACH:
		break;
	case DLL_PROCESS_DETACH:
		g_hModule = 0;
		break;
	}

	_DllMainCRTStartup((HINSTANCE)hModule, dwReason, lpReserved);
	return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
}
Пример #14
0
BOOL WINAPI DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpReserved)
{
    return DllEntryPoint(reinterpret_cast<HINSTANCE>(hDllHandle), dwReason, lpReserved);
}
Пример #15
0
BOOL APIENTRY DllMain(HANDLE hModule, 
                      DWORD  dwReason, 
                      LPVOID lpReserved)
{
	return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
}
Пример #16
0
	virtual BOOL InitInstance()
	{
		return DllEntryPoint(m_hInstance, DLL_PROCESS_ATTACH, NULL);	// reserved param not used
	}
Пример #17
0
int CVSFilterApp::ExitInstance()
{
    DllEntryPoint(AfxGetInstanceHandle(), DLL_PROCESS_DETACH, 0); // "DllMain" of the dshow baseclasses

    return CWinApp::ExitInstance();
}
Пример #18
0
/* DLL entry point for Microsoft Visual C++ */
GSDLLEXPORT BOOL WINAPI
DllMain(HINSTANCE hInst, DWORD fdwReason, LPVOID lpReserved)
{
    return DllEntryPoint(hInst, fdwReason, lpReserved);
}
Пример #19
0
    virtual int ExitInstance()
	{
		return DllEntryPoint(m_hInstance, DLL_PROCESS_DETACH, NULL);	// reserved param not used
	}
Пример #20
0
BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
{
    util::GetHModule() = (HMODULE) hModule;
    return DllEntryPoint((HINSTANCE)hModule, dwReason, lpReserved);
}
Пример #21
0
BOOL WINAPI DllMain(HINSTANCE hDllHandle, DWORD dwReason, LPVOID lpReserved) {
	return DllEntryPoint(hDllHandle, dwReason, lpReserved);
}
Пример #22
0
BOOL APIENTRY DllMain(HANDLE hModule, DWORD  dwReason, LPVOID lpReserved) {
	DbgSetModuleLevel(LOG_TRACE, LOGING_LEVEL);
	return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
}
Пример #23
0
BOOL CFilterApp::ExitInstance()
{
    DllEntryPoint(AfxGetInstanceHandle(), DLL_PROCESS_DETACH, 0);

    return __super::ExitInstance();
}
Пример #24
0
BOOL APIENTRY DllMain(HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved)
{
	if(ul_reason_for_call == DLL_PROCESS_ATTACH)
		g_hInstance = (HINSTANCE)hModule;
	return DllEntryPoint(reinterpret_cast<HINSTANCE>(hModule), ul_reason_for_call, lpReserved);
}