Skip to content

Commit

Permalink
Unmount before shutdown/logoff.
Browse files Browse the repository at this point in the history
  • Loading branch information
prsyahmi committed Aug 19, 2017
1 parent e3154fe commit dbfe557
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions GpuRamDrive/GpuRamGui.cpp
Expand Up @@ -219,6 +219,11 @@ void GpuRamGui::OnDestroy()
PostQuitMessage(0);
}

void GpuRamGui::OnEndSession()
{
m_RamDrive.ImdiskUnmountDevice();
}

void GpuRamGui::OnResize(WORD width, WORD height, bool minimized)
{
MoveWindow(m_CtlGpuList, 150, 10, width - 150 - 20, 20, TRUE);
Expand Down Expand Up @@ -365,6 +370,10 @@ LRESULT CALLBACK GpuRamGui::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
break;
}

case WM_ENDSESSION:
if (_this) _this->OnEndSession();
break;

case WM_DESTROY:
if (_this) _this->OnDestroy();
break;
Expand Down
1 change: 1 addition & 0 deletions GpuRamDrive/GpuRamGui.h
Expand Up @@ -32,6 +32,7 @@ class GpuRamGui
private:
void OnCreate();
void OnDestroy();
void OnEndSession();
void OnResize(WORD width, WORD height, bool minimized);
void OnMountClicked();
void OnTrayInteraction(LPARAM lParam);
Expand Down

0 comments on commit dbfe557

Please sign in to comment.