-
Notifications
You must be signed in to change notification settings - Fork 29
/
prog.h
102 lines (71 loc) · 2.22 KB
/
prog.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
Copyright (C) 2011 Jay Satiro <[email protected]>
All rights reserved.
This file is part of GetHooks.
GetHooks is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
GetHooks is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GetHooks. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef _PROG_H
#define _PROG_H
#include <windows.h>
/* ReactOS structures and supporting functions */
#include "reactos.h"
#ifdef __cplusplus
extern "C" {
#endif
/** The program store.
The program store holds basic program and system info.
*/
struct prog
{
/* argc from main() */
int argc;
/* argv from main() */
const char *const *argv;
/* program basename (from argv[0] with folder path removed) */
const char *pszBasename;
/* the main thread's id */
DWORD dwMainThreadId;
/* the operating system version info */
DWORD dwOSVersion, dwOSMajorVersion, dwOSMinorVersion, dwOSBuild;
/* the name of the window station */
WCHAR *pwszWinstaName; // calloc(), free()
/* A pointer to Microsoft's SHAREDINFO struct gSharedInfo */
const SHAREDINFO *pSharedInfo;
/* gSharedInfo.aheList[] count */
const volatile ULONG *pcHandleEntries;
/* the system utc time in FILETIME format immediately after this store has been initialized.
this is nonzero when this store has been initialized.
*/
__int64 init_time;
};
/**
these functions are documented in the comment block above their definitions in prog.c
*/
void create_prog_store(
struct prog **const out // out deref
);
SHAREDINFO *get_SharedInfo( void );
void init_global_prog_store(
int argc, // in
char **argv // in deref
);
void print_SharedInfo(
const SHAREDINFO *const pSharedInfo // in
);
void print_global_prog_store( void );
void free_prog_store(
struct prog **const in // in deref
);
#ifdef __cplusplus
}
#endif
#endif // _PROG_H