[Wine-patches] [eterhack eter-2.0.0 1/2] Add special function for checking process name (eterbug #8453).

Alexander Morozov amorozov на etersoft.ru
Вт Май 15 22:30:58 MSK 2012


Based on get_process_name from dlls/winex11.drv/window.c.
---
 include/wine/etersoft.h |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/include/wine/etersoft.h b/include/wine/etersoft.h
index 5b3ff07..13d16bc 100644
--- a/include/wine/etersoft.h
+++ b/include/wine/etersoft.h
@@ -63,6 +63,24 @@ static void *natspec_handle = ETERUNI;
             NATSPECLOAD_FUNCPTR(n) \
     }
 
+#ifdef ETERCHECK
+static inline int etercheck_process_name(const char *name)
+{
+    char module[MAX_PATH];
+    DWORD len = GetModuleFileNameA(0, module, MAX_PATH);
+
+    if (len && len < MAX_PATH)
+    {
+        char *p, *appname = module;
+
+        if ((p = strrchr(appname, '/'))) appname = p + 1;
+        if ((p = strrchr(appname, '\\'))) appname = p + 1;
+        return !strcasecmp(appname, name);
+    }
+    return 0;
+}
+#endif
+
 /* Proprietary Etersoft's functions pointers */
 typedef int (*t_etersoft_initialize)(int dword_size, int file_flags, const char *text);
 
-- 
1.7.9.7



Подробная информация о списке рассылки Wine-patches