-
Notifications
You must be signed in to change notification settings - Fork 0
/
02-tick-count.c
42 lines (33 loc) · 963 Bytes
/
02-tick-count.c
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
37
38
39
40
41
42
// hello-native-app.c
// Copyright (C) 2019 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>.
// This file is public domain software.
#include "common.h"
INT
__cdecl
_main(
IN INT argc,
IN PCHAR argv[],
IN PCHAR envp[],
IN ULONG DebugFlag)
{
HANDLE hFile;
DbgPrint("This is a debug output.\n");
hFile = DoOpenFile(L"\\SystemRoot\\02-tick-count.txt", TRUE);
if (hFile == INVALID_HANDLE_VALUE)
{
DbgPrint("hFile == INVALID_HANDLE_VALUE\n");
return -1;
}
DoPutSz(hFile, "TEST\r\n");
DoPutSz(hFile, "NtGetTickCount: ");
DoPutDword(hFile, NtGetTickCount());
DoPutSz(hFile, "\r\n");
DoPutSz(hFile, "NtGetTickCount: ");
DoPutDword(hFile, NtGetTickCount());
DoPutSz(hFile, "\r\n");
DoPutSz(hFile, "NtGetTickCount: ");
DoPutDword(hFile, NtGetTickCount());
DoPutSz(hFile, "\r\n");
DoCloseFile(hFile);
return 0;
}