From 047203a7457a4a712a009c279c502b739d12c73c Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 17 Nov 2025 21:30:24 +0000 Subject: [PATCH] Add MoveFileExW mock to system.h/.c Add mock implementation for MoveFileExW Windows API function following the existing pattern in the codebase. The mock forwards calls to the real Windows API, allowing for future interception in the simulation framework if needed. --- src/system.c | 6 ++++++ src/system.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/system.c b/src/system.c index 9ae26c2..7dc1e96 100644 --- a/src/system.c +++ b/src/system.c @@ -1648,6 +1648,12 @@ BOOL mock_FindClose(HANDLE hFindFile) return TRUE; } +BOOL mock_MoveFileExW(WCHAR *lpExistingFileName, WCHAR *lpNewFileName, DWORD dwFlags) +{ + // Forward to real MoveFileExW, last error is set by the real call + return MoveFileExW(lpExistingFileName, lpNewFileName, dwFlags); +} + #else int mock_clock_gettime(clockid_t clockid, struct timespec *tp) diff --git a/src/system.h b/src/system.h index 31ba995..47488f1 100644 --- a/src/system.h +++ b/src/system.h @@ -73,6 +73,7 @@ int mock__mkdir(char *path); HANDLE mock_FindFirstFileA(char *lpFileName, WIN32_FIND_DATAA *lpFindFileData); BOOL mock_FindNextFileA(HANDLE hFindFile, WIN32_FIND_DATAA *lpFindFileData); BOOL mock_FindClose(HANDLE hFindFile); +BOOL mock_MoveFileExW(WCHAR *lpExistingFileName, WCHAR *lpNewFileName, DWORD dwFlags); #else int mock_clock_gettime(clockid_t clockid, struct timespec *tp); int mock_open(char *path, int flags, int mode); @@ -124,6 +125,7 @@ int mock_closedir(DIR *dirp); #define sys_FindFirstFileA mock_FindFirstFileA #define sys_FindNextFileA mock_FindNextFileA #define sys_FindClose mock_FindClose +#define sys_MoveFileExW mock_MoveFileExW // Linux #define sys_mkdir mock_mkdir @@ -178,6 +180,7 @@ int mock_closedir(DIR *dirp); #define sys_FindFirstFileA FindFirstFileA #define sys_FindNextFileA FindNextFileA #define sys_FindClose FindClose +#define sys_MoveFileExW MoveFileExW // Linux #define sys_mkdir mkdir