24 lines
630 B
C
24 lines
630 B
C
#include <Windows.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
|
|
BOOL PathEqual(LPCSTR path1, LPCSTR path2) {
|
|
char buffer1[MAX_PATH];
|
|
char buffer2[MAX_PATH];
|
|
|
|
GetFullPathNameA(path1, _countof(buffer1), buffer1, NULL);
|
|
GetFullPathNameA(path2, _countof(buffer2), buffer2, NULL);
|
|
|
|
return strcmp(path1, path2) == 0;
|
|
}
|
|
BOOL PathPrefix(LPCSTR path, LPCSTR prefix) {
|
|
char buffer1[MAX_PATH];
|
|
char buffer2[MAX_PATH];
|
|
|
|
GetFullPathNameA(path, _countof(buffer1), buffer1, NULL);
|
|
GetFullPathNameA(prefix, _countof(buffer2), buffer2, NULL);
|
|
|
|
return strstr(buffer1, buffer2) == buffer1;
|
|
}
|