Skip to content

Commit

Permalink
Merge pull request #34 from isanae/deletion-mapping
Browse files Browse the repository at this point in the history
Don't map files that don't exist when deleting them
  • Loading branch information
isanae authored Aug 13, 2020
2 parents 4f617f9 + 6acd543 commit 7454a09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/usvfs_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define USVFS_VERSION_MAJOR 0
#define USVFS_VERSION_MINOR 4
#define USVFS_VERSION_BUILD 4
#define USVFS_VERSION_REVISION 7
#define USVFS_VERSION_REVISION 8

#define USVFS_BUILD_STRING ""
#define USVFS_BUILD_WSTRING L""
Expand Down
10 changes: 8 additions & 2 deletions src/usvfs_dll/hooks/kernel32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,10 @@ BOOL WINAPI usvfs::hook_DeleteFileW(LPCWSTR lpFileName)
}
POST_REALCALL

reroute.removeMapping(READ_CONTEXT());
if (res) {
reroute.removeMapping(READ_CONTEXT());
}

if (reroute.wasRerouted())
LOG_CALL().PARAMWRAP(lpFileName).PARAMWRAP(reroute.fileName()).PARAM(res).PARAM(callContext.lastError());

Expand Down Expand Up @@ -1137,7 +1140,10 @@ DLLEXPORT BOOL WINAPI usvfs::hook_RemoveDirectoryW(
}
POST_REALCALL

reroute.removeMapping(READ_CONTEXT(), true);
if (res) {
reroute.removeMapping(READ_CONTEXT(), true);
}

if (reroute.wasRerouted())
LOG_CALL().PARAMWRAP(lpPathName).PARAMWRAP(reroute.fileName()).PARAM(res).PARAM(callContext.lastError());

Expand Down

0 comments on commit 7454a09

Please sign in to comment.