The last parameter of CreateFile is a HANDLE and should thus be NULL.
This commit is contained in:
parent
23e271488c
commit
12b352694b
|
@ -41,7 +41,7 @@ BATCH_CONTEXT *prev_context;
|
||||||
strcpy (string, file);
|
strcpy (string, file);
|
||||||
CharLower (string);
|
CharLower (string);
|
||||||
if (strstr (string, ".bat") == NULL) strcat (string, ".bat");
|
if (strstr (string, ".bat") == NULL) strcat (string, ".bat");
|
||||||
h = CreateFile (string, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
h = CreateFile (string, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (h == INVALID_HANDLE_VALUE) {
|
if (h == INVALID_HANDLE_VALUE) {
|
||||||
SetLastError (ERROR_FILE_NOT_FOUND);
|
SetLastError (ERROR_FILE_NOT_FOUND);
|
||||||
WCMD_print_error ();
|
WCMD_print_error ();
|
||||||
|
|
|
@ -355,7 +355,7 @@ char condition[MAX_PATH], *command, *s;
|
||||||
}
|
}
|
||||||
else if (!lstrcmpi (condition, "exist")) {
|
else if (!lstrcmpi (condition, "exist")) {
|
||||||
if ((h = CreateFile (WCMD_parameter (p, 1+negate, NULL), GENERIC_READ, 0, NULL,
|
if ((h = CreateFile (WCMD_parameter (p, 1+negate, NULL), GENERIC_READ, 0, NULL,
|
||||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)) != INVALID_HANDLE_VALUE) {
|
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE) {
|
||||||
CloseHandle (h);
|
CloseHandle (h);
|
||||||
test = 1;
|
test = 1;
|
||||||
}
|
}
|
||||||
|
@ -709,7 +709,7 @@ char buffer[512];
|
||||||
DWORD count;
|
DWORD count;
|
||||||
|
|
||||||
h = CreateFile (param1, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
|
h = CreateFile (param1, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
|
||||||
FILE_ATTRIBUTE_NORMAL, 0);
|
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (h == INVALID_HANDLE_VALUE) {
|
if (h == INVALID_HANDLE_VALUE) {
|
||||||
WCMD_print_error ();
|
WCMD_print_error ();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -89,7 +89,7 @@ HANDLE h;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
GetFullPathName ("\\autoexec.bat", sizeof(string), string, NULL);
|
GetFullPathName ("\\autoexec.bat", sizeof(string), string, NULL);
|
||||||
h = CreateFile (string, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
h = CreateFile (string, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (h != INVALID_HANDLE_VALUE) {
|
if (h != INVALID_HANDLE_VALUE) {
|
||||||
CloseHandle (h);
|
CloseHandle (h);
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -168,7 +168,7 @@ char *whichcmd;
|
||||||
|
|
||||||
if ((p = strchr(cmd,'<')) != NULL) {
|
if ((p = strchr(cmd,'<')) != NULL) {
|
||||||
h = CreateFile (WCMD_parameter (++p, 0, NULL), GENERIC_READ, 0, NULL, OPEN_EXISTING,
|
h = CreateFile (WCMD_parameter (++p, 0, NULL), GENERIC_READ, 0, NULL, OPEN_EXISTING,
|
||||||
FILE_ATTRIBUTE_NORMAL, 0);
|
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (h == INVALID_HANDLE_VALUE) {
|
if (h == INVALID_HANDLE_VALUE) {
|
||||||
WCMD_print_error ();
|
WCMD_print_error ();
|
||||||
return;
|
return;
|
||||||
|
@ -178,7 +178,7 @@ char *whichcmd;
|
||||||
}
|
}
|
||||||
if ((p = strchr(cmd,'>')) != NULL) {
|
if ((p = strchr(cmd,'>')) != NULL) {
|
||||||
h = CreateFile (WCMD_parameter (++p, 0, NULL), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
|
h = CreateFile (WCMD_parameter (++p, 0, NULL), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS,
|
||||||
FILE_ATTRIBUTE_NORMAL, 0);
|
FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (h == INVALID_HANDLE_VALUE) {
|
if (h == INVALID_HANDLE_VALUE) {
|
||||||
WCMD_print_error ();
|
WCMD_print_error ();
|
||||||
return;
|
return;
|
||||||
|
@ -363,7 +363,7 @@ char filetorun[MAX_PATH];
|
||||||
if (strchr (param1, '.') == NULL) {
|
if (strchr (param1, '.') == NULL) {
|
||||||
strcpy (filetorun, param1);
|
strcpy (filetorun, param1);
|
||||||
strcat (filetorun, ".bat");
|
strcat (filetorun, ".bat");
|
||||||
h = CreateFile (filetorun, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
|
h = CreateFile (filetorun, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
if (h != INVALID_HANDLE_VALUE) {
|
if (h != INVALID_HANDLE_VALUE) {
|
||||||
CloseHandle (h);
|
CloseHandle (h);
|
||||||
WCMD_batch (param1, command, 0);
|
WCMD_batch (param1, command, 0);
|
||||||
|
|
Loading…
Reference in New Issue