2022-04-01 04:06:53 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: auWin32Utils.hpp
|
|
|
|
Date: 2022-2-1
|
|
|
|
File: AuroraUtils.hpp
|
|
|
|
File: auROXTLUtils.hpp
|
|
|
|
Date: 2021-6-9
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
2022-11-17 02:48:58 +00:00
|
|
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
2022-04-01 04:06:53 +00:00
|
|
|
|
2022-11-17 02:48:58 +00:00
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
__declspec(dllimport) int __stdcall CloseHandle(
|
|
|
|
void *hObject
|
|
|
|
);
|
|
|
|
}
|
2022-04-01 04:06:53 +00:00
|
|
|
|
2024-10-13 07:49:59 +00:00
|
|
|
AU_OPTIMIZED void AuWin32CloseHandle(void *&handle)
|
2022-04-01 04:06:53 +00:00
|
|
|
{
|
2022-11-17 02:48:58 +00:00
|
|
|
void *local;
|
2022-04-01 04:06:53 +00:00
|
|
|
|
2022-11-17 02:48:58 +00:00
|
|
|
static void *const kInvalidHandle = (void *)((AuUInt)-1);
|
|
|
|
|
|
|
|
if ((local = AuExchange(handle, kInvalidHandle)) != kInvalidHandle)
|
2022-04-01 04:06:53 +00:00
|
|
|
{
|
|
|
|
CloseHandle(local);
|
|
|
|
}
|
|
|
|
}
|
2022-11-17 02:48:58 +00:00
|
|
|
|
2022-04-01 04:06:53 +00:00
|
|
|
#endif
|