diff cinst/windowsstore.c @ 321:824ef90a6721

Move is_elevated into common/util.c file for better reuse
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 07 Apr 2014 10:58:47 +0000
parents 759a898990d1
children 17e1c8f37d72
line wrap: on
line diff
--- a/cinst/windowsstore.c	Fri Apr 04 18:00:40 2014 +0200
+++ b/cinst/windowsstore.c	Mon Apr 07 10:58:47 2014 +0000
@@ -7,6 +7,7 @@
 #include "listutil.h"
 #include "strhelp.h"
 #include "logging.h"
+#include "util.h"
 
 static PCCERT_CONTEXT
 b64_to_cert_context(char *b64_data, size_t b64_size)
@@ -160,25 +161,6 @@
   return;
 }
 
-static bool is_elevated() {
-    HANDLE hToken = NULL;
-    bool ret = false;
-    if (OpenProcessToken (GetCurrentProcess(), TOKEN_QUERY, &hToken))
-      {
-        DWORD elevation;
-        DWORD cbSize = sizeof (DWORD);
-        if (GetTokenInformation (hToken, TokenElevation, &elevation,
-                                 sizeof (TokenElevation), &cbSize))
-          {
-            ret = elevation;
-          }
-      }
-    if (hToken)
-      CloseHandle (hToken);
-
-    return ret;
-}
-
 int
 write_stores_win (char **to_install, char **to_remove)
 {

http://wald.intevation.org/projects/trustbridge/