Changeset 9189 for trunk/src


Ignore:
Timestamp:
Sep 2, 2002, 12:09:26 AM (23 years ago)
Author:
bird
Message:

More stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/kKrnlLib/tools/pmdfrexx/pm.cmd

    r9187 r9189  
    1212 * Globals
    1313 */
    14 sGlobals = 'ulHandleTable sGlobals';
     14sGlobals = 'ulHandleTable aProc. sGlobals';
    1515ulHandleTable = 0;
     16aProc.0 = 0;                            /* process table */
    1617
    1718
     
    2324sArg = lowercase(sArgs);
    2425say '';
     26
    2527
    2628/*
     
    4951
    5052    /*
     53     * PM stuff
     54     */
     55    when (sCMD = 'pmstatus') then
     56        return PmStatus(sArgs);
     57
     58    /*
    5159     * Generic dump
    5260     */
     
    5765            when (sStruct = 'mq') then
    5866                return MqDump(sDumperArgs);
     67            when (sStruct = 'pmsem') then
     68                return PmsemDump(sDumperArgs);
     69            when (sStruct = 'qmsg') then
     70                return QmsgDump(sDumperArgs);
     71            when (sStruct = 'sms') then
     72                return SmsDump(sDumperArgs);
     73            when (sStruct = 'sqmsg') then
     74                return SqmsgDump(sDumperArgs);
    5975            when (sStruct = 'wnd') then
    6076                return WndDump(sDumperArgs);
    61             when (sStruct = 'pmsem') then
    62                 return pmsemDump(sDumperArgs);
    6377
    6478            otherwise
     
    471485 * MESSAGE QUEUE STRUCTURE (MQ)
    472486 */
    473 mqSize:             procedure expose(sGlobals);  return x2d('b0');
    474 mqNext:             procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('00'), sMem);
    475 mqEntrySize:        procedure expose(sGlobals);  parse arg sMem;     return memWord(x2d('04'), sMem);
     487mqSize:             procedure expose(sGlobals);                     return x2d('b0');
     488mqNext:             procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('00'), sMem);
     489mqEntrySize:        procedure expose(sGlobals); parse arg sMem;     return memWord(x2d('04'), sMem);
    476490/*mqQueue:            procedure expose(sGlobals);  parse arg sMem;     return memWord(x2d('06'), sMem);*/
    477 mqMessages:         procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('08'), sMem);
     491mqMessages:         procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('08'), sMem);
    478492/* ?? */
    479 mqMaxMessages:      procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('0c'), sMem);
    480 mqTid:              procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('18'), sMem);
    481 mqPid:              procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('1c'), sMem);
    482 mqFirstMsg:         procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('20'), sMem);
    483 mqLastMsg:          procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('24'), sMem);
    484 mqSGid:             procedure expose(sGlobals);  parse arg sMem;     return memWord(x2d('28'), sMem);
    485 mqHev:              procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('2c'), sMem);
    486 mqSent:             procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('3c'), sMem);
    487 mqCurrent:          procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('40'), sMem);
    488 
    489 mqBadPwnd:          procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('68'), sMem);
    490 mqBadQueue:         procedure expose(sGlobals);  parse arg sMem;     return memByte(x2d('6c'), sMem);
    491 mqCountTimers:      procedure expose(sGlobals);  parse arg sMem;     return memByte(x2d('6d'), sMem);
    492 mqHeap:             procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('70'), sMem);
    493 mqHAccel:           procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('74'), sMem);
    494 
    495 mqShutdown:         procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('90'), sMem);
    496 
    497 mqRcvdSMSList:      procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('98'), sMem);
    498 mqSlot:             procedure expose(sGlobals);  parse arg sMem;     return memDword(x2d('a0'), sMem);
     493mqMaxMessages:      procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('0c'), sMem);
     494mqPid:              procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('18'), sMem);
     495mqTid:              procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('1c'), sMem);
     496mqFirstMsg:         procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('20'), sMem);
     497mqLastMsg:          procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('24'), sMem);
     498mqSGid:             procedure expose(sGlobals); parse arg sMem;     return memWord(x2d('28'), sMem);
     499mqHev:              procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('2c'), sMem);
     500mqSent:             procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('3c'), sMem);
     501mqCurrent:          procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('40'), sMem);
     502
     503mqBadPwnd:          procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('68'), sMem);
     504mqBadQueue:         procedure expose(sGlobals); parse arg sMem;     return memByte(x2d('6c'), sMem);
     505mqCountTimers:      procedure expose(sGlobals); parse arg sMem;     return memByte(x2d('6d'), sMem);
     506mqHeap:             procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('70'), sMem);
     507mqHAccel:           procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('74'), sMem);
     508
     509mqShutdown:         procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('90'), sMem);
     510
     511mqRcvdSMSList:      procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('98'), sMem);
     512mqSlot:             procedure expose(sGlobals); parse arg sMem;     return memDword(x2d('a0'), sMem);
    499513
    500514/** dump one mq structure */
     
    572586
    573587
     588/*
     589 * SENDMSG STRUCTRURE (SMS)
     590 * SENDMSG STRUCTRURE (SMS)
     591 * SENDMSG STRUCTRURE (SMS)
     592 * SENDMSG STRUCTRURE (SMS)
     593 * SENDMSG STRUCTRURE (SMS)
     594 * SENDMSG STRUCTRURE (SMS)
     595 * SENDMSG STRUCTRURE (SMS)
     596 */
     597smsSize:            procedure expose(sGlobals);                     return 64;
     598smsNextMaster:      procedure expose(sGlobals); parse arg sMem;     return memDword(0, sMem);
     599smsSendHead:        procedure expose(sGlobals); parse arg sMem;     return memDword(4, sMem);
     600smsReserved0:       procedure expose(sGlobals); parse arg sMem;     return memDword(8, sMem);
     601smsReceiveNext:     procedure expose(sGlobals); parse arg sMem;     return memDword(12, sMem);
     602smsTime:            procedure expose(sGlobals); parse arg sMem;     return memDword(16, sMem);
     603smsSenderPMQ:       procedure expose(sGlobals); parse arg sMem;     return memDword(20, sMem);
     604smsReceiverPMQ:     procedure expose(sGlobals); parse arg sMem;     return memDword(24, sMem);
     605smsResult:          procedure expose(sGlobals); parse arg sMem;     return memDword(28, sMem);
     606smsReserved1:       procedure expose(sGlobals); parse arg sMem;     return memDword(32, sMem);
     607smsPWND:            procedure expose(sGlobals); parse arg sMem;     return memDword(36, sMem);
     608smsMsgId:           procedure expose(sGlobals); parse arg sMem;     return memDword(40, sMem);
     609smsMP1:             procedure expose(sGlobals); parse arg sMem;     return memDword(44, sMem);
     610smsMP2:             procedure expose(sGlobals); parse arg sMem;     return memDword(48, sMem);
     611smsReserved2:       procedure expose(sGlobals); parse arg sMem;     return memDword(52, sMem);
     612smsReserved3:       procedure expose(sGlobals); parse arg sMem;     return memDword(56, sMem);
     613smsReserved4:       procedure expose(sGlobals); parse arg sMem;     return memDword(60, sMem);
     614
     615/** Dumps one sms structure */
     616smsDump1: procedure expose(sGlobals)
     617parse arg sMem
     618    say ' psmsMasterNext:' d2x(smsNextMaster(sMem),8)
     619    say '   psmsSendHead:' d2x(smsSendHead(sMem),8)
     620    say '      Reserved0:' d2x(smsReserved0(sMem),8)
     621    say 'psmsReceiveNext:' d2x(smsReceiveNext(sMem),8)
     622    say '           Time:' d2x(smsTime(sMem),8)
     623    say '      pmqSender:' d2x(smsSenderPMQ(sMem),8)
     624    say '    pmqReceiver:' d2x(smsReceiverPMQ(sMem),8)
     625    say '       ulResult:' d2x(smsResult(sMem),8)
     626    say '      Reserved1:' d2x(smsReserved1(sMem),8)
     627    say '           pWnd:' d2x(smsPWND(sMem),8)
     628    say '        ulMsgId:' d2x(smsMsgId(sMem),8) '('msgMsgIdToText(smsMsgId(sMem))')'
     629    say '            MP1:' d2x(smsMP1(sMem),8)
     630    say '            MP2:' d2x(smsMP2(sMem),8)
     631    say '      Reserved2:' d2x(smsReserved2(sMem),8)
     632    say '      Reserved3:' d2x(smsReserved3(sMem),8)
     633    say '      Reserved4:' d2x(smsReserver4(sMem),8)
     634return 0;
     635
     636
     637/**
     638 * Send message struct (SMS) dumper.
     639 * @param   sAddr   Address expression of a sms struct.
     640 * @returns 0
     641 */
     642SmsDump: procedure expose(sGlobals)
     643parse arg sAddr cCount
     644    /*defaults and param validation */
     645    if (cCount = '' | datatype(cCount) <> 'NUM') then
     646        cCount = 1;
     647    if (sAddr = '') then
     648        signal SyntaxError
     649
     650    /* read memory */
     651    sMem = dfReadMem(sAddr, cCount * smsSize())
     652    if (sMem <> '') then
     653    do
     654        /* loop thru them all listing the taken/bogus ones */
     655        do i = 0 to cCount - 1
     656            call smsDump1 memCopy(i * smsSize(), smsSize(), sMem);
     657        end
     658    end
     659    else
     660        say 'error: failed to read SMS structure at '''sAddr'''.';
     661return 0;
     662
     663
     664/*
     665 * PM QUEUE MESSAGE STRUCTURE (QMSG)
     666 * PM QUEUE MESSAGE STRUCTURE (QMSG)
     667 * PM QUEUE MESSAGE STRUCTURE (QMSG)
     668 * PM QUEUE MESSAGE STRUCTURE (QMSG)
     669 * PM QUEUE MESSAGE STRUCTURE (QMSG)
     670 * PM QUEUE MESSAGE STRUCTURE (QMSG)
     671 * PM QUEUE MESSAGE STRUCTURE (QMSG)
     672 */
     673qmsgSize:           procedure expose(sGlobals);                     return 32;
     674qmsgHwnd:           procedure expose(sGlobals); parse arg sMem;     return memDword(0, sMem);
     675qmsgMsgId:          procedure expose(sGlobals); parse arg sMem;     return memDword(4, sMem);
     676qmsgMP1:            procedure expose(sGlobals); parse arg sMem;     return memDword(8, sMem);
     677qmsgMP2:            procedure expose(sGlobals); parse arg sMem;     return memDword(12, sMem);
     678qmsgTime:           procedure expose(sGlobals); parse arg sMem;     return memDword(16, sMem);
     679qmsgPtlX:           procedure expose(sGlobals); parse arg sMem;     return memDword(20, sMem);
     680qmsgPtlY:           procedure expose(sGlobals); parse arg sMem;     return memDword(24, sMem);
     681qmsgReserved:       procedure expose(sGlobals); parse arg sMem;     return memDword(28, sMem);
     682
     683qmsgDump1: procedure expose(sGlobals);
     684parse arg sMem
     685    say '     Hwnd:' d2x(qmsgHwnd(sMem),8)
     686    say '    MsgId:' d2x(qmsgMsgId(sMem),8) '('msgMsgIdToText(qmsgMsgId(sMem))')'
     687    say '      MP1:' d2x(qmsgMP1(sMem),8)
     688    say '      MP2:' d2x(qmsgMP2(sMem),8)
     689    say '     Time:' d2x(qmsgTime(sMem),8)
     690    say '    Ptl.x:' d2x(qmsgPtlX(sMem),8)
     691    say '    Ptl.y:' d2x(qmsgPtlY(sMem),8)
     692    say ' Reserved:' d2x(qmsgReserved(sMem),8)
     693return 0;
     694
     695
     696/**
     697 * Queue message struct (QMSG) dumper.
     698 * @param   sAddr   Address expression of a sms struct.
     699 * @returns 0
     700 */
     701QmsgDump: procedure expose(sGlobals)
     702parse arg sAddr cCount
     703    /*defaults and param validation */
     704    if (cCount = '' | datatype(cCount) <> 'NUM') then
     705        cCount = 1;
     706    if (sAddr = '') then
     707        signal SyntaxError
     708
     709    /* read memory */
     710    sMem = dfReadMem(sAddr, cCount * qmsgSize())
     711    if (sMem <> '') then
     712    do
     713        /* loop thru them all listing the taken/bogus ones */
     714        do i = 0 to cCount - 1
     715            call qmsgDump1 memCopy(i * qmsgSize(), qmsgSize(), sMem);
     716        end
     717    end
     718    else
     719        say 'error: failed to read QMSG structure at '''sAddr'''.';
     720return 0;
     721
     722
     723/*
     724 * PM SYSSTEM QUEUE MESSAGE STRUCTURE (SQMSG)
     725 * PM SYSSTEM QUEUE MESSAGE STRUCTURE (SQMSG)
     726 * PM SYSSTEM QUEUE MESSAGE STRUCTURE (SQMSG)
     727 * PM SYSSTEM QUEUE MESSAGE STRUCTURE (SQMSG)
     728 * PM SYSSTEM QUEUE MESSAGE STRUCTURE (SQMSG)
     729 * PM SYSSTEM QUEUE MESSAGE STRUCTURE (SQMSG)
     730 * PM SYSSTEM QUEUE MESSAGE STRUCTURE (SQMSG)
     731 * PM SYSSTEM QUEUE MESSAGE STRUCTURE (SQMSG)
     732 */
     733sqmsgSize:           procedure expose(sGlobals);                     return 32;
     734sqmsgMsgId:          procedure expose(sGlobals); parse arg sMem;     return memDword(0, sMem);
     735sqmsgMP1:            procedure expose(sGlobals); parse arg sMem;     return memDword(4, sMem);
     736sqmsgMP2:            procedure expose(sGlobals); parse arg sMem;     return memDword(8, sMem);
     737sqmsgTime:           procedure expose(sGlobals); parse arg sMem;     return memDword(12, sMem);
     738sqmsgReserved0:      procedure expose(sGlobals); parse arg sMem;     return memDword(16, sMem);
     739sqmsgReserved1:      procedure expose(sGlobals); parse arg sMem;     return memDword(20, sMem);
     740sqmsgReserved2:      procedure expose(sGlobals); parse arg sMem;     return memDword(24, sMem);
     741sqmsgReserved3:      procedure expose(sGlobals); parse arg sMem;     return memDword(28, sMem);
     742
     743sqmsgDump1: procedure expose(sGlobals);
     744parse arg sMem
     745    say '    MsgId:' d2x(sqmsgMsgId(sMem),8) '('msgMsgIdToText(sqmsgMsgId(sMem))')'
     746    say '      MP1:' d2x(sqmsgMP1(sMem),8)
     747    say '      MP2:' d2x(sqmsgMP2(sMem),8)
     748    say '     Time:' d2x(sqmsgTime(sMem),8)
     749    say 'Reserved0:' d2x(sqmsgReserved0(sMem),8)
     750    say 'Reserved1:' d2x(sqmsgReserved1(sMem),8)
     751    say 'Reserved2:' d2x(sqmsgReserved2(sMem),8)
     752    say 'Reserved3:' d2x(sqmsgReserved3(sMem),8)
     753return 0;
     754
     755
     756/**
     757 * System Queue message struct (SQMSG) dumper.
     758 * @param   sAddr   Address expression of a sqmsg struct.
     759 * @returns 0
     760 */
     761SqmsgDump: procedure expose(sGlobals)
     762parse arg sAddr cCount
     763    /*defaults and param validation */
     764    if (cCount = '' | datatype(cCount) <> 'NUM') then
     765        cCount = 1;
     766    if (sAddr = '') then
     767        signal SyntaxError
     768
     769    /* read memory */
     770    sMem = dfReadMem(sAddr, cCount * sqmsgSize())
     771    if (sMem <> '') then
     772    do
     773        /* loop thru them all listing the taken/bogus ones */
     774        do i = 0 to cCount - 1
     775            call sqmsgDump1 memCopy(i * sqmsgSize(), sqmsgSize(), sMem);
     776        end
     777    end
     778    else
     779        say 'error: failed to read SQMSG structure at '''sAddr'''.';
     780return 0;
     781
     782
     783/*
     784 * MSG HELPERS
     785 * MSG HELPERS
     786 * MSG HELPERS
     787 * MSG HELPERS
     788 * MSG HELPERS
     789 * MSG HELPERS
     790 * MSG HELPERS
     791 * MSG HELPERS
     792 */
     793
     794/**
     795 * translates a message ID into a message define string
     796 * @param   iMsgId  The message id in question.
     797 * @returns Symbol name.
     798 *          '' if unknown.
     799 */
     800msgMsgIdToText: procedure
     801parse arg iMsgId
     802    select
     803        when (iMsgId = x2d('0000')) then return 'WM_NULL';
     804        when (iMsgId = x2d('0001')) then return 'WM_CREATE';
     805        when (iMsgId = x2d('0002')) then return 'WM_DESTROY';
     806        /*when (iMsgId == x2d('0003')) then return '';*/
     807        when (iMsgId = x2d('0004')) then return 'WM_ENABLE';
     808        when (iMsgId = x2d('0005')) then return 'WM_SHOW';
     809        when (iMsgId = x2d('0006')) then return 'WM_MOVE';
     810        when (iMsgId = x2d('0007')) then return 'WM_SIZE';
     811        when (iMsgId = x2d('0008')) then return 'WM_ADJUSTWINDOWPOS';
     812        when (iMsgId = x2d('0009')) then return 'WM_CALCVALIDRECTS';
     813        when (iMsgId = x2d('000a')) then return 'WM_SETWINDOWPARAMS';
     814        when (iMsgId = x2d('000b')) then return 'WM_QUERYWINDOWPARAMS';
     815        when (iMsgId = x2d('000c')) then return 'WM_HITTEST';
     816        when (iMsgId = x2d('000d')) then return 'WM_ACTIVATE';
     817        when (iMsgId = x2d('000f')) then return 'WM_SETFOCUS';
     818        when (iMsgId = x2d('0010')) then return 'WM_SETSELECTION';
     819        when (iMsgId = x2d('0011')) then return 'WM_PPAINT';
     820        when (iMsgId = x2d('0012')) then return 'WM_PSETFOCUS';
     821        when (iMsgId = x2d('0013')) then return 'WM_PSYSCOLORCHANGE';
     822        when (iMsgId = x2d('0014')) then return 'WM_PSIZE';
     823        when (iMsgId = x2d('0015')) then return 'WM_PACTIVATE';
     824        when (iMsgId = x2d('0016')) then return 'WM_PCONTROL';
     825        when (iMsgId = x2d('0020')) then return 'WM_COMMAND';
     826        when (iMsgId = x2d('0021')) then return 'WM_SYSCOMMAND';
     827        when (iMsgId = x2d('0022')) then return 'WM_HELP';
     828        when (iMsgId = x2d('0023')) then return 'WM_PAINT';
     829        when (iMsgId = x2d('0024')) then return 'WM_TIMER';
     830        when (iMsgId = x2d('0025')) then return 'WM_SEM1';
     831        when (iMsgId = x2d('0026')) then return 'WM_SEM2';
     832        when (iMsgId = x2d('0027')) then return 'WM_SEM3';
     833        when (iMsgId = x2d('0028')) then return 'WM_SEM4';
     834        when (iMsgId = x2d('0029')) then return 'WM_CLOSE';
     835        when (iMsgId = x2d('002a')) then return 'WM_QUIT';
     836        when (iMsgId = x2d('002b')) then return 'WM_SYSCOLORCHANGE';
     837        when (iMsgId = x2d('002d')) then return 'WM_SYSVALUECHANGED';
     838        when (iMsgId = x2d('002e')) then return 'WM_APPTERMINATENOTIFY';
     839        when (iMsgId = x2d('002f')) then return 'WM_PRESPARAMCHANGED';
     840        when (iMsgId = x2d('0030')) then return 'WM_CONTROL';
     841        when (iMsgId = x2d('0031')) then return 'WM_VSCROLL';
     842        when (iMsgId = x2d('0032')) then return 'WM_HSCROLL';
     843        when (iMsgId = x2d('0033')) then return 'WM_INITMENU';
     844        when (iMsgId = x2d('0034')) then return 'WM_MENUSELECT';
     845        when (iMsgId = x2d('0035')) then return 'WM_MENUEND';
     846        when (iMsgId = x2d('0036')) then return 'WM_DRAWITEM';
     847        when (iMsgId = x2d('0037')) then return 'WM_MEASUREITEM';
     848        when (iMsgId = x2d('0038')) then return 'WM_CONTROLPOINTER';
     849        when (iMsgId = x2d('003a')) then return 'WM_QUERYDLGCODE';
     850        when (iMsgId = x2d('003b')) then return 'WM_INITDLG';
     851        when (iMsgId = x2d('003c')) then return 'WM_SUBSTITUTESTRING';
     852        when (iMsgId = x2d('003d')) then return 'WM_MATCHMNEMONIC';
     853        when (iMsgId = x2d('003e')) then return 'WM_SAVEAPPLICATION';
     854        when (iMsgId = x2d('0490')) then return 'WM_SEMANTICEVENT';
     855        when (iMsgId = x2d('1000')) then return 'WM_USER';
     856        when (iMsgId = x2d('007e')) then return 'WM_VRNDISABLED';
     857        when (iMsgId = x2d('007f')) then return 'WM_VRNENABLED';
     858        when (iMsgId = x2d('007a')) then return 'WM_CHAR';
     859        when (iMsgId = x2d('007b')) then return 'WM_VIOCHAR';
     860        when (iMsgId = x2d('0070')) then return 'WM_MOUSEMOVE';
     861        when (iMsgId = x2d('0071')) then return 'WM_BUTTON1DOWN';
     862        when (iMsgId = x2d('0072')) then return 'WM_BUTTON1UP';
     863        when (iMsgId = x2d('0073')) then return 'WM_BUTTON1DBLCLK';
     864        when (iMsgId = x2d('0074')) then return 'WM_BUTTON2DOWN';
     865        when (iMsgId = x2d('0075')) then return 'WM_BUTTON2UP';
     866        when (iMsgId = x2d('0076')) then return 'WM_BUTTON2DBLCLK';
     867        when (iMsgId = x2d('0077')) then return 'WM_BUTTON3DOWN';
     868        when (iMsgId = x2d('0078')) then return 'WM_BUTTON3UP';
     869        when (iMsgId = x2d('0079')) then return 'WM_BUTTON3DBLCLK';
     870        when (iMsgId = x2d('007D')) then return 'WM_MOUSEMAP';
     871        when (iMsgId = x2d('0410')) then return 'WM_CHORD';
     872        when (iMsgId = x2d('0411')) then return 'WM_BUTTON1MOTIONSTART';
     873        when (iMsgId = x2d('0412')) then return 'WM_BUTTON1MOTIONEND';
     874        when (iMsgId = x2d('0413')) then return 'WM_BUTTON1CLICK';
     875        when (iMsgId = x2d('0414')) then return 'WM_BUTTON2MOTIONSTART';
     876        when (iMsgId = x2d('0415')) then return 'WM_BUTTON2MOTIONEND';
     877        when (iMsgId = x2d('0416')) then return 'WM_BUTTON2CLICK';
     878        when (iMsgId = x2d('0417')) then return 'WM_BUTTON3MOTIONSTART';
     879        when (iMsgId = x2d('0418')) then return 'WM_BUTTON3MOTIONEND';
     880        when (iMsgId = x2d('0419')) then return 'WM_BUTTON3CLICK';
     881        when (iMsgId = x2d('0420')) then return 'WM_BEGINDRAG';
     882        when (iMsgId = x2d('0421')) then return 'WM_ENDDRAG';
     883        when (iMsgId = x2d('0422')) then return 'WM_SINGLESELECT';
     884        when (iMsgId = x2d('0423')) then return 'WM_OPEN';
     885        when (iMsgId = x2d('0424')) then return 'WM_CONTEXTMENU';
     886        when (iMsgId = x2d('0425')) then return 'WM_CONTEXTHELP';
     887        when (iMsgId = x2d('0426')) then return 'WM_TEXTEDIT';
     888        when (iMsgId = x2d('0427')) then return 'WM_BEGINSELECT';
     889        when (iMsgId = x2d('0428')) then return 'WM_ENDSELECT';
     890        when (iMsgId = x2d('0429')) then return 'WM_PICKUP';
     891        /*when (iMsgId = x2d('')) then return '
     892        when (iMsgId = x2d('')) then return '
     893        when (iMsgId = x2d('')) then return '
     894        when (iMsgId = x2d('')) then return '
     895        when (iMsgId = x2d('')) then return '
     896        when (iMsgId = x2d('')) then return '
     897        when (iMsgId = x2d('')) then return '
     898        when (iMsgId = x2d('')) then return '*/
     899        when (iMsgId >= x2d('04c0') & iMsgId <= x2d('04ff')) then return 'WM_PENxxx';
     900        when (iMsgId >= x2d('0500') & iMsgId <= x2d('05ff')) then return 'WM_MMPMxxx';
     901        when (iMsgId >= x2d('0600') & iMsgId <= x2d('065f')) then return 'WM_STDDLGxxx';
     902        when (iMsgId >= x2d('0bd0') & iMsgId <= x2d('0bff')) then return 'WM_BIDIxxx';
     903        when (iMsgId >= x2d('0f00') & iMsgId <= x2d('0fff')) then return 'WM_HELPMGRxxx';
     904        otherwise
     905    end
     906return '';
     907
     908
     909/*
     910 * PM
     911 * PM
     912 * PM
     913 * PM
     914 * PM
     915 * PM
     916 * PM
     917 * PM
     918 * PM
     919 * PM
     920 * PM
     921 * PM
     922 */
     923PmStatus: procedure expose(sGlobals)
     924parse arg sArgs
     925
     926    say 'PM Status:'
     927    say '     fBadAppDialog:' d2x(dfReadDword('fBadAppDialog'), 8)
     928    sMem = dfReadMem('qhpsBadApp', 8);
     929    say '        qhpsBadApp: tid='d2x(memWord(0, sMem), 4)','||,
     930                            'pid='d2x(memWord(2, sMem), 4)','||,
     931                            'flags='d2x(memWord(4, sMem), 4)','||,
     932                            'sgid='d2x(memWord(6, sMem), 4);
     933    say '- Focus & Locks -'
     934    pwndFocus   = dfReadDword('pwndfocus');
     935    say '         pwndFocus:' d2x(pwndFocus, 8);
     936    sMem = dfReadMem('%'||d2x(pwndFocus), wndSize());
     937    if (sMem <> '') then
     938    do
     939    say ' pwndFocus.hwnd   :' d2x(wndHwnd(sMem), 8);
     940        say ' pwndFocus.mq     :'    d2x(wndMsgQueue(sMem), 8);
     941        sMem = dfReadMem('%'||d2x(wndMsgQueue(sMem)), mqSize());
     942        if (sMem <> '') then
     943        do
     944    say ' pwndFocus.mq.slot:' d2x(mqSlot(sMem), 4);
     945    say ' pwndFocus.mq.tid :' d2x(mqTid(sMem), 8);
     946    say ' pwndFocus.mq.pid :' d2x(mqPid(sMem), 8);
     947        end
     948    end
     949    say '        pmqsyslock:' d2x(dfReadDword('pmqsyslock'), 8);
     950    say '        pmqVisLock:' d2x(dfReadDword('pmqVisLock'), 8)
     951    say '      pwndSysModal:' d2x(dfReadDword('pwndSysModal'), 8)
     952    say '          pmqTrack:' d2x(dfReadDword('pmqTrack'), 8)
     953    say '     pmqLockUpdate:' d2x(dfReadDword('pmqLockUpdate'), 8)
     954    say '- Event Receivers -'
     955    say '      pmqMouseWake:' d2x(dfReadDword('pmqMouseWake'), 8);
     956    say '        pmqKeyWake:' d2x(dfReadDword('pmqKeyWake'), 8)
     957    say '      pmqEventWake:' d2x(dfReadDword('pmqEventWake'), 8)
     958    say '- Lists -'
     959    say '         pSysqueue:' d2x(dfReadDword('pSysqueue'), 8)
     960    say '           pmqList:' d2x(dfReadDword('pmqList'), 8)
     961    say '- Misc Variables -'
     962    say '       pwndDesktop:' d2x(dfReadDword('pwndDesktop'), 8)
     963    say '        pwndObject:' d2x(dfReadDword('pwndObject'), 8)
     964    say '          pmqShell:' d2x(dfReadDword('pmqShell'), 8)
     965    say '         pmqShell2:' d2x(dfReadDword('pmqShell2'), 8)
     966    say '       pmqShutdown:' d2x(dfReadDword('pmqShutdown'), 8)
     967    say '         paAABRegs:' d2x(dfReadDword('paAABRegs'), 8)
     968
     969
     970return 0;
    574971
    575972
     
    7231120
    7241121/**
     1122 * Read all processes into global variable.
     1123 */
     1124dfProcessReadAll: procedure expose(sGlobals)
     1125parse arg fBlockInfo
     1126    if (\fBlockInfo) then
     1127    do
     1128        say '[reading processes]'
     1129        Address df 'CMD' 'asOut' '.p';
     1130        say '[done]'
     1131        if (rc = 0 & asOut.0 > 0) then
     1132        do
     1133            j = 0;
     1134            do i = 1 to asOut.0
     1135                if (word(asOut.i,1) = 'Slot' | strip(asOut.i) = '') then
     1136                    iterate;
     1137                /*  0074  0033 0000 0033 0002 blk 0500 f88e6000 fe62d220 f9a0b7e8 1e9c 12 muglrqst
     1138                 *  000a  0001 0000 0000 000a blk 081e f8812000 ffdba880 f99f7840 1e94 00 *jitdaem
     1139                 * *000b# 001d 0001 001d 0001 blk 0500 f8814000 fe6270a0 f99f7b44 1e9c 01 pmshell
     1140                 */
     1141                j = j + 1;
     1142                aProc.j.sType = '0';
     1143                aProc.j.hxBlockId = '0';
     1144                asOut.i = translate(left(asOut.i, 10), '  ', '#*') || substr(asOut.i, 11);
     1145                parse var asOut.i aProc.j.hxSlot,
     1146                                  aProc.j.hxPid,
     1147                                  aProc.j.hxPPid,
     1148                                  aProc.j.hxCsid,
     1149                                  aProc.j.hxOrd,
     1150                                  aProc.j.sState,
     1151                                  aProc.j.hxPri,
     1152                                  aProc.j.hxpTSD,
     1153                                  aProc.j.hxpPTDA,
     1154                                  aProc.j.hxpPCB,
     1155                                  aProc.j.hxDisp,
     1156                                  aProc.j.hxSG,
     1157                                  aProc.j.sName;
     1158                if (strip(aProc.j.hxSlot) = '') then
     1159                    j = j - 1;
     1160            end
     1161            aProc.0 = j;
     1162        end
     1163    end
     1164    else
     1165    do
     1166        say '[reading processes]'
     1167        Address df 'CMD' 'asOut' '.pb';
     1168        say '[done]'
     1169        if (rc = 0 & asOut.0 > 0) then
     1170        do
     1171            j = 0;
     1172            do i = 1 to asOut.0
     1173                if (word(asOut.i,1) = 'Slot' | strip(asOut.i) = '') then
     1174                    iterate;
     1175                /*  0044  blk fd436cf8 4os2     Sem32     8001 005d hevResultCodeSet
     1176                 * *000b# blk fd436190 pmshell
     1177                 *  0073  blk 0b008cbe msrv     SysSem
     1178                 */
     1179                asOut.i = translate(left(asOut.i, 10), '  ', '#*') || substr(asOut.i, 11);
     1180                j = j + 1;
     1181                aProc.j.hxPid = '0';
     1182                aProc.j.hxPPid = '0';
     1183                aProc.j.hxCsid = '0';
     1184                aProc.j.hxOrd = '0';
     1185                aProc.j.hxPri = '0';
     1186                aProc.j.hxpTSD = '0';
     1187                aProc.j.hxpPTDA = '0';
     1188                aProc.j.hxpPCB = '0';
     1189                aProc.j.hxDisp = '0';
     1190                aProc.j.hxSG = '0';
     1191                parse var asOut.i aProc.j.hxSlot,
     1192                                  aProc.j.sState,
     1193                                  aProc.j.hxBlockId,
     1194                                  aProc.j.sName,
     1195                                  aProc.j.sType .;
     1196                if (strip(aProc.j.hxSlot) = '') then
     1197                    j = j - 1;
     1198            end
     1199            aProc.0 = j;
     1200        end
     1201    end
     1202return -1;
     1203
     1204/**
     1205 * Gets the blockId of a process from the dumpformatter.
     1206 * @param   iSlot   The slot to query.
     1207 * @returns Block id (hex string).
     1208 *          '0' if failure.
     1209 */
     1210dfProcessBlockId: procedure expose(sGlobals)
     1211parse arg iSlot
     1212    Address df 'CMD' 'asOut' '.pb' iSlot;
     1213    if (rc = 0 & asOut.0 > 0) then
     1214    do
     1215        /* *000b# blk fd436190 pmshell */
     1216        asOut.0 = strip(asOut.0);
     1217        parse var asOut.0 .' 'sState' 'sBlockId' 'sProcName
     1218        sBlockId = strip(sBlockId)      /* needed??? */
     1219        if (strip(sBlockId) <> '') then
     1220            return sBlockId;
     1221    end
     1222return '0';
     1223
     1224/**
    7251225 * Gets a byte from the memory array aMem.
    7261226 * @param   iIndex      Byte offset into the array.
     
    9641464
    9651465
     1466
     1467/**
     1468 * Dump all processes. (debug more or less)
     1469 */
     1470procDumpAll: procedure expose(sGlobals)
     1471    say 'Processes:'
     1472    do i = 1 to aProc.0
     1473        say 'slot='aProc.i.hxSlot 'pid='aProc.i.hxPid 'blkid='aProc.i.hxBlockId 'name='aProc.i.sName
     1474    end
     1475return 0;
     1476
     1477
     1478/**
     1479 * Searches thru the process list looking for a process
     1480 * by it's pid and tid.
     1481 * @returns Index of the process.
     1482 * @param   pid     Process Id. (Decimal value)
     1483 * @param   tid     Thread Id. (Decimal value)
     1484 */
     1485procFindByPidTid: procedure expose(sGlobals)
     1486parse arg pid, tid
     1487    do i = 1 to aProc.0
     1488        if (x2d(aProc.i.hxPid) = pid & x2d(aProc.i.hxTid) = tid) then
     1489            return i;
     1490    end
     1491return 0;
     1492
     1493
     1494/**
     1495 * Searches thru the process list looking for a process
     1496 * by it's slot number.
     1497 * @returns Index of the process.
     1498 * @param   iSlot   Thread slot number. (Decimal value)
     1499 */
     1500procFindByPidTid: procedure expose(sGlobals)
     1501parse arg iSlot
     1502    do i = 1 to aProc.0
     1503        if (x2d(aProc.i.hxSlot) = iSlot) then
     1504            return i;
     1505    end
     1506return 0;
     1507
     1508
    9661509/**
    9671510 * Novaluehandler.
Note: See TracChangeset for help on using the changeset viewer.