You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2010/03/09 10:50:17 UTC
svn commit: r920759 - in /commons/sandbox/runtime/trunk/src/main/native:
Makefile.msc.in include/acr_exec.h os/win32/main.c os/win32/subproc.c
os/win32/subsys.c test/testsuite.c
Author: mturk
Date: Tue Mar 9 09:50:16 2010
New Revision: 920759
URL: http://svn.apache.org/viewvc?rev=920759&view=rev
Log:
Axe win32 subsys
Removed:
commons/sandbox/runtime/trunk/src/main/native/os/win32/subproc.c
Modified:
commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in
commons/sandbox/runtime/trunk/src/main/native/include/acr_exec.h
commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c
commons/sandbox/runtime/trunk/src/main/native/os/win32/subsys.c
commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c
Modified: commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in?rev=920759&r1=920758&r2=920759&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in (original)
+++ commons/sandbox/runtime/trunk/src/main/native/Makefile.msc.in Tue Mar 9 09:50:16 2010
@@ -150,7 +150,6 @@ WINDOWS_OBJS= \
$(SRCDIR)/os/win32/shm.$(OBJ) \
$(SRCDIR)/os/win32/signals.$(OBJ) \
$(SRCDIR)/os/win32/subsys.$(OBJ) \
- $(SRCDIR)/os/win32/subproc.$(OBJ) \
$(SRCDIR)/os/win32/syslog.$(OBJ) \
$(SRCDIR)/os/win32/group.$(OBJ) \
$(SRCDIR)/os/win32/gui.$(OBJ) \
Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_exec.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_exec.h?rev=920759&r1=920758&r2=920759&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr_exec.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr_exec.h Tue Mar 9 09:50:16 2010
@@ -144,22 +144,6 @@ ACR_DECLARE(int) ACR_ExecProgram(acr_exe
acr_pchar_t *const *envp);
/**
- * Execute program via stup
- * @param exe The executable object
- * @param stubexe Stub executable. Use NULL for platform default.
- * @param executable Program to execute
- * @param argv Parameters for the program.
- * @param envp Optional environment passed to the program. If null the current
- * environment of the calling process is used.
- * @return Exit reason.
- */
-ACR_DECLARE(int) ACR_ExecSubproc(acr_exec_t *ep,
- const acr_pchar_t *stubexe,
- const acr_pchar_t *executable,
- const acr_pchar_t *const *argv,
- acr_pchar_t *const *envp);
-
-/**
* Get executed program output stream.
* @param exe The executable object
* @param which Stream to get:
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c?rev=920759&r1=920758&r2=920759&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c Tue Mar 9 09:50:16 2010
@@ -32,12 +32,15 @@
static HINSTANCE dll_instance = NULL;
static WCHAR dll_file_name[ACR_HBUFF_SIZ];
+static WCHAR dll_file_path[ACR_HBUFF_SIZ];
static WCHAR mod_file_name[ACR_HBUFF_SIZ];
static WCHAR dos_file_name[ACR_SBUFF_SIZ];
+static WCHAR dos_file_path[ACR_SBUFF_SIZ];
static DWORD dll_tls_index = TLS_OUT_OF_INDEXES;
HANDLE dll_heap_handle = NULL;
HANDLE dll_user_token = NULL;
WCHAR *dll_dos_modname = NULL;
+WCHAR *dll_win_modpath = NULL;
static CRITICAL_SECTION dll_main_lock;
static SYSTEM_INFO osinf;
static OSVERSIONINFOEXA osver;
@@ -103,9 +106,10 @@ BOOL WINAPI DllMain(HINSTANCE instance,
if (!InitializeCriticalSectionAndSpinCount(&dll_main_lock, ACR_SPINCOUNT))
return FALSE;
GetModuleFileNameW(instance, mod_file_name, ACR_HBUFF_LEN);
- GetLongPathNameW(mod_file_name, dll_file_name, ACR_SBUFF_LEN);
+ GetLongPathNameW(mod_file_name, dll_file_name, ACR_HBUFF_LEN);
GetShortPathNameW(dll_file_name, dos_file_name, ACR_SBUFF_LEN);
dll_dos_modname = dos_file_name;
+ dll_win_modpath = basename_w(dll_file_name, dll_file_path, ACR_HBUFF_LEN);
dll_heap_handle = HeapCreate(0, 0, 0);
if (!dll_heap_handle) {
/* No point to continue if we are missing the process heap */
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/subsys.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/subsys.c?rev=920759&r1=920758&r2=920759&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/subsys.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/subsys.c Tue Mar 9 09:50:16 2010
@@ -35,73 +35,3 @@
* Session zero.
*/
-
-#ifdef ACR_ENABLE_TEST
-
-/* Rundll32 Test exports.
- * Wide char version doesn't fill the CmdLine correctly
- * (testes both with cmd and cmd /U, however I don't have Unicode system,
- * so cannot tell for sure. However GetCommandLineW works as expected, with
- * the exception that it returns full command line since we are now inside
- * rundll32 process.
- * Use _TestRun@16 for entry point.
- * We could use the .def file or /EXPORT:FunctionName and have decorated names.
- * Note:
- * Rundll32 is missing console, so redirection must be performed, and it requires
- * the short names for locating the .dll.
- */
-ACR_DECLARE(int) TestRunW(HINSTANCE hInstance, HINSTANCE hPrevInstance,
- LPWSTR lpszCmdLine, int nCmdShow)
-{
- int rc = 0;
- OutputDebugStringA("Running TestRunW");
- if ((rc = ACR_Initialize(NULL))) {
- fprintf(stderr, "Failed to initialize the ACR error=%d\n", rc);
- fflush(stderr);
- goto cleanup;
- }
- if ((rc = ACR_PlatformInitialize(INVALID_JNIENV, 0))) {
- fprintf(stderr, "Failed to initialize the ACR platform error=%d\n", rc);
- fflush(stderr);
- goto cleanup;
- }
- fprintf(stdout, "Running TestRunW ...\n");
- fprintf(stdout, " HINST : %p\n", hInstance);
- fprintf(stdout, " show : %08x\n", nCmdShow);
- fprintf(stdout, " cmdline: %S\n", lpszCmdLine);
- fflush(stdout);
-
-cleanup:
-
- return rc;
-}
-
-
-ACR_DECLARE(int) TestRunA(HWND hwnd, HINSTANCE hinst,
- LPSTR lpszCmdLine, int nCmdShow)
-{
- int rc = 0;
-
- if ((rc = ACR_Initialize(NULL))) {
- fprintf(stderr, "Failed to initialize the ACR error=%d\n", rc);
- fflush(stderr);
- goto cleanup;
- }
- if ((rc = ACR_PlatformInitialize(INVALID_JNIENV, 0))) {
- fprintf(stderr, "Failed to initialize the ACR platform error=%d\n", rc);
- fflush(stderr);
- goto cleanup;
- }
-
- fprintf(stdout, "Running TestRunW ...\n");
- fprintf(stdout, " HWND : %p\n", hwnd);
- fprintf(stdout, " show : %08x\n", nCmdShow);
- fprintf(stdout, " cmdline: %s\n", lpszCmdLine);
- fflush(stdout);
-
-cleanup:
-
- ExitProcess(rc);
-}
-
-#endif
Modified: commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c?rev=920759&r1=920758&r2=920759&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c Tue Mar 9 09:50:16 2010
@@ -665,31 +665,6 @@ static int test_exec4(int argc, const ch
return 0;
}
-static int test_exec5(int argc, const char *const argv[])
-{
- int rc;
- static const char *hello = "Hello world\n";
- acr_exec_t *exe;
-
- if (argc < 1) {
- return ACR_EINVAL;
- }
-
- exe = ACR_ExecNew(ACR_PROC_HAS_STDOUT | ACR_PROC_HAS_STDERR | ACR_PROC_HAS_STDIN);
- ACR_ExecStdinSet(exe, hello, strlen(hello));
-#if defined(WIN32)
- rc = ACR_ExecSubproc(exe, NULL, wargv[0], &wargv[1], NULL);
-#else
- rc = ACR_ExecProgram(exe, argv[0], &argv[1], NULL);
-#endif
- fprintf(stdout, "[STDOUT]:\n%s", ACR_ExecStream(exe, 1));
- fprintf(stdout, "[STDERR]:\n%s", ACR_ExecStream(exe, 2));
- fprintf(stdout, "\n[EXITWHY]: %d\n[EXITVAL]: %d\n[EXITPID]: %d\n",
- exe->exitwhy, exe->exitval, exe->pid);
- ACR_ExecFree(exe);
- return 0;
-}
-
#if defined(WIN32)
static int test_registry(int argc, const char *const argv[])
{
@@ -830,9 +805,6 @@ int main(int argc, const char *const arg
else if (!strcasecmp(run_test, "daemon")) {
rv = test_exec4(argc, argv);
}
- else if (!strcasecmp(run_test, "subproc")) {
- rv = test_exec5(argc, argv);
- }
#if defined(WIN32)
else if (!strcasecmp(run_test, "registry")) {
rv = test_registry(argc, argv);