diff options
author | nelsonb%netscape.com <devnull@localhost> | 2002-06-28 23:30:48 +0000 |
---|---|---|
committer | nelsonb%netscape.com <devnull@localhost> | 2002-06-28 23:30:48 +0000 |
commit | 61c75a175ac1528ab3d0bf7bb11ce3732e10dc0a (patch) | |
tree | f37619f326aab934caaba8a45f7e7e10c578554c | |
parent | edb72506d321e0f6c1ba29c617806ea0d4f9b8c6 (diff) | |
download | nss-hg-61c75a175ac1528ab3d0bf7bb11ce3732e10dc0a.tar.gz |
Windows (not console) style main program, needed to run on WinCE.
-rw-r--r-- | security/nss/cmd/rsaperf/CEonsole.cpp | 45 | ||||
-rw-r--r-- | security/nss/cmd/strsclnt/CEonsole.cpp | 54 |
2 files changed, 99 insertions, 0 deletions
diff --git a/security/nss/cmd/rsaperf/CEonsole.cpp b/security/nss/cmd/rsaperf/CEonsole.cpp new file mode 100644 index 000000000..efbd1208a --- /dev/null +++ b/security/nss/cmd/rsaperf/CEonsole.cpp @@ -0,0 +1,45 @@ +// CEonsole.cpp : Defines the entry point for the application. +// + +#include <windows.h> + +#include <stdio.h> +#include <stdlib.h> + +extern "C" int main(int inArgc, char**inArgv, char**inEnv); + +int WINAPI WinMain( HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + // + // Set your arguments to main here. + // + char* argv[] = { + "rsaperf.exe", // name of executable. + +// "--help", + "-d", "/Temp", + "-n", "none", + "-s", + "-i", "100", + + NULL // leave as last one. + }; + int argc = sizeof(argv) / sizeof(char*) - 1; + + // + // Rewrite stdin, stdout, stderr handles. + // + FILE* redir_stdin = _wfreopen(_T("\\Temp\\stdin.txt"), _T("r"), stdin); + FILE* redir_stdout = _wfreopen(_T("\\Temp\\stdout.txt"), _T("w"), stdout); + FILE* redir_stderr = _wfreopen(_T("\\Temp\\stderr.txt"), _T("w"), stderr); + + // + // Invoke main. + // + int mainRetval = main(argc, argv, NULL); + + return 0; +} diff --git a/security/nss/cmd/strsclnt/CEonsole.cpp b/security/nss/cmd/strsclnt/CEonsole.cpp new file mode 100644 index 000000000..a5f9e00a3 --- /dev/null +++ b/security/nss/cmd/strsclnt/CEonsole.cpp @@ -0,0 +1,54 @@ +// CEonsole.cpp : Defines the entry point for the application. +// + +#include <windows.h> + +#include <stdio.h> +#include <stdlib.h> + +extern "C" int main(int inArgc, char**inArgv, char**inEnv); + +int WINAPI WinMain( HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) +{ + // + // Set your arguments to main here. + // + char* argv[] = { + "strsclnt.exe", // name of executable. + "-C", "ABCDEFabcdefghijklmnopqrstuvwxy", +// "-C", "c", // only RSA_CR4_MD5 CipherSuite +// "-C", "d", // only RSA_3DES_SHA CipherSuite +// "-C", "v", // only RSA_AES_128_SHA CipherSuite +// "-C", "y", // only RSA_AES_256_SHA CipherSuite + "-c", "2", // 2 connections + "-d", "/Temp", // DB directory + "-n", "ExtendedSSLUser",// cert nickname + "-o", // override cert validity check +// "-p", "1234", // port + "-t", "1", // 1 thread + "-v", // verbose + "-w", "nss", // DB password +// "www.microsoft.com", // host + "windmere.mcom.com", // host + NULL // leave as last one. + }; + int argc = sizeof(argv) / sizeof(char*) - 1; + + // + // Rewrite stdin, stdout, stderr handles. + // + FILE* redir_stdin = _wfreopen(_T("\\Temp\\stdin.txt"), _T("r"), stdin); + FILE* redir_stdout = _wfreopen(_T("\\Temp\\stdout.txt"), _T("w"), stdout); + FILE* redir_stderr = _wfreopen(_T("\\Temp\\stderr.txt"), _T("w"), stderr); + + // + // Invoke main. + // + int mainRetVal = main(argc, argv, NULL); + fprintf(stderr, "main() returned %d\n", mainRetVal); + + return 0; +} |