diff --git a/Compiled/plugins/ImageScope.dll b/Compiled/plugins/ImageScope.dll index 23bd6a5..d05bd98 100644 Binary files a/Compiled/plugins/ImageScope.dll and b/Compiled/plugins/ImageScope.dll differ diff --git a/Source/Plugins/ImageScope/Resource.rc b/Source/Plugins/ImageScope/Resource.rc index 5a74a3a..8f4a605 100644 Binary files a/Source/Plugins/ImageScope/Resource.rc and b/Source/Plugins/ImageScope/Resource.rc differ diff --git a/Source/Plugins/ImageScope/ui.c b/Source/Plugins/ImageScope/ui.c index 50ff2b1..4bac1e6 100644 --- a/Source/Plugins/ImageScope/ui.c +++ b/Source/Plugins/ImageScope/ui.c @@ -6,7 +6,7 @@ * * VERSION: 1.00 * -* DATE: 01 Aug 2020 +* DATE: 03 Aug 2020 * * WinObjEx64 ImageScope UI. * @@ -194,7 +194,9 @@ VOID SectionDumpUnicodeString( _In_ HWND TreeList, _In_ HTREEITEM hParent, _In_ LPWSTR StringName, - _In_ PUNICODE_STRING pString + _In_ PUNICODE_STRING pString, + _In_ DWORD ItemState, + _In_ DWORD StateMask ) { HTREEITEM h_tviSubItem; @@ -211,8 +213,8 @@ VOID SectionDumpUnicodeString( TreeList, hParent, TVIF_TEXT | TVIF_STATE, - TVIS_EXPANDED, - 0, + ItemState, + StateMask, StringName, &subitems); @@ -236,7 +238,7 @@ VOID SectionDumpUnicodeString( supTreeListAddItem( TreeList, h_tviSubItem, - TVIF_TEXT | TVIF_STATE, + TVIF_TEXT, 0, 0, TEXT("Length"), @@ -261,7 +263,7 @@ VOID SectionDumpUnicodeString( supTreeListAddItem( TreeList, h_tviSubItem, - TVIF_TEXT | TVIF_STATE, + TVIF_TEXT, 0, 0, TEXT("MaximumLength"), @@ -289,7 +291,7 @@ VOID SectionDumpUnicodeString( supTreeListAddItem( TreeList, h_tviSubItem, - TVIF_TEXT | TVIF_STATE, + TVIF_TEXT, 0, 0, TEXT("Buffer"), @@ -355,7 +357,9 @@ VOID SectionDumpImageFileName( Context->TreeList, tviRoot, TEXT("Name"), - &ObjectNameInfo->Name); + &ObjectNameInfo->Name, + TVIS_EXPANDED, + TVIS_EXPANDED); } @@ -516,7 +520,7 @@ VOID SectionDumpStructs( sii.SubSystemMinorVersion); SectionDumpUlong(Context->TreeList, tviRoot, - sii.SubSystemVersion, TEXT("SubSystemType"), szText, UlongDump); + sii.SubSystemVersion, TEXT("SubSystemVersion"), szText, UlongDump); StringCchPrintf( szText, @@ -751,10 +755,15 @@ VOID SectionTabOnInit( HDITEM hdritem; GetClientRect(hWndDlg, &rc); + + TabCtrl_AdjustRect(Context->TabHeader->hwndTab, FALSE, &rc); + hwndList = CreateWindowEx(WS_EX_STATICEDGE, WC_TREELIST, NULL, WS_VISIBLE | WS_CHILD | WS_TABSTOP | TLSTYLE_COLAUTOEXPAND | TLSTYLE_LINKLINES, - 0, 0, - rc.right, rc.bottom, + rc.left, + rc.top, + rc.right, + rc.bottom, hWndDlg, NULL, NULL, NULL); if (hwndList) { @@ -1065,6 +1074,7 @@ VOID TabOnInit( default: break; } + } /* @@ -1149,6 +1159,9 @@ VOID TabsDumpList( GUI_CONTEXT* Context = GetProp(hWndDlg, T_IMS_PROP); HWND hwndList = GetDlgItem(hWndDlg, IDC_LIST); + if (Context == NULL) + return; + iSel = TabCtrl_GetCurSel(Context->TabHeader->hwndTab); switch (iSel) { @@ -1236,16 +1249,17 @@ VOID CALLBACK OnTabResize( HWND hwndList = 0; GUI_CONTEXT* Context; + Context = (GUI_CONTEXT*)GetProp(TabHeader->hwndDisplay, T_IMS_PROP); + if (Context == NULL) + return; + iSel = TabCtrl_GetCurSel(TabHeader->hwndTab); GetClientRect(TabHeader->hwndDisplay, &hwndRect); switch (iSel) { case TabIdSection: - Context = (GUI_CONTEXT*)GetProp(TabHeader->hwndDisplay, T_IMS_PROP); - if (Context) { - hwndList = Context->TreeList; - } + hwndList = Context->TreeList; break; case TabIdVSInfo: @@ -1257,33 +1271,21 @@ VOID CALLBACK OnTabResize( return; } - if (hwndList) SetWindowPos(hwndList, - 0, + if (hwndList == NULL) + return; + + GetClientRect(TabHeader->hwndDisplay, &hwndRect); + + TabCtrl_AdjustRect(TabHeader->hwndTab, FALSE, &hwndRect); + + SetWindowPos(hwndList, + HWND_TOP, 0, 0, hwndRect.right, hwndRect.bottom, SWP_NOOWNERZORDER); -} -/* -* OnTabSelChange -* -* Purpose: -* -* Tab window selection change callback. -* -*/ -VOID CALLBACK OnTabSelChange( - _In_ TABHDR* TabHeader, - _In_ INT SelectedTab -) -{ - UNREFERENCED_PARAMETER(SelectedTab); - - //destroy previous window - if (TabHeader->hwndDisplay != NULL) - DestroyWindow(TabHeader->hwndDisplay); } /* @@ -1305,7 +1307,6 @@ VOID OnResize( if (Context) { SendMessage(Context->StatusBar, WM_SIZE, 0, 0); - RedrawWindow(Context->StatusBar, NULL, 0, RDW_ERASE | RDW_INVALIDATE | RDW_ERASENOW); GetClientRect(hWnd, &r); GetClientRect(Context->StatusBar, &szr); @@ -1313,13 +1314,17 @@ VOID OnResize( //resize of the tab control if (Context->TabHeader != NULL) { - SetWindowPos(Context->TabHeader->hwndTab, HWND_TOP, - 0, 0, r.right, r.bottom - szr.bottom, 0); + SetWindowPos( + Context->TabHeader->hwndTab, + HWND_TOP, + 0, + 0, + r.right, + r.bottom - szr.bottom, + 0); TabResizeTabWindow(Context->TabHeader); - UpdateWindow(Context->TabHeader->hwndDisplay); - } } } @@ -1514,7 +1519,7 @@ BOOL RunUI( g_ThisDLL, Context->MainWindow, NULL, - (TABSELCHANGECALLBACK)&OnTabSelChange, + NULL, (TABRESIZECALLBACK)&OnTabResize, (TABCALLBACK_ALLOCMEM)&supHeapAlloc, (TABCALLBACK_FREEMEM)&supHeapFree); @@ -1551,6 +1556,7 @@ BOOL RunUI( } while ((rv != 0) && (g_PluginQuit == FALSE)); + TabDestroyControl(Context->TabHeader); DestroyWindow(Context->MainWindow); return TRUE; diff --git a/Source/Shared/tabs/tabsctrl.c b/Source/Shared/tabs/tabsctrl.c index 2d99973..66a2503 100644 --- a/Source/Shared/tabs/tabsctrl.c +++ b/Source/Shared/tabs/tabsctrl.c @@ -11,7 +11,7 @@ Abstract: Set of functions used with tab component. VERSION 2.0 (01.02.2015) - + WinObjEx64 version. --*/ @@ -125,9 +125,19 @@ VOID TabDestroyControl( _In_ PTABHDR hdr ) { + PTABENTRY tabEntry; + PLIST_ENTRY Entry; TABCALLBACK_FREEMEM pFree; + if (hdr) { pFree = hdr->FreeMem; + Entry = hdr->tabsHead.Flink; + + while ((Entry != NULL) && (Entry != &hdr->tabsHead)) { + tabEntry = CONTAINING_RECORD(Entry, TABENTRY, ListEntry); + Entry = Entry->Flink; + pFree(tabEntry); + } pFree(hdr); } } @@ -215,8 +225,8 @@ PTABHDR TabCreateControl( _In_ HINSTANCE hInstance, _In_ HWND hParentWnd, _In_opt_ HIMAGELIST hImageList, - _In_ TABSELCHANGECALLBACK OnSelChangeTab, - _In_ TABRESIZECALLBACK OnResizeTab, + _In_opt_ TABSELCHANGECALLBACK OnSelChangeTab, + _In_opt_ TABRESIZECALLBACK OnResizeTab, _In_ TABCALLBACK_ALLOCMEM MemAlloc, _In_ TABCALLBACK_FREEMEM MemFree ) diff --git a/Source/Shared/tabs/tabsctrl.h b/Source/Shared/tabs/tabsctrl.h index c4c5474..61b20f2 100644 --- a/Source/Shared/tabs/tabsctrl.h +++ b/Source/Shared/tabs/tabsctrl.h @@ -77,8 +77,8 @@ PTABHDR TabCreateControl( _In_ HINSTANCE hInstance, _In_ HWND hParentWnd, _In_opt_ HIMAGELIST hImageList, - _In_ TABSELCHANGECALLBACK OnSelChangeTab, - _In_ TABRESIZECALLBACK OnResizeTab, + _In_opt_ TABSELCHANGECALLBACK OnSelChangeTab, + _In_opt_ TABRESIZECALLBACK OnResizeTab, _In_ TABCALLBACK_ALLOCMEM MemAlloc, _In_ TABCALLBACK_FREEMEM MemFree); diff --git a/WinObjEx64.sha256 b/WinObjEx64.sha256 index b6dde14..d67adba 100644 --- a/WinObjEx64.sha256 +++ b/WinObjEx64.sha256 @@ -6,7 +6,7 @@ fa001b1ac9bbbb6c954d5dd609de60fa2b0277a6cfe35f6428591e4b4b1e8453 *Compiled\WHATS 95a49b8c75dc4f0d784176900d37cb03ed216e125fdbc92b75602156cd70e129 *Compiled\WinObjEx64.exe f2103ca9ffb50162897fb80d8d5a1a8eb470083d356261c11c79b9d8c00ab95b *Compiled\plugins\ApiSetView.dll fbb020fb38e72a85cfc0fcb0a1ab8ab780daa2df68efac69d04494c5e5a4431d *Compiled\plugins\ExamplePlugin.dll -0f049a1f21c2ac638e4533e900e95b11f1e8a0f0ffe8716804a3e1eb19f01ac4 *Compiled\plugins\ImageScope.dll +830ce78d398cf48c31e3de56e31c094b5b7749d67021e6cca03268646a3c02b0 *Compiled\plugins\ImageScope.dll b1597cdc8f9c740e21718efb1f3d615f576aa52530fa2c0467e148f9f2124a5b *Compiled\plugins\Sonar.dll 0505a450a13d5b742df2395c90af4e3029b05ce2157ee68f0c9e18a580c88091 *Docs\Callbacks.pdf a9a7b1448aae42671a9e38df1074056d6e1f6e5c0e15d95790be3be66f6b7910 *Docs\Plugins.pdf @@ -67,10 +67,10 @@ c06a75b13f855a94d46616796e024c52b499f8f92cf00ccb571ddbc6ff574676 *Source\Plugins a1beafe144a0b20f062de225ce53a23d7d6e0bcce8266ee488788a2adf896512 *Source\Plugins\ImageScope\query.c 70fcd612f41f100e8803326e5f28b8beccdef7bc9f22b41ccc0ef4f92fc1ae59 *Source\Plugins\ImageScope\query.h c1503020ed3120fdbf07cd802f4185844bada59eac02ba5820f92ef3b2bb3710 *Source\Plugins\ImageScope\resource.h -07cb5b8461ccd7e5764f8197fe0e96e9e25e18651b18052fd70a137890ab0ce6 *Source\Plugins\ImageScope\Resource.rc +29fd413d5c58ec791a9529f2c6176d5c7c1f7ed2069f787509995b84419a5617 *Source\Plugins\ImageScope\Resource.rc 56c6366805cdf36e3b5e9652b170d01bdbec14ee74520a1bf3f554bb32f98765 *Source\Plugins\ImageScope\sup.c 2ea1c3c1307680923d6f082740e0afe8b6cfa388a952db22bb6c7e18bfce2439 *Source\Plugins\ImageScope\sup.h -b170aa44e09ac8f61e144be2d165c2f50222786c00ac66babe10b4344927d391 *Source\Plugins\ImageScope\ui.c +8182318d279bc334e30cf81add4883f915ee3823e70d014fdb9660a7cd9c1a81 *Source\Plugins\ImageScope\ui.c 94657623b0536cbd3d62b18925490fca917b52606ad2ebeb41a468d4d2d5c2dd *Source\Plugins\ImageScope\ui.h 6b2236b93693d4830feb90ee504ae03555d4882d4c301bea55f7980973b5fb32 *Source\Plugins\Sonar\export.def 93afdfc5379b8482944b796f635e8fd50c7fd96e15785efce7bde3524949e55c *Source\Plugins\Sonar\global.h @@ -120,8 +120,8 @@ b9c7113bda8343b99599245e582c21426cf5b08d3c5b68ec5f1ee62feac0f5d1 *Source\Shared\ b63f0673d18e3b57d1a100e8b20bb0fab879832c4a8bde2ced234e901843feef *Source\Shared\ntos\ntsup.c 51ae1739bd8206d9f547fe466997695907757b9f73a5fdd2d8bf3f8c89f2805e *Source\Shared\ntos\ntsup.h a599f4baff680705c3c3827f363f298cc60050aa5eacb95acf0c8fe5831e71a6 *Source\Shared\sdk\extdef.h -e170cf3638a4c4471cda05346f06a6e6f575fbabb9338c0588584dfff177fcda *Source\Shared\tabs\tabsctrl.c -73c450a8c9a0dd75a6ffc198bf73db5af8d4e89cb00196f1d6eb44086948ee06 *Source\Shared\tabs\tabsctrl.h +4c28e19c053aa573e60006778fc00abc82a235e73f901be2c760af2798ca4869 *Source\Shared\tabs\tabsctrl.c +bc790054cc554fc105534c5bfa86c016624f10af1fad7dc67497fb275020bcff *Source\Shared\tabs\tabsctrl.h f2389aedc5e391d523f5f6eb797750c1a6d49ec98c162c0fe37421673dadbf8b *Source\Shared\treelist\treelist.c b7d270ce4b02c0f6680b6f79b9cc74603d5dbca466d4f08e533a8e627bc1aa9e *Source\Shared\treelist\treelist.h 368eaf36e5ac381cc25d794f2d3ac4c05b05426af09a8a828ba1bf81bce32c1c *Source\WinObjEx64\aboutDlg.c