New messagebox system
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
#include <windows.h>
|
||||
|
||||
#include <crc32.h>
|
||||
#include <err.h>
|
||||
#include <msg.h>
|
||||
|
||||
#include <utils.h>
|
||||
|
||||
uint32_t utils_file_crc32c(const char *filePath) {
|
||||
HANDLE file = CreateFileA(filePath, FILE_READ_ACCESS, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (!file) {
|
||||
err_mb_a("Could not open file: %s", filePath);
|
||||
msg_err_a("Could not open file: %s", filePath);
|
||||
}
|
||||
|
||||
LARGE_INTEGER fileSize;
|
||||
@ -17,7 +17,7 @@ uint32_t utils_file_crc32c(const char *filePath) {
|
||||
HANDLE hMap = CreateFileMappingA(file, NULL, PAGE_READONLY, 0, 0, NULL);
|
||||
char *map = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0);
|
||||
if (!map) {
|
||||
err_mb_a("Could not create file mapping for %s", filePath);
|
||||
msg_err_a("Could not create file mapping for %s", filePath);
|
||||
}
|
||||
|
||||
uint32_t crc = crc32c(0, (unsigned char*)map, fileSize.QuadPart);
|
||||
|
||||
Reference in New Issue
Block a user