Skip to content

Commit

Permalink
samples: Change "reason" to "error code" in winapi samples
Browse files Browse the repository at this point in the history
  • Loading branch information
kosmas12 committed Jun 28, 2021
1 parent 39c32b1 commit 6296f79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions samples/winapi_drivelist/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,6 @@ int main(void)
while (1) {
Sleep(2000);
}

return 0;
}
8 changes: 5 additions & 3 deletions samples/winapi_filefind/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ int main(void)
if (!ret) {
// There was an error. We can get more information about an error from WinAPI code using GetLastError()
DWORD mountError = GetLastError();
debugPrint("Failed to mount C: drive! Reason: %x\n", mountError);
debugPrint("Failed to mount C: drive! Error code: %x\n", mountError);
goto sleepForever;
}

Expand All @@ -30,7 +30,7 @@ int main(void)
DWORD findFileError;
if (hFind == INVALID_HANDLE_VALUE) {
findFileError = GetLastError();
debugPrint("FindFirstHandle() failed! Reason: %x\n", findFileError);
debugPrint("FindFirstHandle() failed! Error code: %x\n", findFileError);
goto cleanup;
}

Expand Down Expand Up @@ -59,10 +59,12 @@ int main(void)
// If there was an error while unmounting
if (!ret) {
DWORD unmountError = GetLastError();
debugPrint("Couldn't unmount C: drive! Reason: %x", unmountError);
debugPrint("Couldn't unmount C: drive! Error code: %x", unmountError);
}
sleepForever:
while (1) {
Sleep(2000);
}

return 0;
}

0 comments on commit 6296f79

Please sign in to comment.