aboutsummaryrefslogtreecommitdiffstats
path: root/config/openvpn-client-export/source/procchain.cpp
diff options
context:
space:
mode:
authorrob iscool <robrob2626@yahoo.com>2009-03-01 04:02:38 -0800
committerrob iscool <robrob2626@yahoo.com>2009-03-01 04:02:38 -0800
commit83d4c55637161dc97fd611fa4faf3f1872dcc8da (patch)
tree776ffa3f6a5705e99d991bf2885573c071d5a674 /config/openvpn-client-export/source/procchain.cpp
parent8bab9b24ba7dd0516255515fe6a0a0c8675c11de (diff)
downloadpfsense-packages-83d4c55637161dc97fd611fa4faf3f1872dcc8da.tar.gz
pfsense-packages-83d4c55637161dc97fd611fa4faf3f1872dcc8da.tar.bz2
pfsense-packages-83d4c55637161dc97fd611fa4faf3f1872dcc8da.zip
Updates to Snort.inc and Snort.xml 03-01-09
Diffstat (limited to 'config/openvpn-client-export/source/procchain.cpp')
-rwxr-xr-xconfig/openvpn-client-export/source/procchain.cpp160
1 files changed, 80 insertions, 80 deletions
diff --git a/config/openvpn-client-export/source/procchain.cpp b/config/openvpn-client-export/source/procchain.cpp
index b95536cc..dec1c284 100755
--- a/config/openvpn-client-export/source/procchain.cpp
+++ b/config/openvpn-client-export/source/procchain.cpp
@@ -1,80 +1,80 @@
-
-/*
- * Copyright (c) 2008
- * Shrew Soft Inc. All rights reserved.
- *
- * AUTHOR : Matthew Grooms
- * mgrooms@shrew.net
- *
- */
-
-#include <windows.h>
-#include <stdio.h>
-
-bool runproc( char * path )
-{
- STARTUPINFO si;
- memset( &si, 0, sizeof( si ) );
- si.cb = sizeof( si );
-
- PROCESS_INFORMATION pi;
- memset( &pi, 0, sizeof( pi ) );
-
- // Start the child process.
- if( !CreateProcess(
- NULL, // No module name (use command line).
- path, // Command line.
- NULL, // Process handle not inheritable.
- NULL, // Thread handle not inheritable.
- FALSE, // Set handle inheritance to FALSE.
- 0, // No creation flags.
- NULL, // Use parent's environment block.
- NULL, // Use parent's starting directory.
- &si, // Pointer to STARTUPINFO structure.
- &pi ) ) // Pointer to PROCESS_INFORMATION structure.
- {
- return false;
- }
-
- // Wait until child process exits.
- WaitForSingleObject( pi.hProcess, INFINITE );
-
- // Get the exit code
- DWORD ExitCode;
- GetExitCodeProcess( pi.hProcess, &ExitCode );
-
- // Close process and thread handles.
- CloseHandle( pi.hProcess );
- CloseHandle( pi.hThread );
-
- return ( ExitCode == 0 );
-}
-
-int APIENTRY WinMain(
- HINSTANCE hinstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow )
-{
- FILE * fp;
- if( fopen_s( &fp, lpCmdLine, "r" ) )
- return -1;
-
- while( true )
- {
- char cmd[ MAX_PATH ];
- memset( cmd, 0, MAX_PATH );
- if( fgets( cmd, MAX_PATH, fp ) == NULL )
- break;
-
- char * term = strchr( cmd, '\n' );
- if( term != NULL )
- *term = 0;
-
- if( !runproc( cmd ) )
- return -2;
- }
-
- return 0;
-}
-
+
+/*
+ * Copyright (c) 2008
+ * Shrew Soft Inc. All rights reserved.
+ *
+ * AUTHOR : Matthew Grooms
+ * mgrooms@shrew.net
+ *
+ */
+
+#include <windows.h>
+#include <stdio.h>
+
+bool runproc( char * path )
+{
+ STARTUPINFO si;
+ memset( &si, 0, sizeof( si ) );
+ si.cb = sizeof( si );
+
+ PROCESS_INFORMATION pi;
+ memset( &pi, 0, sizeof( pi ) );
+
+ // Start the child process.
+ if( !CreateProcess(
+ NULL, // No module name (use command line).
+ path, // Command line.
+ NULL, // Process handle not inheritable.
+ NULL, // Thread handle not inheritable.
+ FALSE, // Set handle inheritance to FALSE.
+ 0, // No creation flags.
+ NULL, // Use parent's environment block.
+ NULL, // Use parent's starting directory.
+ &si, // Pointer to STARTUPINFO structure.
+ &pi ) ) // Pointer to PROCESS_INFORMATION structure.
+ {
+ return false;
+ }
+
+ // Wait until child process exits.
+ WaitForSingleObject( pi.hProcess, INFINITE );
+
+ // Get the exit code
+ DWORD ExitCode;
+ GetExitCodeProcess( pi.hProcess, &ExitCode );
+
+ // Close process and thread handles.
+ CloseHandle( pi.hProcess );
+ CloseHandle( pi.hThread );
+
+ return ( ExitCode == 0 );
+}
+
+int APIENTRY WinMain(
+ HINSTANCE hinstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow )
+{
+ FILE * fp;
+ if( fopen_s( &fp, lpCmdLine, "r" ) )
+ return -1;
+
+ while( true )
+ {
+ char cmd[ MAX_PATH ];
+ memset( cmd, 0, MAX_PATH );
+ if( fgets( cmd, MAX_PATH, fp ) == NULL )
+ break;
+
+ char * term = strchr( cmd, '\n' );
+ if( term != NULL )
+ *term = 0;
+
+ if( !runproc( cmd ) )
+ return -2;
+ }
+
+ return 0;
+}
+