- Timestamp:
- Sep 2, 2002, 12:09:26 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/win32k/kKrnlLib/tools/pmdfrexx/pm.cmd
r9187 r9189 12 12 * Globals 13 13 */ 14 sGlobals = 'ulHandleTable sGlobals';14 sGlobals = 'ulHandleTable aProc. sGlobals'; 15 15 ulHandleTable = 0; 16 aProc.0 = 0; /* process table */ 16 17 17 18 … … 23 24 sArg = lowercase(sArgs); 24 25 say ''; 26 25 27 26 28 /* … … 49 51 50 52 /* 53 * PM stuff 54 */ 55 when (sCMD = 'pmstatus') then 56 return PmStatus(sArgs); 57 58 /* 51 59 * Generic dump 52 60 */ … … 57 65 when (sStruct = 'mq') then 58 66 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); 59 75 when (sStruct = 'wnd') then 60 76 return WndDump(sDumperArgs); 61 when (sStruct = 'pmsem') then62 return pmsemDump(sDumperArgs);63 77 64 78 otherwise … … 471 485 * MESSAGE QUEUE STRUCTURE (MQ) 472 486 */ 473 mqSize: procedure expose(sGlobals); return x2d('b0');474 mqNext: procedure expose(sGlobals); 475 mqEntrySize: procedure expose(sGlobals); 487 mqSize: procedure expose(sGlobals); return x2d('b0'); 488 mqNext: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('00'), sMem); 489 mqEntrySize: procedure expose(sGlobals); parse arg sMem; return memWord(x2d('04'), sMem); 476 490 /*mqQueue: procedure expose(sGlobals); parse arg sMem; return memWord(x2d('06'), sMem);*/ 477 mqMessages: procedure expose(sGlobals); 491 mqMessages: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('08'), sMem); 478 492 /* ?? */ 479 mqMaxMessages: procedure expose(sGlobals); 480 mq Tid: procedure expose(sGlobals);parse arg sMem; return memDword(x2d('18'), sMem);481 mq Pid: procedure expose(sGlobals);parse arg sMem; return memDword(x2d('1c'), sMem);482 mqFirstMsg: procedure expose(sGlobals); 483 mqLastMsg: procedure expose(sGlobals); 484 mqSGid: procedure expose(sGlobals); 485 mqHev: procedure expose(sGlobals); 486 mqSent: procedure expose(sGlobals); 487 mqCurrent: procedure expose(sGlobals); 488 489 mqBadPwnd: procedure expose(sGlobals); 490 mqBadQueue: procedure expose(sGlobals); 491 mqCountTimers: procedure expose(sGlobals); 492 mqHeap: procedure expose(sGlobals); 493 mqHAccel: procedure expose(sGlobals); 494 495 mqShutdown: procedure expose(sGlobals); 496 497 mqRcvdSMSList: procedure expose(sGlobals); 498 mqSlot: procedure expose(sGlobals); 493 mqMaxMessages: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('0c'), sMem); 494 mqPid: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('18'), sMem); 495 mqTid: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('1c'), sMem); 496 mqFirstMsg: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('20'), sMem); 497 mqLastMsg: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('24'), sMem); 498 mqSGid: procedure expose(sGlobals); parse arg sMem; return memWord(x2d('28'), sMem); 499 mqHev: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('2c'), sMem); 500 mqSent: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('3c'), sMem); 501 mqCurrent: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('40'), sMem); 502 503 mqBadPwnd: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('68'), sMem); 504 mqBadQueue: procedure expose(sGlobals); parse arg sMem; return memByte(x2d('6c'), sMem); 505 mqCountTimers: procedure expose(sGlobals); parse arg sMem; return memByte(x2d('6d'), sMem); 506 mqHeap: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('70'), sMem); 507 mqHAccel: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('74'), sMem); 508 509 mqShutdown: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('90'), sMem); 510 511 mqRcvdSMSList: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('98'), sMem); 512 mqSlot: procedure expose(sGlobals); parse arg sMem; return memDword(x2d('a0'), sMem); 499 513 500 514 /** dump one mq structure */ … … 572 586 573 587 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 */ 597 smsSize: procedure expose(sGlobals); return 64; 598 smsNextMaster: procedure expose(sGlobals); parse arg sMem; return memDword(0, sMem); 599 smsSendHead: procedure expose(sGlobals); parse arg sMem; return memDword(4, sMem); 600 smsReserved0: procedure expose(sGlobals); parse arg sMem; return memDword(8, sMem); 601 smsReceiveNext: procedure expose(sGlobals); parse arg sMem; return memDword(12, sMem); 602 smsTime: procedure expose(sGlobals); parse arg sMem; return memDword(16, sMem); 603 smsSenderPMQ: procedure expose(sGlobals); parse arg sMem; return memDword(20, sMem); 604 smsReceiverPMQ: procedure expose(sGlobals); parse arg sMem; return memDword(24, sMem); 605 smsResult: procedure expose(sGlobals); parse arg sMem; return memDword(28, sMem); 606 smsReserved1: procedure expose(sGlobals); parse arg sMem; return memDword(32, sMem); 607 smsPWND: procedure expose(sGlobals); parse arg sMem; return memDword(36, sMem); 608 smsMsgId: procedure expose(sGlobals); parse arg sMem; return memDword(40, sMem); 609 smsMP1: procedure expose(sGlobals); parse arg sMem; return memDword(44, sMem); 610 smsMP2: procedure expose(sGlobals); parse arg sMem; return memDword(48, sMem); 611 smsReserved2: procedure expose(sGlobals); parse arg sMem; return memDword(52, sMem); 612 smsReserved3: procedure expose(sGlobals); parse arg sMem; return memDword(56, sMem); 613 smsReserved4: procedure expose(sGlobals); parse arg sMem; return memDword(60, sMem); 614 615 /** Dumps one sms structure */ 616 smsDump1: procedure expose(sGlobals) 617 parse 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) 634 return 0; 635 636 637 /** 638 * Send message struct (SMS) dumper. 639 * @param sAddr Address expression of a sms struct. 640 * @returns 0 641 */ 642 SmsDump: procedure expose(sGlobals) 643 parse 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'''.'; 661 return 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 */ 673 qmsgSize: procedure expose(sGlobals); return 32; 674 qmsgHwnd: procedure expose(sGlobals); parse arg sMem; return memDword(0, sMem); 675 qmsgMsgId: procedure expose(sGlobals); parse arg sMem; return memDword(4, sMem); 676 qmsgMP1: procedure expose(sGlobals); parse arg sMem; return memDword(8, sMem); 677 qmsgMP2: procedure expose(sGlobals); parse arg sMem; return memDword(12, sMem); 678 qmsgTime: procedure expose(sGlobals); parse arg sMem; return memDword(16, sMem); 679 qmsgPtlX: procedure expose(sGlobals); parse arg sMem; return memDword(20, sMem); 680 qmsgPtlY: procedure expose(sGlobals); parse arg sMem; return memDword(24, sMem); 681 qmsgReserved: procedure expose(sGlobals); parse arg sMem; return memDword(28, sMem); 682 683 qmsgDump1: procedure expose(sGlobals); 684 parse 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) 693 return 0; 694 695 696 /** 697 * Queue message struct (QMSG) dumper. 698 * @param sAddr Address expression of a sms struct. 699 * @returns 0 700 */ 701 QmsgDump: procedure expose(sGlobals) 702 parse 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'''.'; 720 return 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 */ 733 sqmsgSize: procedure expose(sGlobals); return 32; 734 sqmsgMsgId: procedure expose(sGlobals); parse arg sMem; return memDword(0, sMem); 735 sqmsgMP1: procedure expose(sGlobals); parse arg sMem; return memDword(4, sMem); 736 sqmsgMP2: procedure expose(sGlobals); parse arg sMem; return memDword(8, sMem); 737 sqmsgTime: procedure expose(sGlobals); parse arg sMem; return memDword(12, sMem); 738 sqmsgReserved0: procedure expose(sGlobals); parse arg sMem; return memDword(16, sMem); 739 sqmsgReserved1: procedure expose(sGlobals); parse arg sMem; return memDword(20, sMem); 740 sqmsgReserved2: procedure expose(sGlobals); parse arg sMem; return memDword(24, sMem); 741 sqmsgReserved3: procedure expose(sGlobals); parse arg sMem; return memDword(28, sMem); 742 743 sqmsgDump1: procedure expose(sGlobals); 744 parse 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) 753 return 0; 754 755 756 /** 757 * System Queue message struct (SQMSG) dumper. 758 * @param sAddr Address expression of a sqmsg struct. 759 * @returns 0 760 */ 761 SqmsgDump: procedure expose(sGlobals) 762 parse 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'''.'; 780 return 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 */ 800 msgMsgIdToText: procedure 801 parse 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 906 return ''; 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 */ 923 PmStatus: procedure expose(sGlobals) 924 parse 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 970 return 0; 574 971 575 972 … … 723 1120 724 1121 /** 1122 * Read all processes into global variable. 1123 */ 1124 dfProcessReadAll: procedure expose(sGlobals) 1125 parse 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 1202 return -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 */ 1210 dfProcessBlockId: procedure expose(sGlobals) 1211 parse 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 1222 return '0'; 1223 1224 /** 725 1225 * Gets a byte from the memory array aMem. 726 1226 * @param iIndex Byte offset into the array. … … 964 1464 965 1465 1466 1467 /** 1468 * Dump all processes. (debug more or less) 1469 */ 1470 procDumpAll: 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 1475 return 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 */ 1485 procFindByPidTid: procedure expose(sGlobals) 1486 parse 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 1491 return 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 */ 1500 procFindByPidTid: procedure expose(sGlobals) 1501 parse arg iSlot 1502 do i = 1 to aProc.0 1503 if (x2d(aProc.i.hxSlot) = iSlot) then 1504 return i; 1505 end 1506 return 0; 1507 1508 966 1509 /** 967 1510 * Novaluehandler.
Note:
See TracChangeset
for help on using the changeset viewer.