I've been working on an app that gathers log files off of several remote machines.
In most cases using CopyFile() has returned the file or a usable Error code. However on occasion ERROR_FILE_NOT_FOUND is returned. In some instances this is correct, in others the error is not that the file wasn't found but that the network resource was not found. By mapping the drive manually the application is then able to gather the required logs.
The application does handle Error_Access_Denied, Error_logon_failure, Error_path_not_found, and Error_bad_netpath.
is there another method that would more accurately return error codes? Or a plausible explanation for why the wrong error code would be sent?
In most cases using CopyFile() has returned the file or a usable Error code. However on occasion ERROR_FILE_NOT_FOUND is returned. In some instances this is correct, in others the error is not that the file wasn't found but that the network resource was not found. By mapping the drive manually the application is then able to gather the required logs.
The application does handle Error_Access_Denied, Error_logon_failure, Error_path_not_found, and Error_bad_netpath.
is there another method that would more accurately return error codes? Or a plausible explanation for why the wrong error code would be sent?