File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,11 @@ void *SubProcessKernelObjects_Memory::Lock() {
96
96
case WAIT_OBJECT_0: {
97
97
m_pLockData = MapViewOfFile (m_pObjs->m_hMemorySection ,
98
98
FILE_MAP_ALL_ACCESS, 0 , 0 , 0 );
99
+ if (!m_pLockData) {
100
+ // dimhotepus: CS:GO backport.
101
+ Warning (" MapViewOfFile failed with error 0x%x\n " ,
102
+ HRESULT_FROM_WIN32 (GetLastError ()));
103
+ }
99
104
100
105
if (m_pLockData && *(const DWORD *)m_pLockData != m_pObjs->m_dwCookie ) {
101
106
// Yes, this is our turn, set our cookie in that memory segment
@@ -143,7 +148,13 @@ BOOL SubProcessKernelObjects_Memory::Unlock() {
143
148
// Assert that the memory hasn't been spoiled
144
149
Assert (m_pObjs->m_dwCookie == *(const DWORD *)m_pLockData);
145
150
146
- UnmapViewOfFile (m_pLockData);
151
+ DWORD rc = UnmapViewOfFile (m_pLockData);
152
+ if (rc == 0 ) {
153
+ // dimhotepus: CS:GO backport.
154
+ Warning (" UnmapViewOfFile failed with error 0x%x\n " ,
155
+ HRESULT_FROM_WIN32 (GetLastError ()));
156
+ }
157
+
147
158
m_pMemory = NULL ;
148
159
m_pLockData = NULL ;
149
160
You can’t perform that action at this time.
0 commit comments