-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.h
More file actions
36 lines (29 loc) · 855 Bytes
/
common.h
File metadata and controls
36 lines (29 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// Created by Thomas Lienbacher on 17.03.2019.
//
#ifndef WINAPI_ENCRYPTION_COMMON_H
#define WINAPI_ENCRYPTION_COMMON_H
#define UNICODE
#define _UNICODE
#include <tchar.h>
#include <stdio.h>
#include <windows.h>
#include <bcrypt.h>
#include <conio.h>
#include <stdbool.h>
static void PrintError(LPTSTR errDesc) {
fflush(stdout);
LPVOID errMsg;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT),
(LPTSTR) &errMsg,
0,
NULL);
_ftprintf(stderr, TEXT("\nERROR %s: %s\n"), errDesc, (LPTSTR) errMsg);
LocalFree((LPVOID) errMsg);
}
#endif //WINAPI_ENCRYPTION_COMMON_H