/* 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
actually running as a service.\r
This will save time when running with no arguments from a command prompt.\r
*/\r
- if (_fileno(stdin) < 0) {\r
- /* Set up function pointers. */\r
- if (get_imports()) exit(111);\r
-\r
+ if (! GetStdHandle(STD_INPUT_HANDLE)) {\r
/* Start service magic */\r
SERVICE_TABLE_ENTRY table[] = { { NSSM, service_main }, { 0, 0 } };\r
if (! StartServiceCtrlDispatcher(table)) {\r