scsl/WinHelpers.h

40 lines
751 B
C
Raw Normal View History

2023-10-10 23:44:29 +00:00
//
// Created by kyle on 2023-10-10.
//
2023-10-15 01:38:01 +00:00
#ifndef SCSL_WINHELPERS_H
#define SCSL_WINHELPERS_H
2023-10-10 23:44:29 +00:00
#if defined(__WIN64__) || defined(__WIN32__) || defined(WIN32)
#include <Windows.h>
#include <winbase.h>
#include <fileapi.h>
#include <strsafe.h>
2023-10-15 01:38:01 +00:00
namespace scsl {
2023-10-10 23:44:29 +00:00
namespace Windows {
int DisplayWinError(LPTSTR lpszFunction, HANDLE handle);
BOOL SetPrivilege(
HANDLE hToken, // access token handle
LPCTSTR lpszPrivilege, // name of privilege to enable/disable
BOOL bEnablePrivilege // to enable or disable privilege
);
HANDLE CreateFileWindows(const char *path);
int CreateFixedSizeFile(const char *path, size_t size);
} // namespace Windows
2023-10-15 01:38:01 +00:00
} // namespace scsl
2023-10-10 23:44:29 +00:00
#endif // Windows-only guards.
2023-10-15 01:38:01 +00:00
#endif //SCSL_WINHELPERS_H