diff options
Diffstat (limited to 'src/util/winproc.c')
-rw-r--r-- | src/util/winproc.c | 369 |
1 files changed, 185 insertions, 184 deletions
diff --git a/src/util/winproc.c b/src/util/winproc.c index 2781b901f..f2e4de4df 100644 --- a/src/util/winproc.c +++ b/src/util/winproc.c | |||
@@ -11,12 +11,12 @@ | |||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Affero General Public License for more details. | 13 | Affero General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file util/winproc.c | 22 | * @file util/winproc.c |
@@ -69,15 +69,15 @@ TAddAce GNAddAce; | |||
69 | TAddAccessAllowedAce GNAddAccessAllowedAce; | 69 | TAddAccessAllowedAce GNAddAccessAllowedAce; |
70 | TSetNamedSecurityInfo GNSetNamedSecurityInfo; | 70 | TSetNamedSecurityInfo GNSetNamedSecurityInfo; |
71 | 71 | ||
72 | #define LOG(kind,...) GNUNET_log_from (kind, "util-winproc", __VA_ARGS__) | 72 | #define LOG(kind, ...) GNUNET_log_from(kind, "util-winproc", __VA_ARGS__) |
73 | /** | 73 | /** |
74 | * Log (panic) messages from PlibC | 74 | * Log (panic) messages from PlibC |
75 | */ | 75 | */ |
76 | void | 76 | void |
77 | plibc_panic (int err, char *msg) | 77 | plibc_panic(int err, char *msg) |
78 | { | 78 | { |
79 | LOG (((err == INT_MAX) ? GNUNET_ERROR_TYPE_DEBUG : GNUNET_ERROR_TYPE_ERROR), | 79 | LOG(((err == INT_MAX) ? GNUNET_ERROR_TYPE_DEBUG : GNUNET_ERROR_TYPE_ERROR), |
80 | "%s", msg); | 80 | "%s", msg); |
81 | } | 81 | } |
82 | 82 | ||
83 | #ifdef W32_VEH | 83 | #ifdef W32_VEH |
@@ -91,45 +91,46 @@ plibc_panic (int err, char *msg) | |||
91 | * only way out of WaitForSingleObject() is to time out after 1 minute). | 91 | * only way out of WaitForSingleObject() is to time out after 1 minute). |
92 | */ | 92 | */ |
93 | LONG __stdcall | 93 | LONG __stdcall |
94 | GNWinVEH (PEXCEPTION_POINTERS ExceptionInfo) | 94 | GNWinVEH(PEXCEPTION_POINTERS ExceptionInfo) |
95 | { | 95 | { |
96 | char debugger[MAX_PATH + 1]; | 96 | char debugger[MAX_PATH + 1]; |
97 | char *debugger_env = NULL; | 97 | char *debugger_env = NULL; |
98 | if (IsDebuggerPresent ()) | 98 | |
99 | { | 99 | if (IsDebuggerPresent()) |
100 | DebugBreak (); | 100 | { |
101 | return EXCEPTION_CONTINUE_EXECUTION; | 101 | DebugBreak(); |
102 | } | 102 | return EXCEPTION_CONTINUE_EXECUTION; |
103 | debugger_env = getenv ("GNUNET_DEBUGGER"); | 103 | } |
104 | debugger_env = getenv("GNUNET_DEBUGGER"); | ||
104 | if (debugger_env != NULL) | 105 | if (debugger_env != NULL) |
105 | { | ||
106 | STARTUPINFO si; | ||
107 | PROCESS_INFORMATION pi; | ||
108 | HANDLE event; | ||
109 | SECURITY_ATTRIBUTES sa; | ||
110 | memset (&si, 0, sizeof (si)); | ||
111 | si.cb = sizeof (si); | ||
112 | memset (&pi, 0, sizeof (pi)); | ||
113 | memset (&sa, 0, sizeof (sa)); | ||
114 | sa.nLength = sizeof (sa); | ||
115 | sa.bInheritHandle = TRUE; | ||
116 | event = CreateEvent (&sa, FALSE, FALSE, NULL); | ||
117 | snprintf (debugger, MAX_PATH + 1, debugger_env, GetCurrentProcessId (), (uintptr_t) event); | ||
118 | debugger[MAX_PATH] = '\0'; | ||
119 | if (0 != CreateProcessA (NULL, debugger, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) | ||
120 | { | 106 | { |
121 | CloseHandle (pi.hProcess); | 107 | STARTUPINFO si; |
122 | CloseHandle (pi.hThread); | 108 | PROCESS_INFORMATION pi; |
123 | WaitForSingleObject (event, 60000); | 109 | HANDLE event; |
124 | CloseHandle (event); | 110 | SECURITY_ATTRIBUTES sa; |
125 | if (IsDebuggerPresent ()) | 111 | memset(&si, 0, sizeof(si)); |
126 | { | 112 | si.cb = sizeof(si); |
127 | return EXCEPTION_CONTINUE_EXECUTION; | 113 | memset(&pi, 0, sizeof(pi)); |
128 | } | 114 | memset(&sa, 0, sizeof(sa)); |
115 | sa.nLength = sizeof(sa); | ||
116 | sa.bInheritHandle = TRUE; | ||
117 | event = CreateEvent(&sa, FALSE, FALSE, NULL); | ||
118 | snprintf(debugger, MAX_PATH + 1, debugger_env, GetCurrentProcessId(), (uintptr_t)event); | ||
119 | debugger[MAX_PATH] = '\0'; | ||
120 | if (0 != CreateProcessA(NULL, debugger, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) | ||
121 | { | ||
122 | CloseHandle(pi.hProcess); | ||
123 | CloseHandle(pi.hThread); | ||
124 | WaitForSingleObject(event, 60000); | ||
125 | CloseHandle(event); | ||
126 | if (IsDebuggerPresent()) | ||
127 | { | ||
128 | return EXCEPTION_CONTINUE_EXECUTION; | ||
129 | } | ||
130 | } | ||
131 | else | ||
132 | CloseHandle(event); | ||
129 | } | 133 | } |
130 | else | ||
131 | CloseHandle (event); | ||
132 | } | ||
133 | return EXCEPTION_CONTINUE_SEARCH; | 134 | return EXCEPTION_CONTINUE_SEARCH; |
134 | } | 135 | } |
135 | #endif | 136 | #endif |
@@ -138,168 +139,168 @@ GNWinVEH (PEXCEPTION_POINTERS ExceptionInfo) | |||
138 | * @brief Initialize PlibC and set up Windows environment | 139 | * @brief Initialize PlibC and set up Windows environment |
139 | * @param logging context, NULL means stderr | 140 | * @param logging context, NULL means stderr |
140 | * @return Error code from winerror.h, ERROR_SUCCESS on success | 141 | * @return Error code from winerror.h, ERROR_SUCCESS on success |
141 | */ | 142 | */ |
142 | int | 143 | int |
143 | GNInitWinEnv () | 144 | GNInitWinEnv() |
144 | { | 145 | { |
145 | int ret; | 146 | int ret; |
146 | 147 | ||
147 | plibc_initialized (); | 148 | plibc_initialized(); |
148 | plibc_set_panic_proc (plibc_panic); | 149 | plibc_set_panic_proc(plibc_panic); |
149 | ret = plibc_init_utf8 ("GNU", PACKAGE, 1); | 150 | ret = plibc_init_utf8("GNU", PACKAGE, 1); |
150 | plibc_set_stat_size_size (sizeof (((struct stat *) 0)->st_size)); | 151 | plibc_set_stat_size_size(sizeof(((struct stat *)0)->st_size)); |
151 | plibc_set_stat_time_size (sizeof (((struct stat *) 0)->st_mtime)); | 152 | plibc_set_stat_time_size(sizeof(((struct stat *)0)->st_mtime)); |
152 | /* don't load other DLLs twice */ | 153 | /* don't load other DLLs twice */ |
153 | if (hNTDLL) | 154 | if (hNTDLL) |
154 | return ret; | 155 | return ret; |
155 | 156 | ||
156 | #ifdef W32_VEH | 157 | #ifdef W32_VEH |
157 | if (GNWinVEH_handle == NULL) | 158 | if (GNWinVEH_handle == NULL) |
158 | { | ||
159 | GNWinVEH_handle = AddVectoredExceptionHandler (1, &GNWinVEH); | ||
160 | if (GNWinVEH_handle == NULL) | ||
161 | { | 159 | { |
162 | /* This is bad, but what can we do? */ | 160 | GNWinVEH_handle = AddVectoredExceptionHandler(1, &GNWinVEH); |
163 | printf ("Failed to set up an exception handler!\n"); | 161 | if (GNWinVEH_handle == NULL) |
162 | { | ||
163 | /* This is bad, but what can we do? */ | ||
164 | printf("Failed to set up an exception handler!\n"); | ||
165 | } | ||
164 | } | 166 | } |
165 | } | ||
166 | #endif | 167 | #endif |
167 | 168 | ||
168 | hNTDLL = LoadLibrary ("ntdll.dll"); | 169 | hNTDLL = LoadLibrary("ntdll.dll"); |
169 | 170 | ||
170 | /* Function to get CPU usage under Win NT */ | 171 | /* Function to get CPU usage under Win NT */ |
171 | if (hNTDLL) | 172 | if (hNTDLL) |
172 | { | 173 | { |
173 | GNNtQuerySystemInformation = | 174 | GNNtQuerySystemInformation = |
174 | (TNtQuerySystemInformation) GetProcAddress (hNTDLL, | 175 | (TNtQuerySystemInformation)GetProcAddress(hNTDLL, |
175 | "NtQuerySystemInformation"); | 176 | "NtQuerySystemInformation"); |
176 | } | 177 | } |
177 | else | 178 | else |
178 | { | 179 | { |
179 | GNNtQuerySystemInformation = NULL; | 180 | GNNtQuerySystemInformation = NULL; |
180 | } | 181 | } |
181 | 182 | ||
182 | /* Functions to get information about a network adapter */ | 183 | /* Functions to get information about a network adapter */ |
183 | hIphlpapi = LoadLibrary ("iphlpapi.dll"); | 184 | hIphlpapi = LoadLibrary("iphlpapi.dll"); |
184 | if (hIphlpapi) | 185 | if (hIphlpapi) |
185 | { | 186 | { |
186 | GNGetIfEntry = (TGetIfEntry) GetProcAddress (hIphlpapi, "GetIfEntry"); | 187 | GNGetIfEntry = (TGetIfEntry)GetProcAddress(hIphlpapi, "GetIfEntry"); |
187 | GNGetIpAddrTable = | 188 | GNGetIpAddrTable = |
188 | (TGetIpAddrTable) GetProcAddress (hIphlpapi, "GetIpAddrTable"); | 189 | (TGetIpAddrTable)GetProcAddress(hIphlpapi, "GetIpAddrTable"); |
189 | GNGetIfTable = (TGetIfTable) GetProcAddress (hIphlpapi, "GetIfTable"); | 190 | GNGetIfTable = (TGetIfTable)GetProcAddress(hIphlpapi, "GetIfTable"); |
190 | GNGetBestInterfaceEx = | 191 | GNGetBestInterfaceEx = |
191 | (TGetBestInterfaceEx) GetProcAddress (hIphlpapi, "GetBestInterfaceEx"); | 192 | (TGetBestInterfaceEx)GetProcAddress(hIphlpapi, "GetBestInterfaceEx"); |
192 | GNGetAdaptersInfo = | 193 | GNGetAdaptersInfo = |
193 | (TGetAdaptersInfo) GetProcAddress (hIphlpapi, "GetAdaptersInfo"); | 194 | (TGetAdaptersInfo)GetProcAddress(hIphlpapi, "GetAdaptersInfo"); |
194 | } | 195 | } |
195 | else | 196 | else |
196 | { | 197 | { |
197 | GNGetIfEntry = NULL; | 198 | GNGetIfEntry = NULL; |
198 | GNGetIpAddrTable = NULL; | 199 | GNGetIpAddrTable = NULL; |
199 | GNGetIfTable = NULL; | 200 | GNGetIfTable = NULL; |
200 | GNGetBestInterfaceEx = NULL; | 201 | GNGetBestInterfaceEx = NULL; |
201 | GNGetAdaptersInfo = NULL; | 202 | GNGetAdaptersInfo = NULL; |
202 | } | 203 | } |
203 | 204 | ||
204 | /* Service & Account functions */ | 205 | /* Service & Account functions */ |
205 | hAdvapi = LoadLibrary ("advapi32.dll"); | 206 | hAdvapi = LoadLibrary("advapi32.dll"); |
206 | if (hAdvapi) | 207 | if (hAdvapi) |
207 | { | 208 | { |
208 | GNOpenSCManager = | 209 | GNOpenSCManager = |
209 | (TOpenSCManager) GetProcAddress (hAdvapi, "OpenSCManagerA"); | 210 | (TOpenSCManager)GetProcAddress(hAdvapi, "OpenSCManagerA"); |
210 | GNCreateService = | 211 | GNCreateService = |
211 | (TCreateService) GetProcAddress (hAdvapi, "CreateServiceA"); | 212 | (TCreateService)GetProcAddress(hAdvapi, "CreateServiceA"); |
212 | GNCloseServiceHandle = | 213 | GNCloseServiceHandle = |
213 | (TCloseServiceHandle) GetProcAddress (hAdvapi, "CloseServiceHandle"); | 214 | (TCloseServiceHandle)GetProcAddress(hAdvapi, "CloseServiceHandle"); |
214 | GNDeleteService = | 215 | GNDeleteService = |
215 | (TDeleteService) GetProcAddress (hAdvapi, "DeleteService"); | 216 | (TDeleteService)GetProcAddress(hAdvapi, "DeleteService"); |
216 | GNRegisterServiceCtrlHandler = | 217 | GNRegisterServiceCtrlHandler = |
217 | (TRegisterServiceCtrlHandler) GetProcAddress (hAdvapi, | 218 | (TRegisterServiceCtrlHandler)GetProcAddress(hAdvapi, |
218 | "RegisterServiceCtrlHandlerA"); | 219 | "RegisterServiceCtrlHandlerA"); |
219 | GNSetServiceStatus = | 220 | GNSetServiceStatus = |
220 | (TSetServiceStatus) GetProcAddress (hAdvapi, "SetServiceStatus"); | 221 | (TSetServiceStatus)GetProcAddress(hAdvapi, "SetServiceStatus"); |
221 | GNStartServiceCtrlDispatcher = | 222 | GNStartServiceCtrlDispatcher = |
222 | (TStartServiceCtrlDispatcher) GetProcAddress (hAdvapi, | 223 | (TStartServiceCtrlDispatcher)GetProcAddress(hAdvapi, |
223 | "StartServiceCtrlDispatcherA"); | 224 | "StartServiceCtrlDispatcherA"); |
224 | GNControlService = | 225 | GNControlService = |
225 | (TControlService) GetProcAddress (hAdvapi, "ControlService"); | 226 | (TControlService)GetProcAddress(hAdvapi, "ControlService"); |
226 | GNOpenService = (TOpenService) GetProcAddress (hAdvapi, "OpenServiceA"); | 227 | GNOpenService = (TOpenService)GetProcAddress(hAdvapi, "OpenServiceA"); |
227 | 228 | ||
228 | GNLsaOpenPolicy = | 229 | GNLsaOpenPolicy = |
229 | (TLsaOpenPolicy) GetProcAddress (hAdvapi, "LsaOpenPolicy"); | 230 | (TLsaOpenPolicy)GetProcAddress(hAdvapi, "LsaOpenPolicy"); |
230 | GNLsaAddAccountRights = | 231 | GNLsaAddAccountRights = |
231 | (TLsaAddAccountRights) GetProcAddress (hAdvapi, "LsaAddAccountRights"); | 232 | (TLsaAddAccountRights)GetProcAddress(hAdvapi, "LsaAddAccountRights"); |
232 | GNLsaRemoveAccountRights = | 233 | GNLsaRemoveAccountRights = |
233 | (TLsaRemoveAccountRights) GetProcAddress (hAdvapi, | 234 | (TLsaRemoveAccountRights)GetProcAddress(hAdvapi, |
234 | "LsaRemoveAccountRights"); | 235 | "LsaRemoveAccountRights"); |
235 | GNLsaClose = (TLsaClose) GetProcAddress (hAdvapi, "LsaClose"); | 236 | GNLsaClose = (TLsaClose)GetProcAddress(hAdvapi, "LsaClose"); |
236 | GNLookupAccountName = | 237 | GNLookupAccountName = |
237 | (TLookupAccountName) GetProcAddress (hAdvapi, "LookupAccountNameA"); | 238 | (TLookupAccountName)GetProcAddress(hAdvapi, "LookupAccountNameA"); |
238 | 239 | ||
239 | GNGetFileSecurity = | 240 | GNGetFileSecurity = |
240 | (TGetFileSecurity) GetProcAddress (hAdvapi, "GetFileSecurityA"); | 241 | (TGetFileSecurity)GetProcAddress(hAdvapi, "GetFileSecurityA"); |
241 | GNInitializeSecurityDescriptor = | 242 | GNInitializeSecurityDescriptor = |
242 | (TInitializeSecurityDescriptor) GetProcAddress (hAdvapi, | 243 | (TInitializeSecurityDescriptor)GetProcAddress(hAdvapi, |
243 | "InitializeSecurityDescriptor"); | 244 | "InitializeSecurityDescriptor"); |
244 | GNGetSecurityDescriptorDacl = | 245 | GNGetSecurityDescriptorDacl = |
245 | (TGetSecurityDescriptorDacl) GetProcAddress (hAdvapi, | 246 | (TGetSecurityDescriptorDacl)GetProcAddress(hAdvapi, |
246 | "GetSecurityDescriptorDacl"); | 247 | "GetSecurityDescriptorDacl"); |
247 | GNGetAclInformation = | 248 | GNGetAclInformation = |
248 | (TGetAclInformation) GetProcAddress (hAdvapi, "GetAclInformation"); | 249 | (TGetAclInformation)GetProcAddress(hAdvapi, "GetAclInformation"); |
249 | GNInitializeAcl = | 250 | GNInitializeAcl = |
250 | (TInitializeAcl) GetProcAddress (hAdvapi, "InitializeAcl"); | 251 | (TInitializeAcl)GetProcAddress(hAdvapi, "InitializeAcl"); |
251 | GNGetAce = (TGetAce) GetProcAddress (hAdvapi, "GetAce"); | 252 | GNGetAce = (TGetAce)GetProcAddress(hAdvapi, "GetAce"); |
252 | GNEqualSid = (TEqualSid) GetProcAddress (hAdvapi, "EqualSid"); | 253 | GNEqualSid = (TEqualSid)GetProcAddress(hAdvapi, "EqualSid"); |
253 | GNAddAce = (TAddAce) GetProcAddress (hAdvapi, "AddAce"); | 254 | GNAddAce = (TAddAce)GetProcAddress(hAdvapi, "AddAce"); |
254 | GNAddAccessAllowedAce = | 255 | GNAddAccessAllowedAce = |
255 | (TAddAccessAllowedAce) GetProcAddress (hAdvapi, "AddAccessAllowedAce"); | 256 | (TAddAccessAllowedAce)GetProcAddress(hAdvapi, "AddAccessAllowedAce"); |
256 | GNSetNamedSecurityInfo = | 257 | GNSetNamedSecurityInfo = |
257 | (TSetNamedSecurityInfo) GetProcAddress (hAdvapi, | 258 | (TSetNamedSecurityInfo)GetProcAddress(hAdvapi, |
258 | "SetNamedSecurityInfoA"); | 259 | "SetNamedSecurityInfoA"); |
259 | } | 260 | } |
260 | else | 261 | else |
261 | { | 262 | { |
262 | GNOpenSCManager = NULL; | 263 | GNOpenSCManager = NULL; |
263 | GNCreateService = NULL; | 264 | GNCreateService = NULL; |
264 | GNCloseServiceHandle = NULL; | 265 | GNCloseServiceHandle = NULL; |
265 | GNDeleteService = NULL; | 266 | GNDeleteService = NULL; |
266 | GNRegisterServiceCtrlHandler = NULL; | 267 | GNRegisterServiceCtrlHandler = NULL; |
267 | GNSetServiceStatus = NULL; | 268 | GNSetServiceStatus = NULL; |
268 | GNStartServiceCtrlDispatcher = NULL; | 269 | GNStartServiceCtrlDispatcher = NULL; |
269 | GNControlService = NULL; | 270 | GNControlService = NULL; |
270 | GNOpenService = NULL; | 271 | GNOpenService = NULL; |
271 | 272 | ||
272 | GNLsaOpenPolicy = NULL; | 273 | GNLsaOpenPolicy = NULL; |
273 | GNLsaAddAccountRights = NULL; | 274 | GNLsaAddAccountRights = NULL; |
274 | GNLsaRemoveAccountRights = NULL; | 275 | GNLsaRemoveAccountRights = NULL; |
275 | GNLsaClose = NULL; | 276 | GNLsaClose = NULL; |
276 | GNLookupAccountName = NULL; | 277 | GNLookupAccountName = NULL; |
277 | 278 | ||
278 | GNGetFileSecurity = NULL; | 279 | GNGetFileSecurity = NULL; |
279 | GNInitializeSecurityDescriptor = NULL; | 280 | GNInitializeSecurityDescriptor = NULL; |
280 | GNGetSecurityDescriptorDacl = NULL; | 281 | GNGetSecurityDescriptorDacl = NULL; |
281 | GNGetAclInformation = NULL; | 282 | GNGetAclInformation = NULL; |
282 | GNInitializeAcl = NULL; | 283 | GNInitializeAcl = NULL; |
283 | GNGetAce = NULL; | 284 | GNGetAce = NULL; |
284 | GNEqualSid = NULL; | 285 | GNEqualSid = NULL; |
285 | GNAddAce = NULL; | 286 | GNAddAce = NULL; |
286 | GNAddAccessAllowedAce = NULL; | 287 | GNAddAccessAllowedAce = NULL; |
287 | GNSetNamedSecurityInfo = NULL; | 288 | GNSetNamedSecurityInfo = NULL; |
288 | } | 289 | } |
289 | 290 | ||
290 | /* Account function */ | 291 | /* Account function */ |
291 | hNetapi = LoadLibrary ("netapi32.dll"); | 292 | hNetapi = LoadLibrary("netapi32.dll"); |
292 | if (hNetapi) | 293 | if (hNetapi) |
293 | { | 294 | { |
294 | GNNetUserAdd = (TNetUserAdd) GetProcAddress (hNetapi, "NetUserAdd"); | 295 | GNNetUserAdd = (TNetUserAdd)GetProcAddress(hNetapi, "NetUserAdd"); |
295 | GNNetUserSetInfo = | 296 | GNNetUserSetInfo = |
296 | (TNetUserSetInfo) GetProcAddress (hNetapi, "NetUserSetInfo"); | 297 | (TNetUserSetInfo)GetProcAddress(hNetapi, "NetUserSetInfo"); |
297 | } | 298 | } |
298 | else | 299 | else |
299 | { | 300 | { |
300 | GNNetUserAdd = NULL; | 301 | GNNetUserAdd = NULL; |
301 | GNNetUserSetInfo = NULL; | 302 | GNNetUserSetInfo = NULL; |
302 | } | 303 | } |
303 | 304 | ||
304 | return ret; | 305 | return ret; |
305 | } | 306 | } |
@@ -308,32 +309,32 @@ GNInitWinEnv () | |||
308 | * Clean up Windows environment | 309 | * Clean up Windows environment |
309 | */ | 310 | */ |
310 | void | 311 | void |
311 | GNShutdownWinEnv () | 312 | GNShutdownWinEnv() |
312 | { | 313 | { |
313 | plibc_shutdown (); | 314 | plibc_shutdown(); |
314 | 315 | ||
315 | #ifdef W32_VEH | 316 | #ifdef W32_VEH |
316 | if (GNWinVEH_handle != NULL) | 317 | if (GNWinVEH_handle != NULL) |
317 | { | 318 | { |
318 | RemoveVectoredExceptionHandler (GNWinVEH_handle); | 319 | RemoveVectoredExceptionHandler(GNWinVEH_handle); |
319 | GNWinVEH_handle = NULL; | 320 | GNWinVEH_handle = NULL; |
320 | } | 321 | } |
321 | #endif | 322 | #endif |
322 | 323 | ||
323 | FreeLibrary (hNTDLL); | 324 | FreeLibrary(hNTDLL); |
324 | FreeLibrary (hIphlpapi); | 325 | FreeLibrary(hIphlpapi); |
325 | FreeLibrary (hAdvapi); | 326 | FreeLibrary(hAdvapi); |
326 | FreeLibrary (hNetapi); | 327 | FreeLibrary(hNetapi); |
327 | 328 | ||
328 | CoUninitialize (); | 329 | CoUninitialize(); |
329 | } | 330 | } |
330 | 331 | ||
331 | #endif /* MINGW */ | 332 | #endif /* MINGW */ |
332 | 333 | ||
333 | #if !HAVE_ATOLL | 334 | #if !HAVE_ATOLL |
334 | long long | 335 | long long |
335 | atoll (const char *nptr) | 336 | atoll(const char *nptr) |
336 | { | 337 | { |
337 | return atol (nptr); | 338 | return atol(nptr); |
338 | } | 339 | } |
339 | #endif | 340 | #endif |