From 66ab0cd04c5e09d602c08d89c7e41c5c7fe9b2e4 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Tue, 13 Oct 2020 11:47:45 +0800 Subject: [PATCH] [td-225] --- src/os/src/windows/wSemphone.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/os/src/windows/wSemphone.c b/src/os/src/windows/wSemphone.c index ded7e41843..e72a6cb091 100644 --- a/src/os/src/windows/wSemphone.c +++ b/src/os/src/windows/wSemphone.c @@ -36,3 +36,19 @@ int64_t taosGetPthreadId() { bool taosComparePthread(pthread_t first, pthread_t second) { return first.p == second.p; } + +int32_t taosGetPId() { + return GetCurrentProcessId(); +} + +int32_t taosGetCurrentAPPName(char *name, int32_t* len) { + char filepath[1024] = {0}; + + GetModuleFileName(NULL, filepath, MAX_PATH); + *strrchr(filepath,'.') = '\0'; + strcpy(name, filepath); + + if (len != NULL) { + len = strlen(filepath); + } +} \ No newline at end of file