aboutsummaryrefslogtreecommitdiff
path: root/src/main/extractor_ipc_w32.c
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2012-08-02 16:58:22 +0000
committerLRN <lrn1986@gmail.com>2012-08-02 16:58:22 +0000
commit7a3b043383533db5515daf21a9eae2ee24613030 (patch)
tree79e1d4d7e02c5be68646d77d4a2b61eeea12ed4a /src/main/extractor_ipc_w32.c
parent1687a6aff0c356fb2638f293236097c170bde7e7 (diff)
downloadlibextractor-7a3b043383533db5515daf21a9eae2ee24613030.tar.gz
libextractor-7a3b043383533db5515daf21a9eae2ee24613030.zip
Now test_ipc should work (kind of)
Diffstat (limited to 'src/main/extractor_ipc_w32.c')
-rw-r--r--src/main/extractor_ipc_w32.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/extractor_ipc_w32.c b/src/main/extractor_ipc_w32.c
index 6a7a2cd..e8ed37d 100644
--- a/src/main/extractor_ipc_w32.c
+++ b/src/main/extractor_ipc_w32.c
@@ -435,7 +435,7 @@ EXTRACTOR_IPC_channel_create_ (struct EXTRACTOR_PluginList *plugin,
435 struct InitMessage *init; 435 struct InitMessage *init;
436 size_t slen; 436 size_t slen;
437 437
438 STARTUPINFO startup; 438 STARTUPINFOA startup;
439 PROCESS_INFORMATION proc; 439 PROCESS_INFORMATION proc;
440 char cmd[MAX_PATH + 1]; 440 char cmd[MAX_PATH + 1];
441 char arg1[10], arg2[10]; 441 char arg1[10], arg2[10];
@@ -491,16 +491,18 @@ EXTRACTOR_IPC_channel_create_ (struct EXTRACTOR_PluginList *plugin,
491 return NULL; 491 return NULL;
492 } 492 }
493 493
494 memset (&startup, 0, sizeof (STARTUPINFO)); 494 memset (&proc, 0, sizeof (PROCESS_INFORMATION));
495 memset (&startup, 0, sizeof (STARTUPINFOA));
495 496
496 /* TODO: write our own plugin-hosting executable? rundll32, for once, has smaller than usual stack size. 497 /* TODO: write our own plugin-hosting executable? rundll32, for once, has smaller than usual stack size.
497 * Also, users might freak out seeing over 9000 rundll32 processes (seeing over 9000 processes named 498 * Also, users might freak out seeing over 9000 rundll32 processes (seeing over 9000 processes named
498 * "libextractor_plugin_helper" is probably less confusing). 499 * "libextractor_plugin_helper" is probably less confusing).
499 */ 500 */
500 snprintf(cmd, MAX_PATH + 1, 501 snprintf(cmd, MAX_PATH,
501 "rundll32.exe libextractor-3.dll,RundllEntryPoint@16 %lu %lu", 502 "rundll32.exe libextractor-3.dll,RundllEntryPoint@16 %lu %lu",
502 p10_os_inh, p21_os_inh); 503 p10_os_inh, p21_os_inh);
503 cmd[MAX_PATH] = '\0'; 504 cmd[MAX_PATH] = '\0';
505 startup.cb = sizeof (STARTUPINFOA);
504 if (CreateProcessA (NULL, cmd, NULL, NULL, TRUE, CREATE_SUSPENDED, NULL, NULL, 506 if (CreateProcessA (NULL, cmd, NULL, NULL, TRUE, CREATE_SUSPENDED, NULL, NULL,
505 &startup, &proc)) 507 &startup, &proc))
506 { 508 {