This commit is contained in:
Igor Pavlov
2023-12-22 17:17:05 +00:00
committed by Kornel
parent ec44a8a070
commit a36c48cece
954 changed files with 42199 additions and 25482 deletions

View File

@@ -1,7 +1,7 @@
// Windows/MemoryGlobal.h
#ifndef __WINDOWS_MEMORY_GLOBAL_H
#define __WINDOWS_MEMORY_GLOBAL_H
#ifndef ZIP7_INC_WINDOWS_MEMORY_GLOBAL_H
#define ZIP7_INC_WINDOWS_MEMORY_GLOBAL_H
#include "../Common/MyWindows.h"
@@ -12,7 +12,7 @@ class CGlobal
{
HGLOBAL _global;
public:
CGlobal(): _global(NULL){};
CGlobal(): _global(NULL) {}
~CGlobal() { Free(); }
operator HGLOBAL() const { return _global; }
void Attach(HGLOBAL hGlobal)
@@ -22,7 +22,7 @@ public:
}
HGLOBAL Detach()
{
HGLOBAL h = _global;
const HGLOBAL h = _global;
_global = NULL;
return h;
}
@@ -42,10 +42,10 @@ public:
CGlobalLock(HGLOBAL hGlobal): _global(hGlobal)
{
_ptr = GlobalLock(hGlobal);
};
}
~CGlobalLock()
{
if (_ptr != NULL)
if (_ptr)
GlobalUnlock(_global);
}
};