Handle well-known account names.
[nssm.git] / nssm.cpp
index 35001d3..e29ead6 100644 (file)
--- a/nssm.cpp
+++ b/nssm.cpp
@@ -77,6 +77,9 @@ int _tmain(int argc, TCHAR **argv) {
   /* Remember if we are admin */\r
   check_admin();\r
 \r
+  /* Set up function pointers. */\r
+  if (get_imports()) exit(111);\r
+\r
   /* Elevate */\r
   if (argc > 1) {\r
     /*\r
@@ -137,9 +140,6 @@ int _tmain(int argc, TCHAR **argv) {
     This will save time when running with no arguments from a command prompt.\r
   */\r
   if (! GetStdHandle(STD_INPUT_HANDLE)) {\r
-    /* Set up function pointers. */\r
-    if (get_imports()) exit(111);\r
-\r
     /* Start service magic */\r
     SERVICE_TABLE_ENTRY table[] = { { NSSM, service_main }, { 0, 0 } };\r
     if (! StartServiceCtrlDispatcher(table)) {\r