Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Inglis2002-09-03 16:16:20 +0000
committerDavid Inglis2002-09-03 16:16:20 +0000
commit25863f8649290d33e14f1d3c10a22be8f2bc7ff5 (patch)
tree6c1d79e068f5dc092a1d9ae22c0bbc9be3c07bcd /core/org.eclipse.cdt.core.win32/library/spawner.c
parent484862d9105b974fcfb745ded4821ba691e50cac (diff)
downloadorg.eclipse.cdt-25863f8649290d33e14f1d3c10a22be8f2bc7ff5.tar.gz
org.eclipse.cdt-25863f8649290d33e14f1d3c10a22be8f2bc7ff5.tar.xz
org.eclipse.cdt-25863f8649290d33e14f1d3c10a22be8f2bc7ff5.zip
windows spawner
Diffstat (limited to 'core/org.eclipse.cdt.core.win32/library/spawner.c')
-rw-r--r--core/org.eclipse.cdt.core.win32/library/spawner.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core.win32/library/spawner.c b/core/org.eclipse.cdt.core.win32/library/spawner.c
new file mode 100644
index 00000000000..49537cf5825
--- /dev/null
+++ b/core/org.eclipse.cdt.core.win32/library/spawner.c
@@ -0,0 +1,41 @@
+// spawner.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+
+
+CRITICAL_SECTION cs;
+
+TCHAR path[MAX_PATH + 1] = {_T('\0') };
+
+
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ {
+ LPTSTR p;
+ InitializeCriticalSection(&cs);
+ GetModuleFileName(hModule, path, MAX_PATH);
+ p = _tcsrchr(path, _T('\\'));
+ if(NULL != p)
+ *(p + 1) = _T('\0');
+ else
+ _tcscat(path, "\\");
+ }
+ break;
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ break;
+ case DLL_PROCESS_DETACH:
+ DeleteCriticalSection(&cs);
+ break;
+ }
+ return TRUE;
+}
+
+

Back to the top