summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-08-29 19:34:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-08-29 19:34:05 +0000
commitded569242b7cf4ba2aed1055797c55e680168897 (patch)
tree4588672c40c5b862b8fedb7ff2119dd7c2e07cf0
parenta69315d034c9fd6ece1a88bfe56fdef71b3d3b1c (diff)
log initialization moved to DllMain
git-svn-id: http://svn.miranda-ng.org/main/trunk@5882 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/ShellExt/src/main.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp
index b7b66556e6..08050b22ea 100644
--- a/plugins/ShellExt/src/main.cpp
+++ b/plugins/ShellExt/src/main.cpp
@@ -3,6 +3,8 @@
HINSTANCE hInst;
int hLangpack;
+static TCHAR tszLogPath[MAX_PATH];
+
PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -20,6 +22,9 @@ PLUGININFOEX pluginInfoEx = {
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH) {
+ GetTempPath(SIZEOF(tszLogPath), tszLogPath);
+ _tcscat_s(tszLogPath, SIZEOF(tszLogPath), _T("shlext.log"));
+
hInst = hinstDLL;
DisableThreadLibraryCalls(hinstDLL);
}
@@ -108,8 +113,6 @@ STDAPI DllUnregisterServer()
/////////////////////////////////////////////////////////////////////////////////////////
-static TCHAR tszLogPath[MAX_PATH];
-
void logA(const char *format, ...)
{
FILE *out = _tfopen(tszLogPath, _T("a+"));
@@ -126,9 +129,6 @@ extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&pluginInfoEx);
- GetTempPath(SIZEOF(tszLogPath), tszLogPath);
- _tcscat_s(tszLogPath, SIZEOF(tszLogPath), _T("shlext.log"));
-
InvokeThreadServer();
HookEvent(ME_OPT_INITIALISE, OnOptionsInit);
DllRegisterServer();