acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
_windows_common.h
1// get_mem_info2 from debug.h by camilo on 2022-11-07 01:53 <3ThomasBorregaardSorensen!!
2#pragma once
3
4
5#include "_c.h"
6
7
8#include "acme/operating_system/windows_common/_.h"
9
10
11// #include "acme/operating_system/error_code.h"
12//
13//
14// #include "acme/prototype/comparison/compare.h"
15//
16//
17// #include "acme/prototype/time/_time.h"
18//
19//
20// #include "acme/operating_system/time.h"
21//
22//
23// #include "acme/operating_system/windows_common/last_error.h"
24//
25//
26// #include "_string.h"
27
28
29using dword_array_base = ::numeric_array_base < DWORD >;
30
31using dword_array = ::array_particle < ::dword_array_base >;
32
33
34
35#ifdef MEMDLEAK
36
37
38//CLASS_DECL_ACME string get_mem_info_report1();
39//CLASS_DECL_ACME::collection::count get_mem_info(::i32 ** ppiUse, const_char_pointer ** ppszFile, const_char_pointer ** pszCallStack, ::u32 ** ppuiLine, size_t ** ppsize);
40#ifdef WINDOWS
41CLASS_DECL_ACME::collection::count get_mem_info2(::i32 ** ppiUse, const_char_pointer ** ppszFile, DWORD64 ** ppuiStack[64], ::i64 ** ppiStack, ::i32 ** ppiLine, ::i64 ** ppiSize);
42#endif
43
44
45#endif
46
47//
48// namespace windows
49// {
50//
51// constexpr DWORD wait(const class time& time)
52// {
53//
54// auto i = time.integral_millisecond();
55//
56// return i > ((decltype(i))INFINITE) ? INFINITE : (DWORD) i;
57//
58// }
59//
60//
61//
62// }
63
64//template < >
65//inline bool gt(DWORD dw, ::i32 i)
66//{
67// return i < 0 ? true : dw >((DWORD)i);
68//}
69
70//template < >
71//inline bool gt(count i,::u64 u)
72//{
73
74// return i < 0 ? false : ((::u64)i) > u;
75
76//}
77
78//#endif
79
80CLASS_DECL_ACME void TRACELASTERROR();
81
82
83namespace windows
84{
85
86
87 // CLASS_DECL_ACME::enum_status _last_error_status(::u32 uLastError);
88 // inline ::e_status last_error_status(const last_error & lasterror) { return _last_error_status(lasterror.m_uLastError); }
89 //
90 //
91 // CLASS_DECL_ACME::enum_status _failed_last_error_status(::u32 uLastError);
92 // inline ::e_status failed_last_error_status(const last_error & lasterror) { return _failed_last_error_status(lasterror.m_uLastError); }
93
94
95 CLASS_DECL_ACME::enum_status _hresult_status(HRESULT hresult);
96 inline ::e_status hresult_status(HRESULT hresult) { return _hresult_status(hresult); }
97
98
99 // CLASS_DECL_ACME void * get_library_symbol_address(const ::file::path & pathLibrary, const ::scoped_string & scopedstrSymbolName);
100 //
101 //
102 // template < typename PFN >
103 // class function
104 // {
105 // public:
106 //
107 //
108 // inline static PFN get_address(const ::scoped_string & scopedstrModule, const_char_pointer pszName)
109 // {
110 //
111 // return (PFN) get_library_symbol_address(scopedstrModule, pszName);
112 //
113 // }
114 //
115 //
116 // };
117
118
119 // CLASS_DECL_ACME ::e_status wait_result_status(::i32 iResult, ::i32 nCount);
120 //
121 // CLASS_DECL_ACME ::u32 _get_file_attributes(const ::file::path & path);
122 //
123 // CLASS_DECL_ACME ::u32 get_file_attributes(const ::file::path & path);
124 //
125 // CLASS_DECL_ACME ::i32_bool is_win32_accessible(::u32 uFileAttributes, const last_error & lasterror);
126 //
127 // CLASS_DECL_ACME ::i32_bool is_win32_accessible(const ::file::path & path);
128 //
129 // CLASS_DECL_ACME void set_file_attributes(const ::file::path & path, ::u32 uFileAttributes);
130 //
131 //
132 // CLASS_DECL_ACME error_code last_error_error_code(const last_error & lasterror);
133 //
134 //
135 // CLASS_DECL_ACME error_code last_error_error_code();
136 //
137 //
138 // //CLASS_DECL_ACME void throw_last_error_exception(const ::last_error & lasterror);
139 //
140 //
141 // //CLASS_DECL_ACME void throw_last_error_exception();
142
143
144} // namespace windows
145
146
147//
148//
149//
150//#ifdef WINDOWS
151//#define ARG_SEC_ATTRS_DEF , void * psaAttributes = nullptr
152//#define ARG_SEC_ATTRS , void * psaAttributes
153//#define PARAM_SEC_ATTRS (void *) psaAttributes
154//#define PASS_SEC_ATTRS psaAttributes
155//#define INSERT_PARAM_SEC_ATTRS(ATTRS) , ATTRS
156//#define ADD_PARAM_SEC_ATTRS , PARAM_SEC_ATTRS
157//#define ADD_PASS_SEC_ATTRS , PASS_SEC_ATTRS
158//#else
159//#define ARG_SEC_ATTRS_DEF
160//#define ARG_SEC_ATTRS
161//#define PARAM_SEC_ATTRS
162//#define INSERT_PARAM_SEC_ATTRS(ATTRS)
163//#define ADD_PARAM_SEC_ATTRS
164//#define ADD_PASS_SEC_ATTRS
165//#endif
166//
167//
168//
169
170
171
172#include "acme/operating_system/windows_common/handle.h"
173#include "acme/operating_system/windows_common/file.h"
174
175
176namespace windows
177{
178
179
180 CLASS_DECL_ACME void enum_processes(dword_array_base & dwaProcesses);
181 CLASS_DECL_ACME dword_array_base enum_processes();
182
183
184} // namespace windows
185
186
187
188