temp file in memory, remove tabs

This commit is contained in:
ruti 2024-03-18 04:42:40 +03:00
parent 3da60eb357
commit 542a04bffb

View File

@ -146,7 +146,7 @@ int send_fake(int sfd, char *buffer,
HANDLE hfile = CreateFileA(path, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, NULL);
if (hfile == INVALID_HANDLE_VALUE) {
uniperror("CreateFileA");
return -1;
@ -209,12 +209,9 @@ int send_fake(int sfd, char *buffer,
if (!CloseHandle(hfile)) {
uniperror("CloseHandle hfile");
}
if (!CloseHandle(ov.hEvent)) {
if (ov.hEvent && !CloseHandle(ov.hEvent)) {
uniperror("CloseHandle hEvent");
}
if (!DeleteFile(path)) {
uniperror("DeleteFile");
}
return status;
}
#endif