Ignore:
Timestamp:
Aug 2, 2001, 10:36:35 PM (24 years ago)
Author:
umoeller
Message:

Misc changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/memdebug_win.c

    r71 r91  
    104104
    105105    ULONG       ulLine;
     106
     107    ULONG       ulAddress;      // has pAfterMagic, invisible, only
     108                                // for sorting V0.9.14 (2001-08-01) [umoeller]
    106109
    107110    PSZ         pszAddress;     // points to szAddress
     
    235238                }
    236239
    237                 sprintf(pMemRecordThis->szAddress, "0x%lX", pMemRecordThis->pObject);
    238                 strcpy(pMemRecordThis->szSource,
     240                pMemRecordThis->ulAddress = (ULONG)pMemRecordThis->pObject;
     241
     242                sprintf(pMemRecordThis->szAddress,
     243                        "0x%lX",
     244                        pMemRecordThis->pObject);
     245                strhcpy(pMemRecordThis->szSource,
    239246                        (pMemRecordThis->filename)
    240247                            ? pMemRecordThis->filename
     
    332339                pMemRecordThis->ulTID = pHeapItem->ulTID;
    333340
    334                 strcpy(pMemRecordThis->szSource, pHeapItem->pcszSourceFile);
     341                strhcpy(pMemRecordThis->szSource, pHeapItem->pcszSourceFile);
    335342                pMemRecordThis->pszSource = pMemRecordThis->szSource;
    336343
    337344                pMemRecordThis->ulLine = pHeapItem->ulLine;
    338345
    339                 strcpy(pMemRecordThis->szFunction, pHeapItem->pcszFunction);
     346                strhcpy(pMemRecordThis->szFunction, pHeapItem->pcszFunction);
    340347                pMemRecordThis->pszFunction = pMemRecordThis->szFunction;
    341348
    342                 sprintf(pMemRecordThis->szAddress, "0x%lX", pHeapItem->pAfterMagic);
     349                pMemRecordThis->ulAddress = (ULONG)pHeapItem->pAfterMagic;
     350
     351                sprintf(pMemRecordThis->szAddress,
     352                        "0x%lX",
     353                        pHeapItem->pAfterMagic);
    343354                pMemRecordThis->pszAddress = pMemRecordThis->szAddress;
    344355
     
    361372
    362373                sprintf(pMemRecordThis->szAddress, "0x%lX", pMemRecordThis->pObject);
    363                 strcpy(pMemRecordThis->szSource,
     374                strhcpy(pMemRecordThis->szSource,
    364375                        (pMemRecordThis->filename)
    365376                            ? pMemRecordThis->filename
     
    391402SHORT EXPENTRY mnu_fnCompareIndex(PMEMRECORD pmrc1, PMEMRECORD  pmrc2, PVOID pStorage)
    392403{
    393     // HAB habDesktop = WinQueryAnchorBlock(HWND_DESKTOP);
    394404    pStorage = pStorage; // to keep the compiler happy
    395405    if ((pmrc1) && (pmrc2))
     
    434444 *@@ mnu_fnCompareSourceFile:
    435445 *
    436  *V0.9.6 (2000-11-12) [umoeller]
     446 *@@added V0.9.6 (2000-11-12) [umoeller]
    437447 */
    438448
    439449SHORT EXPENTRY mnu_fnCompareSize(PMEMRECORD pmrc1, PMEMRECORD  pmrc2, PVOID pStorage)
    440450{
    441     HAB habDesktop = WinQueryAnchorBlock(HWND_DESKTOP);
    442451    pStorage = pStorage; // to keep the compiler happy
    443452    if ((pmrc1) && (pmrc2))
     
    452461}
    453462
     463/*
     464 *@@ mnu_fnCompareAddress:
     465 *
     466 *@@added V0.9.14 (2001-08-01) [umoeller]
     467 */
     468
     469SHORT EXPENTRY mnu_fnCompareAddress(PMEMRECORD pmrc1, PMEMRECORD  pmrc2, PVOID pStorage)
     470{
     471    pStorage = pStorage; // to keep the compiler happy
     472    if ((pmrc1) && (pmrc2))
     473    {
     474        if (pmrc1->ulAddress > pmrc2->ulAddress)
     475            return (1);
     476        else if (pmrc1->ulAddress < pmrc2->ulAddress)
     477            return (-1);
     478    }
     479
     480    return (0);
     481}
     482
    454483#define ID_MEMCNR   1000
    455484
     
    469498 *
    470499 *@@added V0.9.1 (99-12-04) [umoeller]
     500 *@@changed V0.9.14 (2001-08-01) [umoeller]: added sort by address
    471501 */
    472502
     
    648678                                       "Sort by object size",
    649679                                       MIS_TEXT, 0);
     680                    winhInsertMenuItem(G_hwndMemDebugMenu,
     681                                       MIT_END,
     682                                       1004,
     683                                       "Sort by address",
     684                                       MIS_TEXT, 0);
    650685
    651686                    WinSetFocus(HWND_DESKTOP, hwndCnr);
     
    715750                               CM_SORTRECORD,
    716751                               (MPARAM)mnu_fnCompareSize,
     752                               0);
     753                break;
     754
     755                case 1004: // sort by address V0.9.14 (2001-08-01) [umoeller]
     756                    WinSendMsg(WinWindowFromID(hwndClient, ID_MEMCNR),
     757                               CM_SORTRECORD,
     758                               (MPARAM)mnu_fnCompareAddress,
    717759                               0);
    718760                break;
     
    788830{
    789831    int i = 0;
     832    i++;
    790833}
    791834#endif
Note: See TracChangeset for help on using the changeset viewer.