[DEV[DEVMGR]
authorGed Murphy <gedmurphy@reactos.org>
Wed, 8 Jul 2015 06:43:16 +0000 (06:43 +0000)
committerGed Murphy <gedmurphy@reactos.org>
Wed, 8 Jul 2015 06:43:16 +0000 (06:43 +0000)
- Use the correct HINSTANCE in the dll. Fixes loading strings for tooltips, etc.
- Rename CMainWindow to CDeviceManager
- Fixup the decelerations and add missing SAL decoration

svn path=/trunk/; revision=68378

reactos/dll/win32/devmgr_new/devmgmt/DeviceView.cpp
reactos/dll/win32/devmgr_new/devmgmt/MainWindow.cpp
reactos/dll/win32/devmgr_new/devmgmt/MainWindow.h
reactos/dll/win32/devmgr_new/devmgmt/RootNode.cpp
reactos/dll/win32/devmgr_new/devmgmt/devmgmt.h

index 2728e05..9c49d47 100644 (file)
@@ -78,7 +78,7 @@ CDeviceView::Initialize()
                                   0, 0, 0, 0,
                                   m_hMainWnd,
                                   (HMENU)IDC_TREEVIEW,
-                                  g_hInstance,
+                                  g_hThisInstance,
                                   NULL);
     if (m_hTreeView)
     {
@@ -719,7 +719,7 @@ CDeviceView::EnableSelectedDevice(
     if (Enable == false)
     {
         CAtlStringW str;
-        if (str.LoadStringW(g_hInstance, IDS_CONFIRM_DISABLE))
+        if (str.LoadStringW(g_hThisInstance, IDS_CONFIRM_DISABLE))
         {
             if (MessageBoxW(m_hMainWnd,
                 str,
@@ -840,7 +840,7 @@ CDeviceView::BuildActionMenuForNode(
 
         if (DeviceNode->CanUpdate())
         {
-            String.LoadStringW(g_hInstance, IDS_MENU_UPDATE);
+            String.LoadStringW(g_hThisInstance, IDS_MENU_UPDATE);
             MenuItemInfo.wID = IDC_UPDATE_DRV;
             MenuItemInfo.dwTypeData = String.GetBuffer();
             InsertMenuItemW(OwnerMenu, i, TRUE, &MenuItemInfo);
@@ -849,7 +849,7 @@ CDeviceView::BuildActionMenuForNode(
 
         if (DeviceNode->IsDisabled())
         {
-            String.LoadStringW(g_hInstance, IDS_MENU_ENABLE);
+            String.LoadStringW(g_hThisInstance, IDS_MENU_ENABLE);
             MenuItemInfo.wID = IDC_ENABLE_DRV;
             MenuItemInfo.dwTypeData = String.GetBuffer();
             InsertMenuItemW(OwnerMenu, i, TRUE, &MenuItemInfo);
@@ -858,7 +858,7 @@ CDeviceView::BuildActionMenuForNode(
 
         if (DeviceNode->CanDisable() && !DeviceNode->IsDisabled())
         {
-            String.LoadStringW(g_hInstance, IDS_MENU_DISABLE);
+            String.LoadStringW(g_hThisInstance, IDS_MENU_DISABLE);
             MenuItemInfo.wID = IDC_DISABLE_DRV;
             MenuItemInfo.dwTypeData = String.GetBuffer();
             InsertMenuItemW(OwnerMenu, i, TRUE, &MenuItemInfo);
@@ -867,7 +867,7 @@ CDeviceView::BuildActionMenuForNode(
 
         if (DeviceNode->CanUninstall())
         {
-            String.LoadStringW(g_hInstance, IDS_MENU_UNINSTALL);
+            String.LoadStringW(g_hThisInstance, IDS_MENU_UNINSTALL);
             MenuItemInfo.wID = IDC_UNINSTALL_DRV;
             MenuItemInfo.dwTypeData = String.GetBuffer();
             InsertMenuItemW(OwnerMenu, i, TRUE, &MenuItemInfo);
@@ -879,7 +879,7 @@ CDeviceView::BuildActionMenuForNode(
     }
 
     // All nodes have the scan option
-    String.LoadStringW(g_hInstance, IDS_MENU_SCAN);
+    String.LoadStringW(g_hThisInstance, IDS_MENU_SCAN);
     MenuItemInfo.wID = IDC_SCAN_HARDWARE;
     MenuItemInfo.dwTypeData = String.GetBuffer();
     InsertMenuItemW(OwnerMenu, i, TRUE, &MenuItemInfo);
@@ -887,7 +887,7 @@ CDeviceView::BuildActionMenuForNode(
 
     if ((Node->GetNodeType() == RootNode) || (MainMenu == true))
     {
-        String.LoadStringW(g_hInstance, IDS_MENU_ADD);
+        String.LoadStringW(g_hThisInstance, IDS_MENU_ADD);
         MenuItemInfo.wID = IDC_ADD_HARDWARE;
         MenuItemInfo.dwTypeData = String.GetBuffer();
         InsertMenuItemW(OwnerMenu, i, TRUE, &MenuItemInfo);
@@ -899,7 +899,7 @@ CDeviceView::BuildActionMenuForNode(
         InsertMenuItemW(OwnerMenu, i, TRUE, &MenuSeperator);
         i++;
 
-        String.LoadStringW(g_hInstance, IDS_MENU_PROPERTIES);
+        String.LoadStringW(g_hThisInstance, IDS_MENU_PROPERTIES);
         MenuItemInfo.wID = IDC_PROPERTIES;
         MenuItemInfo.dwTypeData = String.GetBuffer();
         InsertMenuItemW(OwnerMenu, i, TRUE, &MenuItemInfo);
index 88d1df6..7af9f3a 100644 (file)
@@ -21,6 +21,8 @@
 #define BTN_UPDATE_DRV      4
 #define BTN_UNINSTALL_DRV   5
 
+HINSTANCE g_hThisInstance = NULL;
+HINSTANCE g_hParentInstance = NULL;
 
 // menu hints
 static const MENU_HINT MainMenuHintTable[] =
@@ -75,8 +77,7 @@ static TBBUTTON TbButtons[] =
 
 /* PUBLIC METHODS **********************************************/
 
-CMainWindow::CMainWindow(void) :
-    m_ToolbarhImageList(NULL),
+CDeviceManager::CDeviceManager(void) :
     m_hMainWnd(NULL),
     m_hStatusBar(NULL),
     m_hToolBar(NULL),
@@ -85,15 +86,55 @@ CMainWindow::CMainWindow(void) :
     m_szMainWndClass = L"DevMgmtWndClass";
 }
 
-CMainWindow::~CMainWindow(void)
+CDeviceManager::~CDeviceManager(void)
 {
-    // Destroy any previous list
-    if (m_ToolbarhImageList) ImageList_Destroy(m_ToolbarhImageList);
 }
 
+
+bool
+CDeviceManager::Create(_In_ HWND /*hWndParent*/,
+                       _In_ HINSTANCE hInst,
+                       _In_opt_z_ LPCWSTR /*lpMachineName*/,
+                       _In_ int nCmdShow)
+{
+    CDeviceManager MainWindow;
+    INITCOMMONCONTROLSEX icex;
+    CAtlStringW szAppName;
+    int Ret = 1;
+
+    // Store the instances
+    g_hParentInstance = hInst;
+    g_hThisInstance = GetModuleHandleW(L"devmgr.dll");
+
+    // Initialize common controls
+    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
+    icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;
+    InitCommonControlsEx(&icex);
+
+    // Load the application name
+    if (szAppName.LoadStringW(g_hThisInstance, IDS_APPNAME))
+    {
+        // Initialize the main window
+        if (MainWindow.Initialize(szAppName, nCmdShow))
+        {
+            // Run the application
+            Ret = MainWindow.Run();
+
+            // Uninitialize the main window
+            MainWindow.Uninitialize();
+        }
+    }
+
+    return (Ret == 0);
+}
+
+
+
+/* PRIVATE METHODS **********************************************/
+
 bool
-CMainWindow::Initialize(LPCTSTR lpCaption,
-                        int nCmdShow)
+CDeviceManager::Initialize(_In_z_ LPCTSTR lpCaption,
+                           _In_ int nCmdShow)
 {
     CAtlStringW szCaption;
     WNDCLASSEXW wc = {0};
@@ -104,13 +145,13 @@ CMainWindow::Initialize(LPCTSTR lpCaption,
     // Setup the window class struct
     wc.cbSize = sizeof(WNDCLASSEXW);
     wc.lpfnWndProc = MainWndProc;
-    wc.hInstance = g_hInstance;
-    wc.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCEW(IDI_MAIN_ICON));
+    wc.hInstance = g_hThisInstance;
+    wc.hIcon = LoadIcon(g_hThisInstance, MAKEINTRESOURCEW(IDI_MAIN_ICON));
     wc.hCursor = LoadCursor(NULL, IDC_ARROW);
     wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
     wc.lpszMenuName = MAKEINTRESOURCEW(IDR_MAINMENU);
     wc.lpszClassName = m_szMainWndClass;
-    wc.hIconSm = (HICON)LoadImage(g_hInstance,
+    wc.hIconSm = (HICON)LoadImage(g_hThisInstance,
                                   MAKEINTRESOURCE(IDI_MAIN_ICON),
                                   IMAGE_ICON,
                                   16,
@@ -131,7 +172,7 @@ CMainWindow::Initialize(LPCTSTR lpCaption,
                                      500,
                                      NULL,
                                      NULL,
-                                     g_hInstance,
+                                     g_hThisInstance,
                                      this);
     }
 
@@ -140,14 +181,14 @@ CMainWindow::Initialize(LPCTSTR lpCaption,
 }
 
 void
-CMainWindow::Uninitialize()
+CDeviceManager::Uninitialize(void)
 {
     // Unregister the window class 
-    UnregisterClassW(m_szMainWndClass, g_hInstance);
+    UnregisterClassW(m_szMainWndClass, g_hThisInstance);
 }
 
 int
-CMainWindow::Run()
+CDeviceManager::Run(void)
 {
     MSG Msg;
 
@@ -161,14 +202,11 @@ CMainWindow::Run()
     return 0;
 }
 
-
-/* PRIVATE METHODS **********************************************/
-
 bool
-CMainWindow::MainWndMenuHint(WORD CmdId,
-                             const MENU_HINT *HintArray,
-                             DWORD HintsCount,
-                             UINT DefHintId)
+CDeviceManager::MainWndMenuHint(_In_ WORD CmdId,
+                                _In_ const MENU_HINT *HintArray,
+                                _In_ DWORD HintsCount,
+                                _In_ UINT DefHintId)
 {
     bool Found = false;
     const MENU_HINT *LastHint;
@@ -188,16 +226,14 @@ CMainWindow::MainWndMenuHint(WORD CmdId,
 
     StatusBarLoadString(m_hStatusBar,
                         SB_SIMPLEID,
-                        g_hInstance,
+                        g_hThisInstance,
                         HintId);
 
     return Found;
 }
 
 void
-CMainWindow::UpdateStatusBar(
-    _In_ bool InMenuLoop
-    )
+CDeviceManager::UpdateStatusBar(_In_ bool InMenuLoop)
 {
     SendMessageW(m_hStatusBar,
                  SB_SIMPLE,
@@ -206,7 +242,7 @@ CMainWindow::UpdateStatusBar(
 }
 
 bool
-CMainWindow::RefreshView(ViewType Type)
+CDeviceManager::RefreshView(_In_ ViewType Type)
 {
     UINT CheckId = 0;
     BOOL bSuccess;
@@ -235,7 +271,7 @@ CMainWindow::RefreshView(ViewType Type)
 }
 
 bool
-CMainWindow::CreateToolBar()
+CDeviceManager::CreateToolBar(void)
 {
     TBADDBITMAP TbAddBitmap;
     INT Index;
@@ -251,7 +287,7 @@ CMainWindow::CreateToolBar()
                                  0, 0, 0, 0,
                                  m_hMainWnd,
                                  (HMENU)IDC_TOOLBAR,
-                                 g_hInstance,
+                                 g_hThisInstance,
                                  NULL);
     if (m_hToolBar == NULL) return FALSE;
 
@@ -269,7 +305,7 @@ CMainWindow::CreateToolBar()
                  sizeof(TBBUTTON),
                  0);
 
-    TbAddBitmap.hInst = g_hInstance;
+    TbAddBitmap.hInst = g_hThisInstance;
     TbAddBitmap.nID = IDB_TOOLBAR;
     Index = SendMessageW(m_hToolBar, TB_ADDBITMAP, _countof(TbButtons), (LPARAM)&TbAddBitmap);
 
@@ -285,7 +321,7 @@ CMainWindow::CreateToolBar()
 }
 
 bool
-CMainWindow::CreateStatusBar()
+CDeviceManager::CreateStatusBar(void)
 {
     int StatWidths[] = {110, -1}; // widths of status bar
     bool bRet = FALSE;
@@ -298,7 +334,7 @@ CMainWindow::CreateStatusBar()
                                    0, 0, 0, 0,
                                    m_hMainWnd,
                                    (HMENU)IDC_STATUSBAR,
-                                   g_hInstance,
+                                   g_hThisInstance,
                                    NULL);
     if (m_hStatusBar)
     {
@@ -312,7 +348,7 @@ CMainWindow::CreateStatusBar()
     return bRet;
 }
 
-void CMainWindow::UpdateToolbar()
+void CDeviceManager::UpdateToolbar()
 {
     WORD State;
 
@@ -367,10 +403,10 @@ void CMainWindow::UpdateToolbar()
 
 
 bool
-CMainWindow::StatusBarLoadString(IN HWND hStatusBar,
-                                 IN INT PartId,
-                                 IN HINSTANCE hInstance,
-                                 IN UINT uID)
+CDeviceManager::StatusBarLoadString(_In_ HWND hStatusBar,
+                                    _In_ INT PartId,
+                                    _In_ HINSTANCE hInstance,
+                                    _In_ UINT uID)
 {
     CAtlStringW szMessage;
     bool bRet = false;
@@ -389,7 +425,7 @@ CMainWindow::StatusBarLoadString(IN HWND hStatusBar,
 }
 
 LRESULT
-CMainWindow::OnCreate(HWND hwnd)
+CDeviceManager::OnCreate(_In_ HWND hwnd)
 {
     LRESULT RetCode;
 
@@ -422,7 +458,7 @@ CMainWindow::OnCreate(HWND hwnd)
 }
 
 LRESULT
-CMainWindow::OnSize()
+CDeviceManager::OnSize(void)
 {
     RECT rcClient, rcTool, rcStatus;
     INT lvHeight, iToolHeight, iStatusHeight;
@@ -457,7 +493,7 @@ CMainWindow::OnSize()
 }
 
 LRESULT
-CMainWindow::OnNotify(LPARAM lParam)
+CDeviceManager::OnNotify(_In_ LPARAM lParam)
 {
     LPNMHDR NmHdr = (LPNMHDR)lParam;
     LRESULT Ret;
@@ -491,6 +527,7 @@ CMainWindow::OnNotify(LPARAM lParam)
         case TTN_GETDISPINFO:
         {
              LPTOOLTIPTEXT lpttt = (LPTOOLTIPTEXT)lParam;
+             lpttt->hinst = g_hThisInstance;
 
             UINT_PTR idButton = lpttt->hdr.idFrom;
             switch (idButton)
@@ -502,18 +539,19 @@ CMainWindow::OnNotify(LPARAM lParam)
                     lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_SCAN);
                     break;
                 case IDC_ENABLE_DRV:
-                    lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_ENABLE);
+                    lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_ENABLE);
                     break;
                 case IDC_DISABLE_DRV:
-                    lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_DISABLE);
+                    lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_DISABLE);
                     break;
                 case IDC_UPDATE_DRV:
-                    lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_UPDATE);
+                    lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UPDATE);
                     break;
                 case IDC_UNINSTALL_DRV:
-                    lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_UNINSTALL);
+                    lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UNINSTALL);
                     break;
             }
+            idButton = idButton;
             break;
         }
     }
@@ -522,14 +560,14 @@ CMainWindow::OnNotify(LPARAM lParam)
 }
 
 LRESULT
-CMainWindow::OnContext(LPARAM lParam)
+CDeviceManager::OnContext(_In_ LPARAM lParam)
 {
     return m_DeviceView->OnContextMenu(lParam);
 }
 
 LRESULT
-CMainWindow::OnCommand(WPARAM wParam,
-                       LPARAM /*lParam*/)
+CDeviceManager::OnCommand(_In_ WPARAM wParam,
+                          _In_ LPARAM /*lParam*/)
 {
     LRESULT RetCode = 0;
     WORD Msg;
@@ -641,7 +679,7 @@ CMainWindow::OnCommand(WPARAM wParam,
 }
 
 LRESULT
-CMainWindow::OnDestroy()
+CDeviceManager::OnDestroy(void)
 {
     // Uninitialize the device view
     m_DeviceView->Uninitialize();
@@ -660,16 +698,16 @@ CMainWindow::OnDestroy()
 }
 
 LRESULT CALLBACK
-CMainWindow::MainWndProc(HWND hwnd,
-                         UINT msg,
-                         WPARAM wParam,
-                         LPARAM lParam)
+CDeviceManager::MainWndProc(_In_ HWND hwnd,
+                            _In_ UINT msg,
+                            _In_ WPARAM wParam,
+                            _In_ LPARAM lParam)
 {
-    CMainWindow *This;
+    CDeviceManager *This;
     LRESULT RetCode = 0;
 
     // Get the object pointer from window context
-    This = (CMainWindow *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+    This = (CDeviceManager *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
     if (This == NULL)
     {
         // Check that this isn't a create message
@@ -685,7 +723,7 @@ CMainWindow::MainWndProc(HWND hwnd,
         case WM_CREATE:
         {
             // Get the object pointer from the create param
-            This = (CMainWindow *)((LPCREATESTRUCT)lParam)->lpCreateParams;
+            This = (CDeviceManager *)((LPCREATESTRUCT)lParam)->lpCreateParams;
 
             // Store the pointer in the window's global user data
             SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)This);
@@ -783,49 +821,15 @@ HandleDefaultMessage:
 }
 
 
-//////// MOVE ME ////////////////
-
-HINSTANCE g_hInstance = NULL;
-HANDLE ProcessHeap = NULL;
-
-
+#if 1 // test
 BOOL
 WINAPI
-DeviceManager_ExecuteW(HWND /*hWndParent*/,
+DeviceManager_ExecuteW(HWND hWndParent,
                        HINSTANCE hInst,
-                       LPCWSTR /*lpMachineName*/,
+                       LPCWSTR lpMachineName,
                        int nCmdShow)
 {
-    CMainWindow MainWindow;
-    INITCOMMONCONTROLSEX icex;
-    CAtlStringW szAppName;
-    int Ret = 1;
-
-    // Store the global values
-    g_hInstance = hInst;
-    ProcessHeap = GetProcessHeap();
-
-    // Initialize common controls
-    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
-    icex.dwICC = ICC_BAR_CLASSES | ICC_COOL_CLASSES;
-    InitCommonControlsEx(&icex);
-
-    //__debugbreak();
-    g_hInstance = GetModuleHandle(L"devmgr.dll");
-
-    // Load the application name
-    if (szAppName.LoadStringW(g_hInstance, IDS_APPNAME))
-    {
-        // Initialize the main window
-        if (MainWindow.Initialize(szAppName, nCmdShow))
-        {
-            // Run the application
-            Ret = MainWindow.Run();
-
-            // Uninitialize the main window
-            MainWindow.Uninitialize();
-        }
-    }
-
-    return Ret;
+    CDeviceManager DevMgr;
+    return DevMgr.Create(hWndParent, hInst, lpMachineName, nCmdShow);
 }
+#endif
\ No newline at end of file
index 75027b9..7202c1f 100644 (file)
@@ -7,25 +7,27 @@ typedef struct _MENU_HINT
     UINT HintId;
 } MENU_HINT, *PMENU_HINT;
 
-class CMainWindow
+class CDeviceManager
 {
     CAtlStringW m_szMainWndClass;
     CDeviceView *m_DeviceView;
     HWND m_hMainWnd;
     HWND m_hStatusBar;
     HWND m_hToolBar;
-    HIMAGELIST m_ToolbarhImageList;
     HMENU m_hMenu;
     HMENU m_hActionMenu;
     int m_CmdShow;
 
 public:
-    CMainWindow(void);
-    ~CMainWindow(void);
+    CDeviceManager(void);
+    ~CDeviceManager(void);
 
-    bool Initialize(LPCTSTR lpCaption, int nCmdShow);
-    int Run();
-    void Uninitialize();
+    bool Create(
+        _In_ HWND hWndParent,
+        _In_ HINSTANCE hInst,
+        _In_opt_z_ LPCWSTR lpMachineName,
+        _In_ int nCmdShow
+        );
 
 private:
     static LRESULT CALLBACK MainWndProc(
@@ -35,24 +37,44 @@ private:
         LPARAM lParam
         );
 
-    LRESULT OnCreate(HWND hwnd);
-    LRESULT OnDestroy();
-    LRESULT OnSize();
-    LRESULT OnNotify(LPARAM lParam);
-    LRESULT OnContext(LPARAM lParam);
-    LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
+    bool Initialize(
+        _In_z_ LPCTSTR lpCaption,
+        _In_ int nCmdShow
+        );
+
+    int Run();
+    void Uninitialize(void);
+
+    LRESULT OnCreate(
+        _In_ HWND hwnd
+        );
+
+    LRESULT OnDestroy(void);
+    LRESULT OnSize(void);
 
-    bool CreateToolBar();
-    bool CreateStatusBar();
+    LRESULT OnNotify(
+        _In_ LPARAM lParam
+        );
 
-    void UpdateToolbar(
+    LRESULT OnContext(
+        _In_ LPARAM lParam
         );
 
+    LRESULT OnCommand(
+        _In_ WPARAM wParam,
+        LPARAM lParam
+        );
+
+    bool CreateToolBar(void);
+    bool CreateStatusBar(void);
+
+    void UpdateToolbar(void);
+
     bool StatusBarLoadString(
-        HWND hStatusBar,
-        INT PartId,
-        HINSTANCE hInstance,
-        UINT uID
+        _In_ HWND hStatusBar,
+        _In_ INT PartId,
+        _In_ HINSTANCE hInstance,
+        _In_ UINT uID
         );
 
     void UpdateStatusBar(
@@ -60,14 +82,14 @@ private:
         );
 
     bool MainWndMenuHint(
-        WORD CmdId,
-        const MENU_HINT *HintArray,
-        DWORD HintsCount,
-        UINT DefHintId
+        _In_ WORD CmdId,
+        _In_ const MENU_HINT *HintArray,
+        _In_ DWORD HintsCount,
+        _In_ UINT DefHintId
         );
 
     bool RefreshView(
-        ViewType Type
+        _In_ ViewType Type
         );
 };
 
index 05be76d..b20c7e0 100644 (file)
@@ -29,8 +29,8 @@ CRootNode::SetupNode()
 
     // Load the bitmap we'll be using as the root image
     HBITMAP hRootImage;
-    hRootImage = LoadBitmapW(g_hInstance,
-                                MAKEINTRESOURCEW(IDB_ROOT_IMAGE));
+    hRootImage = LoadBitmapW(g_hThisInstance,
+                             MAKEINTRESOURCEW(IDB_ROOT_IMAGE));
     if (hRootImage == NULL) return FALSE;
 
     // Add this bitmap to the device image list. This is a bit hacky, but it's safe
index 6c5d640..85481aa 100644 (file)
@@ -4,6 +4,6 @@
 #pragma once
 #include "..\resource.h"
 
-extern HINSTANCE g_hInstance;
-extern HANDLE ProcessHeap;
+extern HINSTANCE g_hThisInstance;
+extern HINSTANCE g_hParentInstance;