/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
+#include <afs/stds.h>
-RCSID
- ("$Header$");
+#include "procmgmt.h" /* Must be before roken */
-#include <afs/stds.h>
+#include <roken.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
#include <windows.h>
#include <pthread.h>
#include <afs/errmap_nt.h>
#include <afs/secutil_nt.h>
-#include "procmgmt.h"
#include "pmgtprivate.h"
-
-
/* Signal disposition table and associated definitions and locks */
typedef struct {
RemoteSignalListenerThread(LPVOID param)
{
HANDLE sigPipeHandle = (HANDLE) param;
+ HMODULE hLib = LoadLibrary("AFSPROCMGMT.DLL");
while (1) {
/* wait for pipe client to connect */
}
/* never reached */
+ FreeLibrary(hLib);
return (0);
}
}
/* put all strings into buffer; guarantee buffer is at least one char */
- buffer = (char *)malloc(byteCount + (strCount * 3) /* quotes+space */ +1);
+ buffer = malloc(byteCount + (strCount * 3) /* quotes+space */ +1);
if (buffer != NULL) {
int i;
}
/* put all strings into buffer; guarantee buffer is at least two chars */
- buffer = (char *)malloc(byteCount + strCount + 2);
+ buffer = malloc(byteCount + strCount + 2);
if (buffer != NULL) {
if (byteCount == 0) {
buffer[0] = '\0';
bufp += strLen + 1;
}
}
- bufp = '\0'; /* terminate multistring */
+ *bufp = '\0'; /* terminate multistring */
}
}
size_t *memp = (size_t *) bufMemp;
*dataLen = *memp++;
- *datap = (void *)malloc(*dataLen);
+ *datap = malloc(*dataLen);
if (*datap != NULL) {
memcpy(*datap, (void *)memp, *dataLen);
DWORD monitorId, createFlags;
BOOL passingBuffer = (sdatap != NULL && sdatalen > 0);
BOOL fsuccess;
+ int lasterror;
/* verify arguments */
if (!spath || !sargv) {
}
/* create path with .exe extension if no filename extension supplied */
- if (!(pathbuf = (char *)malloc(strlen(spath) + 5 /* .exe */ ))) {
+ if (!(pathbuf = malloc(strlen(spath) + 5 /* .exe */ ))) {
errno = ENOMEM;
return ((pid_t) - 1);
}
&startInfo, /* startup info block */
&procInfo);
+ lasterror = GetLastError();
free(pathbuf);
free(argbuf);
free(envbuf);
if (!fsuccess) {
/* failed to spawn process */
- errno = nterr_nt2unix(GetLastError(), ENOENT);
+ errno = nterr_nt2unix(lasterror, ENOENT);
(void)pthread_mutex_lock(&procTableLock);
procTable[tidx].p_reserved = FALSE; /* mark entry as not reserved */