<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Software Generalist</title>
	<atom:link href="http://www.softwaregeneralist.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.softwaregeneralist.com</link>
	<description>Connecting Software with Engineering, Science, Philosophy and Religion</description>
	<pubDate>Fri, 19 Mar 2010 02:38:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Reading Notebook: 18-March-10</title>
		<link>http://www.softwaregeneralist.com/2010/03/19/reading-notebook-18-march-10/</link>
		<comments>http://www.softwaregeneralist.com/2010/03/19/reading-notebook-18-march-10/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 02:38:19 +0000</pubDate>
		<dc:creator>Dmitry Vostokov</dc:creator>
		
		<category><![CDATA[Notes on Windows Internals]]></category>

		<category><![CDATA[Reading Notebook]]></category>

		<guid isPermaLink="false">http://www.softwaregeneralist.com/?p=101</guid>
		<description><![CDATA[Comments in italics are mine and express my own views, thoughts and opinions
Windows Internals by M. Russinovich, D. Solomon and A. Ionescu:
Deferred ready and standby thread states (p. 400)
Gait waiting (p. 401)
Transition state as state with paged out kernel stack (p. 401) - flattening thread state transition diagram for ready state: 
deferred ready -&#62; ready &#60;-&#62; running
Thread state [...]]]></description>
			<content:encoded><![CDATA[<p><em>Comments in italics are mine and express my own views, thoughts and opinions</em></p>
<p style="text-align: left;"><strong><span>Windows Internals by M. <span>Russinovich</span>, D. Solomon and A. <span>Ionescu</span>:</span></strong></p>
<p style="text-align: left;">Deferred ready and standby thread states (p. 400)</p>
<p style="text-align: left;">Gait waiting (p. 401)</p>
<p style="text-align: left;">Transition state as state with paged out kernel stack (p. 401) - <em>flattening thread state transition diagram for ready state: </em></p>
<p style="text-align: left;"><em>deferred ready -&gt; ready &lt;-&gt; running</em></p>
<p style="text-align: left;"><span>Thread state counter in Performance Monitor (pp. 402 - 404)</span></p>
<p style="text-align: left;"><span>Per-processor ready queues and O(1) (pp. 404 - 405)</span></p>
<p style="text-align: left;"><span>PRCB (p. 404) - <em>rather a huge structure on x64 W2K8:</em></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>0: kd&gt; dt nt!_KPRCB<br />
   +0x000 MxCsr            : Uint4B<br />
   +0x004 Number           : Uint2B<br />
   +0x006 InterruptRequest : UChar<br />
   +0x007 IdleHalt         : UChar<br />
   +0x008 CurrentThread    : Ptr64 _KTHREAD<br />
   +0x010 NextThread       : Ptr64 _KTHREAD<br />
   +0x018 IdleThread       : Ptr64 _KTHREAD<br />
   +0x020 NestingLevel     : UChar<br />
   +0x021 Group            : UChar<br />
   +0x022 PrcbPad00        : [6] UChar<br />
   +0x028 RspBase          : Uint8B<br />
   +0x030 PrcbLock         : Uint8B<br />
   +0x038 SetMember        : Uint8B<br />
   +0x040 ProcessorState   : _KPROCESSOR_STATE<br />
   +0x5f0 CpuType          : Char<br />
   +0x5f1 CpuID            : Char<br />
   +0x5f2 CpuStep          : Uint2B<br />
   +0x5f2 CpuStepping      : UChar<br />
   +0x5f3 CpuModel         : UChar<br />
   +0x5f4 MHz              : Uint4B<br />
   +0x5f8 HalReserved      : [8] Uint8B<br />
   +0x638 MinorVersion     : Uint2B<br />
   +0x63a MajorVersion     : Uint2B<br />
   +0x63c BuildType        : UChar<br />
   +0x63d CpuVendor        : UChar<br />
   +0x63e CoresPerPhysicalProcessor : UChar<br />
   +0x63f LogicalProcessorsPerCore : UChar<br />
   +0x640 ApicMask         : Uint4B<br />
   +0x644 CFlushSize       : Uint4B<br />
   +0x648 AcpiReserved     : Ptr64 Void<br />
   +0x650 InitialApicId    : Uint4B<br />
   +0x654 Stride           : Uint4B<br />
   +0x658 PrcbPad01        : [3] Uint8B<br />
   +0x670 LockQueue        : [49] _KSPIN_LOCK_QUEUE<br />
   +0x980 PPLookasideList  : [16] _PP_LOOKASIDE_LIST<br />
   +0xa80 PPNPagedLookasideList : [32] _GENERAL_LOOKASIDE_POOL<br />
   +0x1680 PPPagedLookasideList : [32] _GENERAL_LOOKASIDE_POOL<br />
   +0x2280 PacketBarrier    : Uint8B<br />
<span style="color: blue;"><strong>   +0&#215;2288 DeferredReadyListHead : _SINGLE_LIST_ENTRY</strong></span><br />
   +0&#215;2290 MmPageFaultCount : Int4B<br />
   +0&#215;2294 MmCopyOnWriteCount : Int4B<br />
   +0&#215;2298 MmTransitionCount : Int4B<br />
   +0&#215;229c MmDemandZeroCount : Int4B<br />
   +0&#215;22a0 MmPageReadCount  : Int4B<br />
   +0&#215;22a4 MmPageReadIoCount : Int4B<br />
   +0&#215;22a8 MmDirtyPagesWriteCount : Int4B<br />
   +0&#215;22ac MmDirtyWriteIoCount : Int4B<br />
   +0&#215;22b0 MmMappedPagesWriteCount : Int4B<br />
   +0&#215;22b4 MmMappedWriteIoCount : Int4B<br />
   +0&#215;22b8 KeSystemCalls    : Uint4B<br />
   +0&#215;22bc KeContextSwitches : Uint4B<br />
   +0&#215;22c0 CcFastReadNoWait : Uint4B<br />
   +0&#215;22c4 CcFastReadWait   : Uint4B<br />
   +0&#215;22c8 CcFastReadNotPossible : Uint4B<br />
   +0&#215;22cc CcCopyReadNoWait : Uint4B<br />
   +0&#215;22d0 CcCopyReadWait   : Uint4B<br />
   +0&#215;22d4 CcCopyReadNoWaitMiss : Uint4B<br />
   +0&#215;22d8 LookasideIrpFloat : Int4B<br />
   +0&#215;22dc IoReadOperationCount : Int4B<br />
   +0&#215;22e0 IoWriteOperationCount : Int4B<br />
   +0&#215;22e4 IoOtherOperationCount : Int4B<br />
   +0&#215;22e8 IoReadTransferCount : _LARGE_INTEGER<br />
   +0&#215;22f0 IoWriteTransferCount : _LARGE_INTEGER<br />
   +0&#215;22f8 IoOtherTransferCount : _LARGE_INTEGER<br />
   +0&#215;2300 TargetSet        : Uint8B<br />
   +0&#215;2308 IpiFrozen        : Uint4B<br />
   +0&#215;230c PrcbPad3         : [116] UChar<br />
   +0&#215;2380 RequestMailbox   : [64] _REQUEST_MAILBOX<br />
   +0&#215;3380 SenderSummary    : Uint8B<br />
   +0&#215;3388 PrcbPad4         : [120] UChar<br />
   +0&#215;3400 DpcData          : [2] _KDPC_DATA<br />
   +0&#215;3440 DpcStack         : Ptr64 Void<br />
   +0&#215;3448 SparePtr0        : Ptr64 Void<br />
   +0&#215;3450 MaximumDpcQueueDepth : Int4B<br />
   +0&#215;3454 DpcRequestRate   : Uint4B<br />
   +0&#215;3458 MinimumDpcRate   : Uint4B<br />
   +0&#215;345c DpcInterruptRequested : UChar<br />
   +0&#215;345d DpcThreadRequested : UChar<br />
   +0&#215;345e DpcRoutineActive : UChar<br />
   +0&#215;345f DpcThreadActive  : UChar<br />
   +0&#215;3460 TimerHand        : Uint8B<br />
   +0&#215;3460 TimerRequest     : Uint8B<br />
   +0&#215;3468 TickOffset       : Int4B<br />
   +0&#215;346c MasterOffset     : Int4B<br />
   +0&#215;3470 DpcLastCount     : Uint4B<br />
   +0&#215;3474 ThreadDpcEnable  : UChar<br />
   +0&#215;3475 QuantumEnd       : UChar<br />
   +0&#215;3476 PrcbPad50        : UChar<br />
   +0&#215;3477 IdleSchedule     : UChar<br />
   +0&#215;3478 DpcSetEventRequest : Int4B<br />
   +0&#215;347c KeExceptionDispatchCount : Uint4B<br />
   +0&#215;3480 DpcEvent         : _KEVENT<br />
   +0&#215;3498 PrcbPad51        : Ptr64 Void<br />
   +0&#215;34a0 CallDpc          : _KDPC<br />
   +0&#215;34e0 ClockKeepAlive   : Int4B<br />
   +0&#215;34e4 ClockCheckSlot   : UChar<br />
   +0&#215;34e5 ClockPollCycle   : UChar<br />
   +0&#215;34e6 PrcbPad6         : [2] UChar<br />
   +0&#215;34e8 DpcWatchdogPeriod : Int4B<br />
   +0&#215;34ec DpcWatchdogCount : Int4B<br />
   +0&#215;34f0 PrcbPad70        : [2] Uint8B<br />
   +0&#215;3500 WaitListHead     : _LIST_ENTRY<br />
   +0&#215;3510 WaitLock         : Uint8B<br />
<span style="color: blue;"><strong>   +0&#215;3518 ReadySummary     : Uint4B</strong></span><br />
   +0&#215;351c QueueIndex       : Uint4B<br />
   +0&#215;3520 PrcbPad71        : [12] Uint8B<br />
<span style="color: blue;"><strong>   +0&#215;3580 DispatcherReadyListHead : [32] _LIST_ENTRY</strong></span><br />
   +0&#215;3780 InterruptCount   : Uint4B<br />
   +0&#215;3784 KernelTime       : Uint4B<br />
   +0&#215;3788 UserTime         : Uint4B<br />
   +0&#215;378c DpcTime          : Uint4B<br />
   +0&#215;3790 InterruptTime    : Uint4B<br />
   +0&#215;3794 AdjustDpcThreshold : Uint4B<br />
   +0&#215;3798 SkipTick         : UChar<br />
   +0&#215;3799 DebuggerSavedIRQL : UChar<br />
   +0&#215;379a PollSlot         : UChar<br />
   +0&#215;379b PrcbPad80        : [5] UChar<br />
   +0&#215;37a0 DpcTimeCount     : Uint4B<br />
   +0&#215;37a4 DpcTimeLimit     : Uint4B<br />
   +0&#215;37a8 PeriodicCount    : Uint4B<br />
   +0&#215;37ac PeriodicBias     : Uint4B<br />
   +0&#215;37b0 PrcbPad81        : [2] Uint8B<br />
   +0&#215;37c0 ParentNode       : Ptr64 _KNODE<br />
   +0&#215;37c8 MultiThreadProcessorSet : Uint8B<br />
   +0&#215;37d0 MultiThreadSetMaster : Ptr64 _KPRCB<br />
   +0&#215;37d8 StartCycles      : Uint8B<br />
   +0&#215;37e0 MmSpinLockOrdering : Int4B<br />
   +0&#215;37e4 PageColor        : Uint4B<br />
   +0&#215;37e8 NodeColor        : Uint4B<br />
   +0&#215;37ec NodeShiftedColor : Uint4B<br />
   +0&#215;37f0 SecondaryColorMask : Uint4B<br />
   +0&#215;37f4 Sleeping         : Int4B<br />
   +0&#215;37f8 CycleTime        : Uint8B<br />
   +0&#215;3800 CcFastMdlReadNoWait : Uint4B<br />
   +0&#215;3804 CcFastMdlReadWait : Uint4B<br />
   +0&#215;3808 CcFastMdlReadNotPossible : Uint4B<br />
   +0&#215;380c CcMapDataNoWait  : Uint4B<br />
   +0&#215;3810 CcMapDataWait    : Uint4B<br />
   +0&#215;3814 CcPinMappedDataCount : Uint4B<br />
   +0&#215;3818 CcPinReadNoWait  : Uint4B<br />
   +0&#215;381c CcPinReadWait    : Uint4B<br />
   +0&#215;3820 CcMdlReadNoWait  : Uint4B<br />
   +0&#215;3824 CcMdlReadWait    : Uint4B<br />
   +0&#215;3828 CcLazyWriteHotSpots : Uint4B<br />
   +0&#215;382c CcLazyWriteIos   : Uint4B<br />
   +0&#215;3830 CcLazyWritePages : Uint4B<br />
   +0&#215;3834 CcDataFlushes    : Uint4B<br />
   +0&#215;3838 CcDataPages      : Uint4B<br />
   +0&#215;383c CcLostDelayedWrites : Uint4B<br />
   +0&#215;3840 CcFastReadResourceMiss : Uint4B<br />
   +0&#215;3844 CcCopyReadWaitMiss : Uint4B<br />
   +0&#215;3848 CcFastMdlReadResourceMiss : Uint4B<br />
   +0&#215;384c CcMapDataNoWaitMiss : Uint4B<br />
   +0&#215;3850 CcMapDataWaitMiss : Uint4B<br />
   +0&#215;3854 CcPinReadNoWaitMiss : Uint4B<br />
   +0&#215;3858 CcPinReadWaitMiss : Uint4B<br />
   +0&#215;385c CcMdlReadNoWaitMiss : Uint4B<br />
   +0&#215;3860 CcMdlReadWaitMiss : Uint4B<br />
   +0&#215;3864 CcReadAheadIos   : Uint4B<br />
   +0&#215;3868 MmCacheTransitionCount : Int4B<br />
   +0&#215;386c MmCacheReadCount : Int4B<br />
   +0&#215;3870 MmCacheIoCount   : Int4B<br />
   +0&#215;3874 PrcbPad91        : [3] Uint4B<br />
   +0&#215;3880 PowerState       : _PROCESSOR_POWER_STATE<br />
   +0&#215;3998 KeAlignmentFixupCount : Uint4B<br />
   +0&#215;399c VendorString     : [13] UChar<br />
   +0&#215;39a9 PrcbPad10        : [3] UChar<br />
   +0&#215;39ac FeatureBits      : Uint4B<br />
   +0&#215;39b0 UpdateSignature  : _LARGE_INTEGER<br />
   +0&#215;39b8 DpcWatchdogDpc   : _KDPC<br />
   +0&#215;39f8 DpcWatchdogTimer : _KTIMER<br />
   +0&#215;3a38 Cache            : [5] _CACHE_DESCRIPTOR<br />
   +0&#215;3a74 CacheCount       : Uint4B<br />
   +0&#215;3a78 CachedCommit     : Uint4B<br />
   +0&#215;3a7c CachedResidentAvailable : Uint4B<br />
   +0&#215;3a80 HyperPte         : Ptr64 Void<br />
   +0&#215;3a88 WheaInfo         : Ptr64 Void<br />
   +0&#215;3a90 EtwSupport       : Ptr64 Void<br />
   +0&#215;3aa0 InterruptObjectPool : _SLIST_HEADER<br />
   +0&#215;3ab0 HypercallPageList : _SLIST_HEADER<br />
   +0&#215;3ac0 HypercallPageVirtual : Ptr64 Void<br />
   +0&#215;3ac8 VirtualApicAssist : Ptr64 Void<br />
   +0&#215;3ad0 StatisticsPage   : Ptr64 Uint8B<br />
   +0&#215;3ad8 RateControl      : Ptr64 Void<br />
   +0&#215;3ae0 CacheProcessorMask : [5] Uint8B<br />
   +0&#215;3b08 PackageProcessorSet : Uint8B<br />
   +0&#215;3b10 CoreProcessorSet : Uint8B</code></span></span></p>
<p style="text-align: left;"><span>Changes thread quantum accounting in Vista, quantum targets, partial quantum decay (pp. 406 - 407)</span></p>
<p style="text-align: left;"><span>The mystery of huge number in KiCyclesPerClockQuantum (p. 408) - <em>here is an output on my PC:</em></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>0: kd&gt; dd KiCyclesPerClockQuantum l1<br />
fffff800`01a45170  008e58db</code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>0: kd&gt; !cpuinfo<br />
CP  F/M/S Manufacturer  MHz PRCB Signature    MSR 8B Signature Features<br />
 0  6,15,2 GenuineIntel 1794 0000005600000000                   20193ffe<br />
 1  6,15,2 GenuineIntel 1794 0000005600000000                   20193ffe<br />
                      Cached Update Signature 0000005a00000000<br />
                     Initial Update Signature 0000005600000000</code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>C:\&gt;C:\DL\Clockres.exe</code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>ClockRes v2.0 - View the system clock resolution<br />
Copyright (C) 2009 Mark Russinovich<br />
SysInternals - <a href="http://www.sysinternals.com">www.sysinternals.com</a></code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>Maximum timer interval: 15.600 ms<br />
Minimum timer interval: 0.500 ms<br />
Current timer interval: 1.000 ms</code></span></span></p>
<p style="text-align: left;"><span>HKLM\S\CCS\C\PriorityControl\Win32PrioritySeparation vs. PsPrioritySeperation - <em>looks like a misprint that needs fixing in the next version of Windows <img src='http://www.softwaregeneralist.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> Why it was a</em> deliberate misspelling (p. 411) <em>we can only guess&#8230;</em></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>0: kd&gt; dd PsPrioritySeperation l1<br />
fffff800`01a45228  00000002<br />
</code></span></span></p>
<p style="text-align: left;"><span>- <span>Dmitry</span> <span>Vostokov</span> @ </span><a href="http://www.softwaregeneralist.com/"><span><span>SoftwareGeneralist</span>.com</span></a> -</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwaregeneralist.com/2010/03/19/reading-notebook-18-march-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading Notebook: 15-March-10</title>
		<link>http://www.softwaregeneralist.com/2010/03/16/reading-notebook-15-march-10/</link>
		<comments>http://www.softwaregeneralist.com/2010/03/16/reading-notebook-15-march-10/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 10:31:46 +0000</pubDate>
		<dc:creator>Dmitry Vostokov</dc:creator>
		
		<category><![CDATA[Notes on Windows Internals]]></category>

		<category><![CDATA[Reading Notebook]]></category>

		<guid isPermaLink="false">http://www.softwaregeneralist.com/?p=100</guid>
		<description><![CDATA[Comments in italics are mine and express my own views, thoughts and opinions
Windows Internals by M. Russinovich, D. Solomon and A. Ionescu:
Limiting high-priority ready threads by a processor affinity (p. 391)
Thread dispatch reasons: ready, leaves running state, priority change, processor affinity change (p. 392) 
Thread vs. process scheduling granularity (pp. 392 - 393)
Thread priority level 0 is [...]]]></description>
			<content:encoded><![CDATA[<p><em>Comments in italics are mine and express my own views, thoughts and opinions</em></p>
<p style="text-align: left;"><strong><span>Windows Internals by M. <span>Russinovich</span>, D. Solomon and A. <span>Ionescu</span>:</span></strong></p>
<p style="text-align: left;">Limiting high-priority ready threads by a processor affinity (p. 391)</p>
<p style="text-align: left;">Thread dispatch reasons: ready, leaves running state, priority change, processor affinity change (p. 392) </p>
<p style="text-align: left;"><span>Thread vs. process scheduling granularity (pp. 392 - 393)</span></p>
<p style="text-align: left;"><span>Thread priority level 0 is reserved for zero page thread (p. 393)</span></p>
<p style="text-align: left;"><span>2 pespectives on thread priority levels (pp. 393 - 394)</span></p>
<p style="text-align: left;">Changing CPU-intensive process base priority instead of priority of individual threads (p. 395)</p>
<p style="text-align: left;"><span>Increased based priority for special processes (p. 395) - <em>here is a comparison of base priorities between lsm.exe and smss.exe from x64 W2K8:</em></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>0: kd&gt; !process fffffa80047ffc10<br />
PROCESS fffffa80047ffc10<br />
    SessionId: 0  Cid: 0294    Peb: 7fffffd6000  ParentCid: 0238<br />
    DirBase: b1c4e000  ObjectTable: fffff88007f05cd0  HandleCount: 173.<br />
    Image: lsm.exe<br />
    VadRoot fffffa80046dd720 Vads 68 Clone 0 Private 462. Modified 0. Locked 0.<br />
    DeviceMap fffff88000007310<br />
    Token                             fffff88007f376f0<br />
    ElapsedTime                       00:04:17.552<br />
    UserTime                          00:00:00.015<br />
    KernelTime                        00:00:00.000<br />
    QuotaPoolUsage[PagedPool]         69000<br />
    QuotaPoolUsage[NonPagedPool]      7072<br />
    Working Set Sizes (now,min,max)  (1314, 50, 345) (5256KB, 200KB, 1380KB)<br />
    PeakWorkingSetSize                1318<br />
    VirtualSize                       36 Mb<br />
    PeakVirtualSize                   38 Mb<br />
    PageFaultCount                    1375<br />
    MemoryPriority                    BACKGROUND<br />
<span style="color: blue;">    BasePriority                      8</span><br />
    CommitCharge                      756</code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>0: kd&gt; !process fffffa80046d9040<br />
PROCESS fffffa80046d9040<br />
    SessionId: none  Cid: 019c    Peb: 7fffffdf000  ParentCid: 0004<br />
    DirBase: bccd5000  ObjectTable: fffff880005f45b0  HandleCount:  33.<br />
    Image: smss.exe<br />
    VadRoot fffffa80046d97e0 Vads 19 Clone 0 Private 96. Modified 24. Locked 0.<br />
    DeviceMap fffff88000007310<br />
    Token                             fffff88000964af0<br />
    ElapsedTime                       00:04:40.343<br />
    UserTime                          00:00:00.000<br />
    KernelTime                        00:00:00.000<br />
    QuotaPoolUsage[PagedPool]         10392<br />
    QuotaPoolUsage[NonPagedPool]      1728<br />
    Working Set Sizes (now,min,max)  (254, 50, 345) (1016KB, 200KB, 1380KB)<br />
    PeakWorkingSetSize                254<br />
    VirtualSize                       6 Mb<br />
    PeakVirtualSize                   16 Mb<br />
    PageFaultCount                    458<br />
    MemoryPriority                    BACKGROUND<br />
<span style="color: magenta;">    BasePriority                      11</span><br />
    CommitCharge                      127</code></span></span></p>
<p style="text-align: left;"><span>Sleep(0) to relinquish the rest of quantum (p. 396) </span></p>
<p style="text-align: left;"><span>Realtime Notepad (pp. 397 - 398) - <em>I&#8217;m often asked why it doesn&#8217;t affect performance? This is because most threads in a system are waiting and notepad is waiting for window messages to process like keyboard and mouse. It is more noticeable when a realtime thread starts looping - it becomes scheduled every time</em></span> </p>
<p><span>WSRM (Windows System Resource Manager) (pp. 398 - 399) - <em>Looks good to prevent CPU spikes and memory leaks to come out of control</em></span></p>
<p style="text-align: left;"><span>Thread priorities and IRQL (pp. 399 - 400) - <em>in another words these concepts are orthogonal (independent from each other)</em></span></p>
<p style="text-align: left;"><span>- <span>Dmitry</span> <span>Vostokov</span> @ </span><a href="http://www.softwaregeneralist.com/"><span><span>SoftwareGeneralist</span>.com</span></a> -</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwaregeneralist.com/2010/03/16/reading-notebook-15-march-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading Notebook: 11-March-10</title>
		<link>http://www.softwaregeneralist.com/2010/03/11/reading-notebook-11-march-10/</link>
		<comments>http://www.softwaregeneralist.com/2010/03/11/reading-notebook-11-march-10/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 17:11:58 +0000</pubDate>
		<dc:creator>Dmitry Vostokov</dc:creator>
		
		<category><![CDATA[Notes on Windows Internals]]></category>

		<category><![CDATA[Reading Notebook]]></category>

		<guid isPermaLink="false">http://www.softwaregeneralist.com/?p=99</guid>
		<description><![CDATA[Comments in italics are mine and express my own views, thoughts and opinions
Windows Internals by M. Russinovich, D. Solomon and A. Ionescu:
Clock cycle counter for measuring CPU activity  (p. 382)
Process Explorer usage to inspect hung threads (p. 383) - useful for coupled processes (http://www.dumpanalysis.org/blog/index.php/2007/09/26/crash-dump-analysis-patterns-part-28/) and could be great with simultaneous WinDbg session to inspect wait chains (http://www.dumpanalysis.org/blog/index.php/2009/02/17/wait-chain-patterns/)
Process Explorer [...]]]></description>
			<content:encoded><![CDATA[<p><em>Comments in italics are mine and express my own views, thoughts and opinions</em></p>
<p style="text-align: left;"><strong><span>Windows Internals by M. <span>Russinovich</span>, D. Solomon and A. <span>Ionescu</span>:</span></strong></p>
<p style="text-align: left;">Clock cycle counter for measuring CPU activity  (p. 382)</p>
<p style="text-align: left;"><span>Process Explorer usage to inspect hung threads (p. 383) - <em>useful for coupled processes (</em><a href="http://www.dumpanalysis.org/blog/index.php/2007/09/26/crash-dump-analysis-patterns-part-28/"><em>http://www.dumpanalysis.org/blog/index.php/2007/09/26/crash-dump-analysis-patterns-part-28/</em></a><em>) and could be great with simultaneous WinDbg session to inspect wait chains (</em><a href="http://www.dumpanalysis.org/blog/index.php/2009/02/17/wait-chain-patterns/"><em>http://www.dumpanalysis.org/blog/index.php/2009/02/17/wait-chain-patterns/</em></a><em>)</em></span></p>
<p style="text-align: left;"><span>Process Explorer shows both thread and WOW64 thread stacks on x64 (p. 384)</span></p>
<p style="text-align: left;"><span>Thread stack and context query limitations for protected processes (pp. 384 - 386)</span></p>
<p style="text-align: left;">Thread pool mechanism was moved into kernel space in Vista (p. 387)</p>
<p style="text-align: left;"><span>TpWorkerFactory and I/O completion ports and KQUEUE (pp. 387 - 388) - <em>see also a &#8220;brief guide&#8221; to I/O completion ports: </em><a href="http://www.dumpanalysis.org/blog/index.php/2007/11/27/understanding-io-completion-ports/"><em>http://www.dumpanalysis.org/blog/index.php/2007/11/27/understanding-io-completion-ports/</em></a> </span></p>
<p style="text-align: left;">The mystery of ntdll!TppWorkerThread in stack traces (pp. 389 - 390)</p>
<p style="text-align: left;"><span>- <span>Dmitry</span> <span>Vostokov</span> @ </span><a href="http://www.softwaregeneralist.com/"><span><span>SoftwareGeneralist</span>.com</span></a> -</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwaregeneralist.com/2010/03/11/reading-notebook-11-march-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading Notebook: 10-March-10</title>
		<link>http://www.softwaregeneralist.com/2010/03/11/reading-notebook-10-march-10/</link>
		<comments>http://www.softwaregeneralist.com/2010/03/11/reading-notebook-10-march-10/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 00:29:06 +0000</pubDate>
		<dc:creator>Dmitry Vostokov</dc:creator>
		
		<category><![CDATA[Notes on Windows Internals]]></category>

		<category><![CDATA[Reading Notebook]]></category>

		<guid isPermaLink="false">http://www.softwaregeneralist.com/?p=98</guid>
		<description><![CDATA[Comments in italics are mine and express my own views, thoughts and opinions
Windows Internals by M. Russinovich, D. Solomon and A. Ionescu:
W32THREAD (p. 371) - One candidate in _ETHREAD that points to it is Tcb.Win32Thread. One interesting code I found on how to extract window message queues from it: http://www.cc.gatech.edu/~brendan/volatility/dl/threadqueues.py. _W32THREAD structure on x64 W2K8 (we also see that is [...]]]></description>
			<content:encoded><![CDATA[<p><em>Comments in italics are mine and express my own views, thoughts and opinions</em></p>
<p style="text-align: left;"><strong><span>Windows Internals by M. <span>Russinovich</span>, D. Solomon and A. <span>Ionescu</span>:</span></strong></p>
<p style="text-align: left;">W32THREAD (p. 371) - <em>One candidate in _ETHREAD that points to it is Tcb.Win32Thread. <span><em>One interesting code I found on how to extract window message queues from it: </em><a href="http://www.cc.gatech.edu/~brendan/volatility/dl/threadqueues.py"><em>http://www.cc.gatech.edu/~brendan/volatility/dl/threadqueues.py</em></a>. </span>_W32THREAD structure on x64 W2K8 (we also see that is points to _ETHREAD):</em></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; dt _W32THREAD<br />
win32k!_W32THREAD<br />
   +0x000 pEThread         : Ptr64 _ETHREAD<br />
   +0x008 RefCount         : Uint4B<br />
   +0x010 ptlW32           : Ptr64 _TL<br />
   +0x018 pgdiDcattr       : Ptr64 Void<br />
   +0x020 pgdiBrushAttr    : Ptr64 Void<br />
   +0x028 pUMPDObjs        : Ptr64 Void<br />
   +0x030 pUMPDHeap        : Ptr64 Void<br />
   +0x038 pUMPDObj         : Ptr64 Void<br />
   +0x040 pProxyPort       : Ptr64 Void<br />
   +0x048 pClientID        : Ptr64 Void<br />
   +0x050 GdiTmpTgoList    : _LIST_ENTRY</code></span></p>
<p style="text-align: left;"><span>!thread output fields (p. 376) - <em>Stack Base and Limit fields can be useful to dump raw stack data via dps command to see execution residue or when reconstructing stack trace, see, for example, this pattern: <a href="http://www.dumpanalysis.org/blog/index.php/2009/10/23/crash-dump-analysis-patterns-part-88/">http://www.dumpanalysis.org/blog/index.php/2009/10/23/crash-dump-analysis-patterns-part-88/</a></em></span></p>
<p style="text-align: left;"><span>tlist utility (p. 377)</span></p>
<p style="text-align: left;"><span>Thread creation calls (pp. 380 - 381) - a<em> condensed view of top level function calls on x64 W2K8:</em></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>0: kd&gt; uf /c CreateThread<br />
kernel32!CreateThread (00000000`7731c1c0)<br />
  kernel32!CreateThread+0x28 (00000000`7731c1e8):<br />
    call to kernel32!CreateRemoteThread (00000000`7731c200)</code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>0: kd&gt; uf /c CreateRemoteThread<br />
Flow analysis was incomplete, some code may be missing<br />
kernel32!CreateRemoteThread (00000000`7731c200)<br />
  kernel32!CreateRemoteThread+0x134 (00000000`7731c334):<br />
<strong>    call to ntdll!NtCreateThreadEx (00000000`77477790)<br />
</strong>  kernel32!CreateRemoteThread+0&#215;166 (00000000`7731c366):<br />
    call to ntdll!RtlAllocateActivationContextStack (00000000`77456900)<br />
  kernel32!CreateRemoteThread+0&#215;1b4 (00000000`7731c3b4):<br />
    call to ntdll!RtlQueryInformationActivationContext (00000000`77456b20)<br />
  kernel32!CreateRemoteThread+0&#215;241 (00000000`7731c441):<br />
<strong>    call to ntdll!CsrClientCallServer (00000000`7747a460)<br />
</strong>  kernel32!CreateRemoteThread+0&#215;281 (00000000`7731c47d):<br />
<strong>    call to ntdll!ZwResumeThread (00000000`77477230)<br />
</strong>  kernel32!CreateRemoteThread+0&#215;38b (00000000`7731c4ae):<br />
    call to kernel32!_security_check_cookie (00000000`7732c200)</code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>0: kd&gt; uf /c NtCreateThreadEx<br />
ntdll!NtCreateThreadEx (00000000`77477790)<br />
    no calls found</code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>0: kd&gt; uf NtCreateThreadEx<br />
ntdll!NtCreateThreadEx:<br />
00000000`77477790 4c8bd1          mov     r10,rcx<br />
00000000`77477793 b8a5000000      mov     eax,0A5h<br />
<strong>00000000`77477798 0f05            syscall<br />
</strong>00000000`7747779a c3              ret</code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>0: kd&gt; uf /c nt!NtCreateThreadEx<br />
nt!NtCreateThreadEx (fffff800`01af60fc)<br />
  nt!NtCreateThreadEx+0x3d (fffff800`01af6139):<br />
    call to nt!memset (fffff800`0187a4d0)<br />
  nt!NtCreateThreadEx+0x5b (fffff800`01af6157):<br />
    call to nt!memset (fffff800`0187a4d0)<br />
  nt!NtCreateThreadEx+0x99 (fffff800`01af6195):<br />
    call to nt!memset (fffff800`0187a4d0)<br />
  nt!NtCreateThreadEx+0xc8 (fffff800`01af61c4):<br />
    call to nt!PspBuildCreateProcessContext (fffff800`01af5204)<br />
  nt!NtCreateThreadEx+0x1e1 (fffff800`01af62dd):<br />
<strong>    call to nt!PspCreateThread (fffff800`01af5d40)<br />
</strong>  nt!NtCreateThreadEx+0&#215;1f0 (fffff800`01af62ec):<br />
    call to nt!PspDeleteCreateProcessContext (fffff800`01af68f0)</code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>0: kd&gt; uf /c nt!PspCreateThread<br />
nt!PspCreateThread (fffff800`01af5d40)<br />
  nt!PspCreateThread+0x102 (fffff800`01af5e42):<br />
    call to nt!ObReferenceObjectByHandle (fffff800`01ad8110)<br />
  nt!PspCreateThread+0x15b (fffff800`01af5e9b):<br />
    call to nt!ObfReferenceObject (fffff800`01883250)<br />
  nt!PspCreateThread+0x22f (fffff800`01af5f6f):<br />
    call to nt!PspAllocateThread (fffff800`01af6338)<br />
  nt!PspCreateThread+0x243 (fffff800`01af5f83):<br />
    call to nt!ObfDereferenceObject (fffff800`0187cde0)<br />
  nt!PspCreateThread+0x2a6 (fffff800`01af5fe6):<br />
    call to nt!PspInsertThread (fffff800`01af4c10)<br />
  nt!PspCreateThread+0x318 (fffff800`01af6058):<br />
    call to nt!ObfDereferenceObject (fffff800`0187cde0)<br />
  nt!PspCreateThread+0x32a (fffff800`01af606a):<br />
    call to nt!_security_check_cookie (fffff800`01895e50)<br />
  nt!PspCreateThread+0x36a (fffff800`01af60aa):<br />
    call to nt!ObfReferenceObject (fffff800`01883250)<br />
  nt!PspCreateThread+0x3a2 (fffff800`01af60e2):<br />
    call to nt!ExfAcquireRundownProtection (fffff800`0184f66c)<br />
  nt! ?? ::NNGAKEGL::`string'+0x2816e (fffff800`01b3628e):<br />
    call to nt!KiCheckForKernelApcDelivery (fffff800`0183c754)<br />
  nt! ?? ::NNGAKEGL::`string'+0x281ad (fffff800`01b362ca):<br />
    call to nt!ExfReleaseRundownProtection (fffff800`0184f690)<br />
  nt! ?? ::NNGAKEGL::`string'+0x281ce (fffff800`01b362eb):<br />
    call to nt!KiCheckForKernelApcDelivery (fffff800`0183c754)<br />
  nt! ?? ::NNGAKEGL::`string'+0x281d8 (fffff800`01b362f5):<br />
    call to nt!ObfDereferenceObject (fffff800`0187cde0)<br />
  nt! ?? ::NNGAKEGL::`string'+0x281e7 (fffff800`01b36304):<br />
    call to nt!ExfReleaseRundownProtection (fffff800`0184f690)<br />
  nt! ?? ::NNGAKEGL::`string'+0x281ff (fffff800`01b3631c):<br />
    call to nt!KiCheckForKernelApcDelivery (fffff800`0183c754)<br />
  nt! ?? ::NNGAKEGL::`string'+0x2821a (fffff800`01b36337):<br />
    call to nt!PspTerminateThreadByPointer (fffff800`01ad30dc)</code></span></span></p>
<p style="text-align: left;"><span>- <span>Dmitry</span> <span>Vostokov</span> @ </span><a href="http://www.softwaregeneralist.com/"><span><span>SoftwareGeneralist</span>.com</span></a> -</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwaregeneralist.com/2010/03/11/reading-notebook-10-march-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading Notebook: 01-March-10</title>
		<link>http://www.softwaregeneralist.com/2010/03/02/reading-notebook-01-march-10/</link>
		<comments>http://www.softwaregeneralist.com/2010/03/02/reading-notebook-01-march-10/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 00:51:52 +0000</pubDate>
		<dc:creator>Dmitry Vostokov</dc:creator>
		
		<category><![CDATA[Notes on Windows Internals]]></category>

		<category><![CDATA[Reading Notebook]]></category>

		<guid isPermaLink="false">http://www.softwaregeneralist.com/?p=97</guid>
		<description><![CDATA[Comments in italics are mine and express my own views, thoughts and opinions
Windows Internals by M. Russinovich, D. Solomon and A. Ionescu:
NtCreateProcess (pp. 349 - 351) -  a condensed view of top level function calls on x64 W2K8:
0: kd&#62; uf /c nt!NtCreateProcess
nt!NtCreateProcess (fffff800`01c51770)
  nt!NtCreateProcess+0x64 (fffff800`01c517d4):
    call to nt!NtCreateProcessEx (fffff800`01c516e0)
0: kd&#62; uf /c nt!NtCreateProcessEx
nt!NtCreateProcessEx (fffff800`01c516e0)
  nt!NtCreateProcessEx+0x7d (fffff800`01c5175d):
    call [...]]]></description>
			<content:encoded><![CDATA[<p><em>Comments in italics are mine and express my own views, thoughts and opinions</em></p>
<p style="text-align: left;"><strong><span>Windows Internals by M. <span>Russinovich</span>, D. Solomon and A. <span>Ionescu</span>:</span></strong></p>
<p style="text-align: left;">NtCreateProcess (pp. 349 - 351) -  a<em> condensed view of top level function calls on x64 W2K8:</em></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c nt!NtCreateProcess<br />
nt!NtCreateProcess (fffff800`01c51770)<br />
  nt!NtCreateProcess+0x64 (fffff800`01c517d4):<br />
    call to nt!NtCreateProcessEx (fffff800`01c516e0)</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c nt!NtCreateProcessEx<br />
nt!NtCreateProcessEx (fffff800`01c516e0)<br />
  nt!NtCreateProcessEx+0x7d (fffff800`01c5175d):<br />
    call to nt!PspCreateProcess (fffff800`01c51410)</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c nt!PspCreateProcess<br />
nt!PspCreateProcess (fffff800`01c51410)<br />
  nt!PspCreateProcess+0xd0 (fffff800`01c514e0):<br />
    call to nt!ObReferenceObjectByHandle (fffff800`01ad8110)<br />
  nt!PspCreateProcess+0xff (fffff800`01c5150f):<br />
    call to nt!ObfDereferenceObject (fffff800`0187cde0)<br />
  nt!PspCreateProcess+0x146 (fffff800`01c51556):<br />
    call to nt!ObReferenceObjectByHandle (fffff800`01ad8110)<br />
  nt!PspCreateProcess+0x1a6 (fffff800`01c515b6):<br />
    call to nt!PspAllocateProcess (fffff800`01aac690)<br />
  nt!PspCreateProcess+0x202 (fffff800`01c51612):<br />
    call to nt!PspInsertProcess (fffff800`01aa6520)<br />
  nt!PspCreateProcess+0x21b (fffff800`01c5162b):<br />
    call to nt!PspDoHandleSweepSingle (fffff800`01b92770)<br />
  nt!PspCreateProcess+0x26f (fffff800`01c5167f):<br />
    call to nt!SeDeleteAccessState (fffff800`01b02f8c)<br />
  nt!PspCreateProcess+0x27a (fffff800`01c5168a):<br />
    call to nt!ObfDereferenceObject (fffff800`0187cde0)<br />
  nt!PspCreateProcess+0x287 (fffff800`01c51697):<br />
    call to nt!ObfDereferenceObject (fffff800`0187cde0)<br />
  nt!PspCreateProcess+0x294 (fffff800`01c516a4):<br />
    call to nt!ObfDereferenceObject (fffff800`0187cde0)<br />
  nt!PspCreateProcess+0x2a7 (fffff800`01c516b7):<br />
    call to nt!_security_check_cookie (fffff800`01895e50)</code></span></p>
<p style="text-align: left;">NtCreateUserProcess (pp. 351 - 360) - <em>a condensed view of top level function calls on x64 W2K8:</em></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c nt!NtCreateUserProcess<br />
nt!NtCreateUserProcess (fffff800`01ab2238)<br />
  nt!NtCreateUserProcess+0x97 (fffff800`01ab22cf):<br />
    call to nt!memset (fffff800`0187a4d0)<br />
  nt!NtCreateUserProcess+0xb4 (fffff800`01ab22ec):<br />
    call to nt!memset (fffff800`0187a4d0)<br />
  nt!NtCreateUserProcess+0x184 (fffff800`01ab23bc):<br />
    call to nt!ExRaiseDatatypeMisalignment (fffff800`01bddd20)<br />
  nt!NtCreateUserProcess+0x1c2 (fffff800`01ab23fb):<br />
    call to nt!memset (fffff800`0187a4d0)<br />
  nt!NtCreateUserProcess+0x1dd (fffff800`01ab2416):<br />
    call to nt!PspBuildCreateProcessContext (fffff800`01af5204)<br />
  nt!NtCreateUserProcess+0x207 (fffff800`01ab2440):<br />
    call to nt!PspCaptureCreateInfo (fffff800`01aad390)<br />
  nt!NtCreateUserProcess+0x2d1 (fffff800`01ab250a):<br />
    call to nt!ZwOpenFile (fffff800`01873480)<br />
  nt!NtCreateUserProcess+0x311 (fffff800`01ab254a):<br />
    call to nt!ObReferenceObjectByHandle (fffff800`01ad8110)<br />
  nt!NtCreateUserProcess+0x378 (fffff800`01ab25b1):<br />
    call to nt!ZwCreateSection (fffff800`01873760)<br />
  nt!NtCreateUserProcess+0x3af (fffff800`01ab25e8):<br />
    call to nt!ObReferenceObjectByHandle (fffff800`01ad8110)<br />
  nt!NtCreateUserProcess+0x412 (fffff800`01ab264b):<br />
    call to nt!PspCaptureProcessParameters (fffff800`01aae128)<br />
  nt!NtCreateUserProcess+0x483 (fffff800`01ab26bc):<br />
    call to nt!PspAllocateProcess (fffff800`01aac690)<br />
  nt!NtCreateUserProcess+0x546 (fffff800`01ab277f):<br />
    call to nt!ObfReferenceObject (fffff800`01883250)<br />
  nt!NtCreateUserProcess+0x630 (fffff800`01ab2869):<br />
    call to nt!PspAllocateThread (fffff800`01af6338)<br />
  nt!NtCreateUserProcess+0x69f (fffff800`01ab28d8):<br />
    call to nt!PspInsertProcess (fffff800`01aa6520)<br />
  nt!NtCreateUserProcess+0x70e (fffff800`01ab2947):<br />
    call to nt!PspInsertThread (fffff800`01af4c10)<br />
  nt!NtCreateUserProcess+0x74f (fffff800`01ab2988):<br />
    call to nt!PspCreateObjectHandle (fffff800`01b01e10)<br />
  nt!NtCreateUserProcess+0x775 (fffff800`01ab29ae):<br />
    call to nt!memmove (fffff800`0186fce0)<br />
  nt!NtCreateUserProcess+0x7ca (fffff800`01ab2a03):<br />
    call to nt!PspUpdateCreateInfo (fffff800`01aadc9c)<br />
  nt!NtCreateUserProcess+0x7d9 (fffff800`01ab2a12):<br />
    call to nt!SeDeleteAccessState (fffff800`01b02f8c)<br />
  nt!NtCreateUserProcess+0x7e9 (fffff800`01ab2a22):<br />
    call to nt!ObfDereferenceObject (fffff800`0187cde0)<br />
  nt!NtCreateUserProcess+0x7f1 (fffff800`01ab2a2a):<br />
    call to nt!ObfDereferenceObject (fffff800`0187cde0)<br />
  nt!NtCreateUserProcess+0x7fe (fffff800`01ab2a37):<br />
    call to nt!PspDeleteCreateProcessContext (fffff800`01af68f0)<br />
  nt!NtCreateUserProcess+0x810 (fffff800`01ab2a49):<br />
    call to nt!_security_check_cookie (fffff800`01895e50)<br />
  nt!NtCreateUserProcess+0x862 (fffff800`01ab2a9b):<br />
    call to nt!ZwOpenFile (fffff800`01873480)<br />
  nt!NtCreateUserProcess+0x884 (fffff800`01ab2abd):<br />
    call to nt!PspUpdateCreateInfo (fffff800`01aadc9c)<br />
  nt! ?? ::NNGAKEGL::`string'+0x4f944 (fffff800`01b55164):<br />
    call to nt!ObReferenceObjectByHandle (fffff800`01ad8110)<br />
  nt! ?? ::NNGAKEGL::`string'+0x4f9a5 (fffff800`01b551c5):<br />
    call to nt!PspUpdateCreateInfo (fffff800`01aadc9c)<br />
  nt! ?? ::NNGAKEGL::`string'+0x4fa80 (fffff800`01b55298):<br />
    call to nt!PspGetContextThreadInternal (fffff800`01b02660)<br />
  nt! ?? ::NNGAKEGL::`string'+0x4faf3 (fffff800`01b55303):<br />
    call to nt!ExfTryToWakePushLock (fffff800`0186b924)<br />
  nt! ?? ::NNGAKEGL::`string'+0x4fb21 (fffff800`01b55325):<br />
    call to nt!KiCheckForKernelApcDelivery (fffff800`0183c754)<br />
  nt! ?? ::NNGAKEGL::`string'+0x4fb3e (fffff800`01b55342):<br />
    call to nt!PspDoHandleSweepSingle (fffff800`01b92770)<br />
  nt! ?? ::NNGAKEGL::`string'+0x4fb92 (fffff800`01b55392):<br />
    call to nt!KiCheckForKernelApcDelivery (fffff800`0183c754)<br />
  nt! ?? ::NNGAKEGL::`string'+0x4fba0 (fffff800`01b553a0):<br />
    call to nt!PspDoHandleSweepSingle (fffff800`01b92770)<br />
  nt! ?? ::NNGAKEGL::`string'+0x4fbb2 (fffff800`01b553b2):<br />
    call to nt!PsTerminateProcess (fffff800`01b94140)</code></span></p>
<p style="text-align: left;">The check for import of disallowed API during post-process initialization (p. 361) </p>
<p style="text-align: left;"><span>CsrCreateProcess (pp. 361 - 362) - <em>Here&#8217;s a condensed view of top level function calls on x64 W2K8:</em></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c CsrCreateProcess<br />
CSRSRV!CsrCreateProcess (000007fe`fd8c76c8)<br />
  CSRSRV!CsrCreateProcess+0x18 (000007fe`fd8c76e0):<br />
    call to CSRSRV!CsrpCreateProcess (000007fe`fd8c7280)</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c CsrpCreateProcess<br />
CSRSRV!CsrpCreateProcess (000007fe`fd8c7280)<br />
  CSRSRV!CsrpCreateProcess+0x2e (000007fe`fd8c72ae):<br />
    call to ntdll!RtlEnterCriticalSection (00000000`77478920)<br />
  CSRSRV!CsrpCreateProcess+0x66 (000007fe`fd8c72e6):<br />
    call to CSRSRV!CsrCreateThread (000007fe`fd8c77fc)<br />
  CSRSRV!CsrpCreateProcess+0x78 (000007fe`fd8c72f8):<br />
    call to ntdll!ZwClose (00000000`77476e00)<br />
  CSRSRV!CsrpCreateProcess+0x83 (000007fe`fd8c7303):<br />
    call to CSRSRV!CsrAllocateProcess (000007fe`fd8c715c)<br />
  CSRSRV!CsrpCreateProcess+0xa4 (000007fe`fd8c7324):<br />
    call to CSRSRV!CsrGetProcessLuid (000007fe`fd8c8790)<br />
  CSRSRV!CsrpCreateProcess+0x114 (000007fe`fd8c7394):<br />
    call to CSRSRV!memcpy (000007fe`fd8cadec)<br />
  CSRSRV!CsrpCreateProcess+0x1ab (000007fe`fd8c742b):<br />
    call to ntdll!NtSetInformationProcess (00000000`77476ed0)<br />
  CSRSRV!CsrpCreateProcess+0x1d2 (000007fe`fd8c7452):<br />
    call to ntdll!NtSetInformationProcess (00000000`77476ed0)<br />
  CSRSRV!CsrpCreateProcess+0x257 (000007fe`fd8c74d7):<br />
    call to ntdll!NtSetInformationProcess (00000000`77476ed0)<br />
  CSRSRV!CsrpCreateProcess+0x277 (000007fe`fd8c74f7):<br />
    call to ntdll!RtlFreeHeap (00000000`77478c80)<br />
  CSRSRV!CsrpCreateProcess+0x2d8 (000007fe`fd8c7558):<br />
    call to ntdll!NtQueryInformationThread (00000000`77476f60)<br />
  CSRSRV!CsrpCreateProcess+0x2f0 (000007fe`fd8c7570):<br />
    call to ntdll!RtlFreeHeap (00000000`77478c80)<br />
  CSRSRV!CsrpCreateProcess+0x2fd (000007fe`fd8c757d):<br />
    call to CSRSRV!CsrAllocateThread (000007fe`fd8c7b94)<br />
  CSRSRV!CsrpCreateProcess+0x32d (000007fe`fd8c75ad):<br />
    call to CSRSRV!CsrInsertThread (000007fe`fd8c7bfc)<br />
  CSRSRV!CsrpCreateProcess+0x344 (000007fe`fd8c75c4):<br />
    call to ntdll!RtlFreeHeap (00000000`77478c80)<br />
  CSRSRV!CsrpCreateProcess+0x356 (000007fe`fd8c75d6):<br />
    call to ntdll!RtlFreeHeap (00000000`77478c80)<br />
  CSRSRV!CsrpCreateProcess+0x365 (000007fe`fd8c75e5):<br />
    call to ntdll!RtlLeaveCriticalSection (00000000`77478960)<br />
  CSRSRV!CsrpCreateProcess+0x393 (000007fe`fd8c7613):<br />
    call to CSRSRV!CsrSetBackgroundPriority (000007fe`fd8c712c)<br />
  CSRSRV!CsrpCreateProcess+0x3b6 (000007fe`fd8c7636):<br />
    call to CSRSRV!CsrInsertProcess (000007fe`fd8c71f0)<br />
  CSRSRV!CsrpCreateProcess+0x3d8 (000007fe`fd8c7658):<br />
    call to ntdll!RtlLeaveCriticalSection (00000000`77478960)</code></span></p>
<p style="text-align: left;"><span>No elevation, virtualization and compatibility checks for protected processes (p. 362)</span></p>
<p style="text-align: left;">KiThreadStartup (p. 363) - <em>it looks like on x64 W2K8 it is KxStartUserThread that has this high-level call structure:</em></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c nt!KxStartUserThread<br />
nt!KxStartUserThread (fffff800`018b56e0)<br />
  nt!KiStartUserThread+0x12 (fffff800`018b5756):<br />
    unresolvable call: call    qword ptr [rsp+10h]<br />
  nt!KiStartUserThread+0x9f (fffff800`018b57e3):<br />
    call to nt!KiInitiateUserApc (fffff800`0189d710)<br />
  nt!KiStartUserThread+0xbc (fffff800`018b5800):<br />
    call to nt!KiRestoreDebugRegisterState (fffff800`01878860)</code></span></p>
<p style="text-align: left;"><span>PspUserThreadStartup (p. 363) - <em>high-level call structure on x64 W2K8</em></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c PspUserThreadStartup<br />
nt!PspUserThreadStartup (fffff800`01b01ae4)<br />
  nt!PspUserThreadStartup+0xa1 (fffff800`01b01b85):<br />
    call to nt!MmGetSessionLocaleId (fffff800`01b028a4)<br />
  nt!PspUserThreadStartup+0xdc (fffff800`01b01bc0):<br />
    call to nt!DbgkCreateThread (fffff800`01b02cc0)<br />
  nt!PspUserThreadStartup+0x100 (fffff800`01b01be4):<br />
    call to nt!PfProcessCreateNotification (fffff800`01ab46cc)<br />
  nt!PspUserThreadStartup+0x121 (fffff800`01b01c05):<br />
    call to nt!PspInitializeThunkContext (fffff800`01b028e4)<br />
  nt! ?? ::NNGAKEGL::`string'+0x42263 (fffff800`01b48d5a):<br />
    call to nt!ExfAcquirePushLockExclusive (fffff800`0186aa60)<br />
  nt! ?? ::NNGAKEGL::`string'+0x4226b (fffff800`01b48d62):<br />
    call to nt!ExfReleasePushLockExclusive (fffff800`018c4b98)<br />
  nt! ?? ::NNGAKEGL::`string'+0x42283 (fffff800`01b48d7a):<br />
    call to nt!KiCheckForKernelApcDelivery (fffff800`0183c754)<br />
  nt! ?? ::NNGAKEGL::`string'+0x42299 (fffff800`01b48d90):<br />
    call to nt!PspTerminateThreadByPointer (fffff800`01ad30dc)</code></span></p>
<p style="text-align: left;"><span>System-wide cookie in SharedUserData for pointer encoding/decoding API (p. 363)</span></p>
<p style="text-align: left;"><span>LdrInitializeThunk (p. 364) - <em>high-level call structure on x64 W2K8</em></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c LdrInitializeThunk<br />
ntdll!LdrInitializeThunk (00000000`774568d0)<br />
  ntdll!LdrInitializeThunk+0x9 (00000000`774568d9):<br />
<strong>    call to ntdll!LdrpInitialize (<span style="color: blue;">00000000`77456990</span>)<br />
</strong>  ntdll!LdrInitializeThunk+0&#215;13 (00000000`774568e3):<br />
<strong>    call to ntdll!ZwContinue (00000000`77477140)<br />
</strong>  ntdll!LdrInitializeThunk+0&#215;1a (00000000`774568ea):<br />
    call to ntdll!RtlRaiseStatus (00000000`774e8fa0)<br />
  ntdll!RtlAllocateActivationContextStack+0&#215;29 (00000000`7745692d):<br />
    call to ntdll!RtlAllocateHeap (00000000`774789b0)</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c LdrpInitialize<br />
Matched: 00000000`774567f0 ntdll!LdrpInitialize = &lt;no type information&gt;<br />
Matched: <span style="color: blue;">00000000`77456990</span> ntdll!LdrpInitialize = &lt;no type information&gt;<br />
Ambiguous symbol error at &#8216;LdrpInitialize&#8217;</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c <span style="color: blue;">00000000`77456990</span><br />
Flow analysis was incomplete, some code may be missing<br />
ntdll!LdrpInitialize (00000000`77456990)<br />
  ntdll!LdrpInitialize+0xaa (00000000`7745689a):<br />
<strong>    call to ntdll!LdrpInitializeThread (00000000`77470770)<br />
</strong>  ntdll!LdrpInitialize+0xaf (00000000`7745689f):<br />
    call to ntdll!ZwTestAlert (00000000`77478490)<br />
  ntdll! ?? ::FNODOBFM::`string&#8217;+0&#215;20948 (00000000`7746bb8b):<br />
    call to ntdll!RtlInitializeSRWLock (00000000`774687f0)<br />
  ntdll! ?? ::FNODOBFM::`string&#8217;+0&#215;20954 (00000000`7746bb97):<br />
<strong>    call to ntdll!LdrpInitializeProcess (00000000`7746ca20)<br />
</strong>  ntdll! ?? ::FNODOBFM::`string&#8217;+0&#215;20b40 (00000000`7746d540):<br />
    call to ntdll!InitSecurityCookie (00000000`7746d560)<br />
  ntdll! ?? ::FNODOBFM::`string&#8217;+0&#215;20ae4 (00000000`7746e52f):<br />
    call to ntdll!NtDelayExecution (00000000`77477050)</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c ntdll!LdrpInitializeThread<br />
ntdll!LdrpInitializeThread (00000000`77470770)<br />
  ntdll!LdrShutdownThread+0x139 (00000000`77437544):<br />
    call to ntdll!LdrpCallTlsInitializers (00000000`77437630)<br />
  ntdll!LdrpInitializeThread+0x16d (00000000`774376f8):<br />
    call to ntdll!LdrpCallTlsInitializers (00000000`77437630)<br />
  ntdll!LdrShutdownThread+0x124 (00000000`77448199):<br />
    call to ntdll!RtlActivateActivationContextUnsafeFast (00000000`77478bf0)<br />
  ntdll!LdrShutdownThread+0x149 (00000000`774481b5):<br />
    unresolvable call: call    rsi<br />
  ntdll!LdrShutdownThread+0x151 (00000000`774481bd):<br />
    call to ntdll!RtlDeactivateActivationContextUnsafeFast (00000000`77478b00)<br />
  ntdll!LdrShutdownThread+0x68 (00000000`77448238):<br />
    call to ntdll!RtlEnterCriticalSection (00000000`77478920)<br />
  ntdll!LdrShutdownThread+0x1cd (00000000`774483cf):<br />
    call to ntdll!LdrpFreeTls (00000000`774482f0)<br />
  ntdll!LdrShutdownThread+0x1e1 (00000000`774483e3):<br />
    call to ntdll!RtlLeaveCriticalSection (00000000`77478960)<br />
  ntdll!LdrShutdownThread+0x1e6 (00000000`774483e8):<br />
    call to ntdll!LdrpCleanupThreadTlsData (00000000`77448490)<br />
  ntdll!LdrShutdownThread+0x213 (00000000`77448415):<br />
    call to ntdll!RtlFreeHeap (00000000`77478c80)<br />
  ntdll!LdrShutdownThread+0x246 (00000000`77448448):<br />
    call to ntdll!RtlFreeActivationContextStack (00000000`774480a0)<br />
  ntdll!LdrpInitializeThread+0x264 (00000000`774706bf):<br />
    call to ntdll!RtlLeaveCriticalSection (00000000`77478960)<br />
  ntdll!LdrpInitializeThread+0x43 (00000000`774707b3):<br />
    call to ntdll!RtlAllocateActivationContextStack (00000000`77456900)<br />
  ntdll!LdrpInitializeThread+0x5f (00000000`774707cf):<br />
    call to ntdll!RtlEnterCriticalSection (00000000`77478920)<br />
  ntdll!LdrpInitializeThread+0x65 (00000000`774707d5):<br />
    call to ntdll!LdrpAllocateTls (00000000`774569d0)<br />
  ntdll!LdrpInitializeThread+0x13e (00000000`774708ae):<br />
    call to ntdll!RtlActivateActivationContextUnsafeFast (00000000`77478bf0)<br />
  ntdll!LdrpInitializeThread+0x161 (00000000`774708d5):<br />
    unresolvable call: call    rsi<br />
  ntdll!LdrpInitializeThread+0x17c (00000000`774708e1):<br />
    call to ntdll!RtlDeactivateActivationContextUnsafeFast (00000000`77478b00)<br />
  ntdll!LdrpInitializeThread+0x1a9 (00000000`7749017c):<br />
    call to ntdll!RtlRaiseStatus (00000000`774e8fa0)<br />
  ntdll!LdrpInitializeThread+0x1b5 (00000000`77490188):<br />
    call to ntdll!RtlLeaveCriticalSection (00000000`77478960)<br />
  ntdll!LdrpInitializeThread+0x1d0 (00000000`774901a3):<br />
    call to ntdll!NtDelayExecution (00000000`77477050)<br />
  ntdll!LdrpInitializeThread+0x1dc (00000000`774901af):<br />
    call to ntdll!RtlEnterCriticalSection (00000000`77478920)<br />
  ntdll!LdrpInitializeThread+0x233 (00000000`7749020a):<br />
    call to ntdll!RtlActivateActivationContextUnsafeFast (00000000`77478bf0)<br />
  ntdll!LdrpInitializeThread+0x245 (00000000`7749021c):<br />
    call to ntdll!LdrpCallTlsInitializers (00000000`77437630)<br />
  ntdll!LdrpInitializeThread+0x250 (00000000`77490227):<br />
    call to ntdll!RtlDeactivateActivationContextUnsafeFast (00000000`77478b00)<br />
  ntdll!LdrShutdownThread+0x1ab (00000000`7749027e):<br />
    call to ntdll!RtlActivateActivationContextUnsafeFast (00000000`77478bf0)<br />
  ntdll!LdrShutdownThread+0x1bd (00000000`77490290):<br />
    call to ntdll!LdrpCallTlsInitializers (00000000`77437630)<br />
  ntdll!LdrShutdownThread+0x1c8 (00000000`7749029b):<br />
    call to ntdll!RtlDeactivateActivationContextUnsafeFast (00000000`77478b00)<br />
  ntdll! ?? ::FNODOBFM::`string'+0x15c61 (00000000`774bd160):<br />
    call to ntdll!NtDelayExecution (00000000`77477050)<br />
  ntdll! ?? ::FNODOBFM::`string'+0x15c6e (00000000`774bd16d):<br />
    call to ntdll!RtlRaiseStatus (00000000`774e8fa0)<br />
  ntdll! ?? ::FNODOBFM::`string'+0x15cb0 (00000000`774bd1a6):<br />
    call to ntdll!RtlEnterCriticalSection (00000000`77478920)<br />
  ntdll! ?? ::FNODOBFM::`string'+0x15cbc (00000000`774bd1b2):<br />
    call to ntdll!RtlLeaveCriticalSection (00000000`77478960)<br />
  ntdll! ?? ::FNODOBFM::`string'+0x15cd7 (00000000`774bd1cd):<br />
    call to ntdll!RtlFreeHeap (00000000`77478c80)<br />
  ntdll! ?? ::FNODOBFM::`string'+0x15cfd (00000000`774bd1f3):<br />
    call to ntdll!RtlFreeHeap (00000000`77478c80)</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; uf /c ntdll!LdrpInitializeProcess<br />
Flow analysis was incomplete, some code may be missing<br />
ntdll!LdrpInitializeProcess (00000000`7746ca20)<br />
  ntdll!LdrpInitializeProcess+0xf88 (00000000`7746bc0d):<br />
    call to ntdll!LdrpUpdateOrderLinks (00000000`774644c0)<br />
  ntdll!LdrpInitializeProcess+0xf9c (00000000`7746bc21):<br />
    call to ntdll!RtlInsertInvertedFunctionTable (00000000`77464e50)<br />
  ntdll!LdrpInitializeProcess+0xfa4 (00000000`7746bc29):<br />
    call to ntdll!LdrpAllocateDataTableEntry (00000000`77464380)<br />
  ntdll!LdrpInitializeProcess+0x1098 (00000000`7746bc76):<br />
    call to ntdll!RtlImageNtHeaderEx (00000000`7747dc00)<br />
  ntdll!LdrpInitializeProcess+0x10f1 (00000000`7746bccd):<br />
    call to ntdll!RtlAppendUnicodeStringToString (00000000`774574b0)<br />
  ntdll!LdrpInitializeProcess+0x110f (00000000`7746bceb):<br />
    call to ntdll!LdrpUpdateOrderLinks (00000000`774644c0)<br />
  ntdll!LdrpInitializeProcess+0x1123 (00000000`7746bcff):<br />
    call to ntdll!RtlInsertInvertedFunctionTable (00000000`77464e50)<br />
  ntdll!LdrpInitializeProcess+0x1128 (00000000`7746bd04):<br />
    call to ntdll!RtlInitializeHistoryTable (00000000`7746da90)<br />
  ntdll!LdrpInitializeProcess+0x11c9 (00000000`7746bd4f):<br />
    call to ntdll!RtlpInitCurrentDir (00000000`7746db70)<br />
  ntdll!LdrpInitializeProcess+0x1648 (00000000`7746bdca):<br />
    call to ntdll!LdrLoadDll (00000000`77463e30)<br />
  ntdll!LdrpInitializeProcess+0x16ba (00000000`7746bdf9):<br />
    call to ntdll!LdrGetProcedureAddressEx (00000000`7747dd10)<br />
  ntdll!LdrpInitializeProcess+0x171f (00000000`7746be16):<br />
    call to ntdll!LdrpWalkImportDescriptor (00000000`77466390)<br />
  ntdll!LdrpInitializeProcess+0x18cd (00000000`7746be5b):<br />
    call to ntdll!LdrpInitializeTls (00000000`7746e380)<br />
  ntdll!LdrpInitializeProcess+0x1940 (00000000`7746be88):<br />
    call to ntdll!LdrpRunInitializeRoutines (00000000`77464650)<br />
  ntdll!LdrpInitializeProcess+0x138e (00000000`7746bedf):<br />
    call to ntdll!LdrLoadDll (00000000`77463e30)<br />
  ntdll!LdrpInitializeProcess+0x13ff (00000000`7746bf0d):<br />
    call to ntdll!LdrGetProcedureAddressEx (00000000`7747dd10)<br />
  ntdll!LdrpInitializeProcess+0x1475 (00000000`7746bf3b):<br />
    call to ntdll!LdrGetProcedureAddressEx (00000000`7747dd10)<br />
  ntdll!LdrpInitializeProcess+0x14eb (00000000`7746bf69):<br />
    call to ntdll!LdrGetProcedureAddressEx (00000000`7747dd10)<br />
  ntdll!LdrpInitializeProcess+0x19f5 (00000000`7746bfc5):<br />
    call to ntdll!_security_check_cookie (00000000`7747acb0)<br />
  ntdll!LdrpInitializeProcess+0x32 (00000000`7746ca52):<br />
    call to ntdll!RtlSetUnhandledExceptionFilter (00000000`7746c2d0)<br />
  ntdll!LdrpInitializeProcess+0xe9 (00000000`7746ca9a):<br />
    call to ntdll!RtlInitNlsTables (00000000`7746c920)<br />
  ntdll!LdrpInitializeProcess+0xf6 (00000000`7746caa7):<br />
    call to ntdll!RtlResetRtlTranslations (00000000`7746c410)<br />
  ntdll!LdrpInitializeProcess+0xfe (00000000`7746caaf):<br />
    call to ntdll!RtlpInitSRWLock (00000000`7746c530)<br />
  ntdll!LdrpInitializeProcess+0x103 (00000000`7746cab4):<br />
    call to ntdll!RtlpInitConditionVariable (00000000`7746c550)<br />
  ntdll!LdrpInitializeProcess+0x213 (00000000`7746cb7d):<br />
    call to ntdll!RtlImageNtHeader (00000000`774567b0)<br />
  ntdll!LdrpInitializeProcess+0x273 (00000000`7746cbd7):<br />
    call to ntdll!LdrpInitializeExecutionOptions (00000000`7746c6b0)<br />
  ntdll!LdrpInitializeProcess+0x353 (00000000`7746cc2f):<br />
    call to ntdll!RtlImageDirectoryEntryToData (00000000`7746a940)<br />
  ntdll!LdrpInitializeProcess+0x3cd (00000000`7746cc95):<br />
    call to ntdll!RtlNormalizeProcessParams (00000000`7746c2f0)<br />
  ntdll!LdrpInitializeProcess+0x423 (00000000`7746cce3):<br />
    call to ntdll!RtlImageDirectoryEntryToData (00000000`7746a940)<br />
  ntdll!LdrpInitializeProcess+0x448 (00000000`7746cd02):<br />
    call to ntdll!memset (00000000`77478830)<br />
  ntdll!LdrpInitializeProcess+0x58c (00000000`7746cd53):<br />
    call to ntdll!RtlpInitDeferredCriticalSection (00000000`7746c640)<br />
  ntdll!LdrpInitializeProcess+0x7d5 (00000000`7746ceb5):<br />
    call to ntdll!RtlInitializeCriticalSection (00000000`77455d20)<br />
  ntdll!LdrpInitializeProcess+0x7fb (00000000`7746cedb):<br />
    call to ntdll!RtlInitializeHeapManager (00000000`7746c7a0)<br />
  ntdll!LdrpInitializeProcess+0x84b (00000000`7746cf2a):<br />
    call to ntdll!RtlCreateHeap (00000000`77466ed0)<br />
  ntdll!LdrpInitializeProcess+0x8e2 (00000000`7746cf51):<br />
    call to ntdll!RtlAllocateActivationContextStack (00000000`77456900)<br />
  ntdll!LdrpInitializeProcess+0x8f6 (00000000`7746cf65):<br />
    call to ntdll!EtwpInitializeDll (00000000`7746c250)<br />
  ntdll!LdrpInitializeProcess+0x916 (00000000`7746cf85):<br />
    call to ntdll!RtlCreateTagHeap (00000000`7746d320)<br />
  ntdll!LdrpInitializeProcess+0x942 (00000000`7746cfb1):<br />
    call to ntdll!RtlCreateTagHeap (00000000`7746d320)<br />
  ntdll!LdrpInitializeProcess+0x962 (00000000`7746cfd1):<br />
    call to ntdll!RtlpInitEnvironmentBlock (00000000`7746d380)<br />
  ntdll!LdrpInitializeProcess+0x96f (00000000`7746cfde):<br />
    call to ntdll!RtlpInitParameterBlock (00000000`7746d7f0)<br />
  ntdll!LdrpInitializeProcess+0xa5e (00000000`7746d068):<br />
    call to ntdll!RtlInitUnicodeString (00000000`7747ad10)<br />
  ntdll!LdrpInitializeProcess+0xa73 (00000000`7746d07d):<br />
    call to ntdll!RtlAppendUnicodeStringToString (00000000`774574b0)<br />
  ntdll!LdrpInitializeProcess+0xa87 (00000000`7746d091):<br />
    call to ntdll!RtlAppendUnicodeStringToString (00000000`774574b0)<br />
  ntdll!LdrpInitializeProcess+0xaf0 (00000000`7746d0fe):<br />
    call to ntdll!ZwOpenDirectoryObject (00000000`77477290)<br />
  ntdll!LdrpInitializeProcess+0xc2a (00000000`7746d171):<br />
    call to ntdll!ZwOpenSymbolicLinkObject (00000000`77477cb0)<br />
  ntdll!LdrpInitializeProcess+0xc6b (00000000`7746d1b2):<br />
    call to ntdll!ZwQuerySymbolicLinkObject (00000000`77477f60)<br />
  ntdll!LdrpInitializeProcess+0xc7a (00000000`7746d1c1):<br />
    call to ntdll!ZwClose (00000000`77476e00)<br />
  ntdll!LdrpInitializeProcess+0xe50 (00000000`7746d24d):<br />
    call to ntdll!LdrpAllocateDataTableEntry (00000000`77464380)<br />
  ntdll!LdrpInitializeProcess+0xee4 (00000000`7746d289):<br />
    call to ntdll!RtlImageNtHeaderEx (00000000`7747dc00)<br />
  ntdll!LdrpInitializeProcess+0x30d (00000000`77473eb0):<br />
    call to ntdll!NtQueryInformationProcess (00000000`77476ea0)<br />
  ntdll!LdrpInitializeProcess+0x635 (00000000`77473ef0):<br />
    call to ntdll!RtlSetBits (00000000`77466c00)<br />
  ntdll!LdrpInitializeProcess+0x873 (00000000`77473f19):<br />
    call to ntdll!RtlCreateHeap (00000000`77466ed0)<br />
  ntdll!LdrpInitializeProcess+0xbb8 (00000000`774744f9):<br />
    call to ntdll!ZwOpenDirectoryObject (00000000`77477290)<br />
  ntdll!LdrpInitializeProcess+0xe10 (00000000`77474554):<br />
    call to ntdll!RtlAppendUnicodeStringToString (00000000`774574b0)<br />
  ntdll!LdrpInitializeProcess+0x77 (00000000`77490a96):<br />
    call to ntdll!NtQueryVirtualMemory (00000000`77476f40)<br />
  ntdll!LdrpInitializeProcess+0xb3 (00000000`77490ad2):<br />
    call to ntdll!NtQueryVirtualMemory (00000000`77476f40)<br />
  ntdll!LdrpInitializeProcess+0x2d2 (00000000`77490b92):<br />
    call to ntdll!LdrpLogDbgPrint (00000000`774ec5a0)<br />
  ntdll!LdrpInitializeProcess+0x2db (00000000`77490b9d):<br />
    call to ntdll!DbgBreakPoint (00000000`77476060)<br />
  ntdll!LdrpInitializeProcess+0x720 (00000000`77490d34):<br />
    call to ntdll!LdrQueryImageFileExecutionOptions (00000000`77473260)<br />
  ntdll!LdrpInitializeProcess+0x790 (00000000`77490da4):<br />
    call to ntdll!LdrpLogDbgPrint (00000000`774ec5a0)<br />
  ntdll!LdrpInitializeProcess+0x79a (00000000`77490dae):<br />
    call to ntdll!DbgBreakPoint (00000000`77476060)<br />
  ntdll!LdrpInitializeProcess+0x7c6 (00000000`77490dda):<br />
    call to ntdll!RtlControlStackTraceDataBase (00000000`774e3cd0)<br />
  ntdll!LdrpInitializeProcess+0x8ac (00000000`77490e27):<br />
    call to ntdll!LdrpLogDbgPrint (00000000`774ec5a0)<br />
  ntdll!LdrpInitializeProcess+0x8bf (00000000`77490e3a):<br />
    call to ntdll!DbgBreakPoint (00000000`77476060)<br />
  ntdll!LdrpInitializeProcess+0x9ff (00000000`77490e8c):<br />
    call to ntdll!RtlQueryImageFileKeyOption (00000000`77473320)<br />
  ntdll!LdrpInitializeProcess+0xb0f (00000000`77490ee2):<br />
    call to ntdll!RtlInitUnicodeString (00000000`7747ad10)<br />
  ntdll!LdrpInitializeProcess+0xcea (00000000`77490f57):<br />
    call to ntdll!LdrpLogDbgPrint (00000000`774ec5a0)<br />
  ntdll!LdrpInitializeProcess+0xd01 (00000000`77490f6e):<br />
    call to ntdll!LdrpInitializationFailure (00000000`774ed120)<br />
  ntdll!LdrpInitializeProcess+0xd3f (00000000`77490f82):<br />
    call to ntdll!RtlAllocateHeap (00000000`774789b0)<br />
  ntdll!LdrpInitializeProcess+0xd7d (00000000`77490fc0):<br />
    call to ntdll!LdrpLogDbgPrint (00000000`774ec5a0)<br />
  ntdll!LdrpInitializeProcess+0xd90 (00000000`77490fd3):<br />
    call to ntdll!DbgBreakPoint (00000000`77476060)</code></span></p>
<p style="text-align: left;"><span>Private vs. shared assemblies (p. 365)</span></p>
<p style="text-align: left;"><span>- <span>Dmitry</span> <span>Vostokov</span> @ </span><a href="http://www.softwaregeneralist.com/"><span><span>SoftwareGeneralist</span>.com</span></a> -</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwaregeneralist.com/2010/03/02/reading-notebook-01-march-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading Notebook: 09-February-10</title>
		<link>http://www.softwaregeneralist.com/2010/02/09/reading-notebook-09-february-10/</link>
		<comments>http://www.softwaregeneralist.com/2010/02/09/reading-notebook-09-february-10/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 21:51:34 +0000</pubDate>
		<dc:creator>Dmitry Vostokov</dc:creator>
		
		<category><![CDATA[Notes on Windows Internals]]></category>

		<category><![CDATA[Reading Notebook]]></category>

		<guid isPermaLink="false">http://www.softwaregeneralist.com/?p=96</guid>
		<description><![CDATA[Comments in italics are mine and express my own views, thoughts and opinions
Windows Internals by M. Russinovich, D. Solomon and A. Ionescu:
CreateProcess and Increase Scheduling Priority privilege (p. 351)
MS-DOS apps share the same VDM (p. 353)
HKLM\S\CCS\C\WOW\DefaultSeparateVDM (p. 353)
IMAGE_FILE_UP_SYSTEM_ONLY PE characteristic to run on a single CPU (p. 358)
Upon creation initial thread starts in kernel mode [...]]]></description>
			<content:encoded><![CDATA[<p><em>Comments in italics are mine and express my own views, thoughts and opinions</em></p>
<p style="text-align: left;"><strong><span>Windows Internals by M. <span>Russinovich</span>, D. Solomon and A. <span>Ionescu</span>:</span></strong></p>
<p style="text-align: left;">CreateProcess and Increase Scheduling Priority privilege (p. 351)</p>
<p style="text-align: left;">MS-DOS apps share the same VDM (p. 353)</p>
<p style="text-align: left;">HKLM\S\CCS\C\WOW\DefaultSeparateVDM (p. 353)</p>
<p style="text-align: left;">IMAGE_FILE_UP_SYSTEM_ONLY PE characteristic to run on a single CPU (p. 358)</p>
<p><span>Upon creation initial thread starts in kernel mode in KiThreadStartup (p. 360)</span></p>
<p><span>- <span>Dmitry</span> <span>Vostokov</span> @ </span><a href="http://www.softwaregeneralist.com/"><span><span>SoftwareGeneralist</span>.com</span></a> -</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwaregeneralist.com/2010/02/09/reading-notebook-09-february-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading Notebook: 25-January-10</title>
		<link>http://www.softwaregeneralist.com/2010/01/25/reading-notebook-25-january-10/</link>
		<comments>http://www.softwaregeneralist.com/2010/01/25/reading-notebook-25-january-10/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 22:23:10 +0000</pubDate>
		<dc:creator>Dmitry Vostokov</dc:creator>
		
		<category><![CDATA[Notes on Advanced .NET Debugging]]></category>

		<category><![CDATA[Notes on Windows Internals]]></category>

		<category><![CDATA[Reading Notebook]]></category>

		<guid isPermaLink="false">http://www.softwaregeneralist.com/?p=95</guid>
		<description><![CDATA[Comments in italics are mine and express my own views, thoughts and opinions
Windows Internals by M. Russinovich, D. Solomon and A. Ionescu:
Kernel Process variables (p. 343)
0: kd&#62; !process poi(PsIdleProcess)
PROCESS fffff800019910c0
    SessionId: none  Cid: 0000    Peb: 00000000  ParentCid: 0000
    DirBase: 00124000  ObjectTable: fffff88000000080  HandleCount: 606.
    Image: Idle
    VadRoot fffffa8003b97c70 Vads 1 Clone 0 Private 1. Modified 0. [...]]]></description>
			<content:encoded><![CDATA[<p><em>Comments in italics are mine and express my own views, thoughts and opinions</em></p>
<p style="text-align: left;"><strong><span>Windows Internals by M. <span>Russinovich</span>, D. Solomon and A. <span>Ionescu</span>:</span></strong></p>
<p style="text-align: left;">Kernel Process variables (p. 343)</p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; !process poi(<span style="color: blue;">PsIdleProcess</span>)<br />
PROCESS fffff800019910c0<br />
    SessionId: none  Cid: 0000    Peb: 00000000  ParentCid: 0000<br />
    DirBase: 00124000  ObjectTable: fffff88000000080  HandleCount: 606.<br />
    Image: Idle<br />
    VadRoot fffffa8003b97c70 Vads 1 Clone 0 Private 1. Modified 0. Locked 0.<br />
    DeviceMap 0000000000000000<br />
    Token                             fffff88000003330<br />
    ElapsedTime                       00:00:00.000<br />
    UserTime                          00:00:00.000<br />
    KernelTime                        00:00:00.000<br />
    QuotaPoolUsage[PagedPool]         0<br />
    QuotaPoolUsage[NonPagedPool]      0<br />
    Working Set Sizes (now,min,max)  (6, 50, 450) (24KB, 200KB, 1800KB)<br />
    PeakWorkingSetSize                6<br />
    VirtualSize                       0 Mb<br />
    PeakVirtualSize                   0 Mb<br />
    PageFaultCount                    1<br />
    MemoryPriority                    BACKGROUND<br />
    BasePriority                      0<br />
    CommitCharge                      0</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>        THREAD fffff80001990b80  Cid 0000.0000  Teb: 0000000000000000 Win32Thread: 0000000000000000 RUNNING on processor 0<br />
        Not impersonating<br />
        DeviceMap                 fffff88000007310<br />
        Owning Process            fffff800019910c0       Image:         Idle<br />
        Attached Process          fffffa8003bf1040       Image:         System<br />
        Wait Start TickCount      16021          Ticks: 13224 (0:00:03:26.295)<br />
        Context Switch Count      142852            <br />
        UserTime                  00:00:00.000<br />
        KernelTime                00:06:13.700<br />
        Win32 Start Address nt!KiIdleLoop (0xfffff80001876880)<br />
        Stack Init fffff80002bdadb0 Current fffff80002bdad40<br />
        Base fffff80002bdb000 Limit fffff80002bd5000 Call 0<br />
        Priority 16 BasePriority 0 PriorityDecrement 0 IoPriority 0 PagePriority 0<br />
        Child-SP          RetAddr           Call Site<br />
        fffff800`02bdad80 fffff800`01a43860 nt!KiIdleLoop+0x11b<br />
        fffff800`02bdadb0 00000000`00000000 nt!zzz_AsmCodeRange_End+0x4</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>        THREAD fffffa60005f5d40  Cid 0000.0000  Teb: 0000000000000000 Win32Thread: 0000000000000000 RUNNING on processor 1<br />
        Not impersonating<br />
        DeviceMap                 fffff88000007310<br />
        Owning Process            fffff800019910c0       Image:         Idle<br />
        Attached Process          fffffa8003bf1040       Image:         System<br />
        Wait Start TickCount      0              Ticks: 29245 (0:00:07:36.224)<br />
        Context Switch Count      162365            <br />
        UserTime                  00:00:00.000<br />
        KernelTime                00:06:14.808<br />
        Win32 Start Address nt!KiIdleLoop (0xfffff80001876880)<br />
        Stack Init fffffa600191bdb0 Current fffffa600191bd40<br />
        Base fffffa600191c000 Limit fffffa6001916000 Call 0<br />
        Priority 16 BasePriority 0 PriorityDecrement 0 IoPriority 0 PagePriority 0<br />
        Child-SP          RetAddr           Call Site<br />
        fffffa60`0191bd80 fffff800`01a43860 nt!KiIdleLoop+0x11b<br />
        fffffa60`0191bdb0 00000000`00000000 nt!zzz_AsmCodeRange_End+0x4</code></span></p>
<p style="text-align: left;">Relevant process functions (pp. 344 - 345) - <em>More of them can be found here: </em><a href="http://msdn.microsoft.com/en-us/library/ms684847(VS.85).aspx"><em>http://msdn.microsoft.com/en-us/library/ms684847(VS.85).aspx</em></a></p>
<p style="text-align: left;">Protected processes (pp. 346 - 348) - <em>It can be seen in _EPROCESS block (the output taken from a complete memory dump):</em></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; dt _EPROCESS fffffa8004b5e040<br />
ntdll!_EPROCESS<br />
[...]<br />
   +0x36c ProtectedProcess : 0y1<br />
[...]</code></span></p>
<p style="text-align: left;"><em>The following script lists protected processes on W2K8:</em></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>0: kd&gt; !for_each_process "dt _EPROCESS ImageFileName @#Process; dt _EPROCESS ProtectedProcess @#Process"<br />
ntdll!_EPROCESS<br />
   +0x238 ImageFileName : [16]  "System"<br />
ntdll!_EPROCESS<br />
   +0x36c ProtectedProcess : 0y1<br />
[...]<br />
ntdll!_EPROCESS<br />
   +0x238 ImageFileName : [16]  "audiodg.exe"<br />
ntdll!_EPROCESS<br />
   +0x36c ProtectedProcess : 0y1<br />
[...]</code></span></p>
<p style="text-align: left;">System process is protected because of Ksecdd.sys stores info in user space (p. 347)</p>
<p style="text-align: left;">PROCESS_QUERY_LIMITED_INFORMATION (p. 347)</p>
<p style="text-align: left;">Access violation by design for Protected Media Path processes when a kernel-mode debugger is enabled (p. 348) - <em>this is not an optimal design in my opinion - I had problems with that: </em><a href="http://www.dumpanalysis.org/blog/index.php/2010/01/08/live-kernel-debugging-of-a-system-freeze-case-study/"><em>http://www.dumpanalysis.org/blog/index.php/2010/01/08/live-kernel-debugging-of-a-system-freeze-case-study/</em></a><em>. The better way is to show a message box and gracefully exit and only emit AV if message box is bypassed. </em></p>
<p style="text-align: left;"><em></em></p>
<p style="text-align: left;"><strong><span>Advanced .NET Debugging by M. <span>Hewardt</span>:</span></strong></p>
<p style="text-align: left;"><span><span>PE format and its relation to .NET (pp. 26 - 27)</span></span></p>
<p style="text-align: left;"><span><span>AddressOfEntryPoint (pp. 28 - 29 and p. 31) - <em>we can also use !dh command to find that address (similar to what dumpbin.exe does):</em></span></span></p>
<p style="text-align: left;"><span><span><span style="font-size: xx-small;"><code>0:001&gt; lm m notepad<br />
start             end                 module name<br />
00000000`ff180000 00000000`ff1af000   notepad    (deferred)         </code></span></span></span></p>
<p style="text-align: left;"><span><span><span style="font-size: xx-small;"><code>0:001&gt; !dh 00000000`ff180000<br />
[...]<br />
OPTIONAL HEADER VALUES<br />
     20B magic #<br />
    8.00 linker version<br />
    E400 size of code<br />
   1CC00 size of initialized data<br />
       0 size of uninitialized data<br />
    <span style="color: blue;">D1B4 address of entry point</span><br />
    1000 base of code<br />
         &#8212;&#8211; new &#8212;&#8211;<br />
00000000ff180000 image base<br />
    1000 section alignment<br />
     200 file alignment<br />
       2 subsystem (Windows GUI)<br />
    6.00 operating system version<br />
    6.00 image version<br />
    6.00 subsystem version<br />
   2F000 size of image<br />
     400 size of headers<br />
   32C26 checksum<br />
[&#8230;]</code></span></span></span></p>
<p style="text-align: left;"><span><span><span style="font-size: xx-small;"><code>0:001&gt; u 00000000`ff180000+<span style="color: blue;">D1B4</span><br />
notepad!WinMainCRTStartup:<br />
00000000`ff18d1b4 4883ec28        sub     rsp,28h<br />
00000000`ff18d1b8 e88b020000      call    notepad!_security_init_cookie (00000000`ff18d448)<br />
00000000`ff18d1bd 4883c428        add     rsp,28h<br />
00000000`ff18d1c1 e9b6fcffff      jmp     notepad!IsTextUTF8+0xc0 (00000000`ff18ce7c)<br />
00000000`ff18d1c6 cc              int     3<br />
00000000`ff18d1c7 cc              int     3<br />
00000000`ff18d1c8 cc              int     3<br />
00000000`ff18d1c9 cc              int     3</code></span></span></span></p>
<p style="text-align: left;">Application domains in ASP.NET; 3 default app domains (system, shared, default) in normal app (p. 34)</p>
<p style="text-align: left;"><span>!dumpdomain SOS command (pp. 35 - 36)</span></p>
<p style="text-align: left;"><span>Low(High)FrequencyHeap and StubHeap (p. 36) - <em>Looks like they are not normal heaps or heap segments. I plan to test all commands on x64 .NET:</em></span></p>
<p><span><span style="font-size: xx-small;"><code>0:003&gt; !dumpdomain<br />
--------------------------------------<br />
System Domain: 000007fef15a8ef0<br />
LowFrequencyHeap: 000007fef15a8f38<br />
HighFrequencyHeap: 000007fef15a8fc8<br />
StubHeap: 000007fef15a9058<br />
Stage: OPEN<br />
Name: None<br />
--------------------------------------<br />
Shared Domain: 000007fef15a9860<br />
LowFrequencyHeap: 000007fef15a98a8<br />
HighFrequencyHeap: 000007fef15a9938<br />
StubHeap: 000007fef15a99c8<br />
Stage: OPEN<br />
Name: None<br />
Assembly: 0000000000372d10<br />
--------------------------------------<br />
Domain 1: 0000000000360840<br />
LowFrequencyHeap: 0000000000360888<br />
HighFrequencyHeap: 0000000000360918<br />
StubHeap: 00000000003609a8<br />
Stage: OPEN<br />
SecurityDescriptor: 00000000003630e0<br />
Name: TestCLR.exe<br />
[...]</code></span></span></p>
<p><span>- <span>Dmitry</span> <span>Vostokov</span> @ </span><a href="http://www.softwaregeneralist.com/"><span><span>SoftwareGeneralist</span>.com</span></a> - </p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwaregeneralist.com/2010/01/25/reading-notebook-25-january-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading Notebook: 04-January-10</title>
		<link>http://www.softwaregeneralist.com/2010/01/04/reading-notebook-04-january-10/</link>
		<comments>http://www.softwaregeneralist.com/2010/01/04/reading-notebook-04-january-10/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 16:48:57 +0000</pubDate>
		<dc:creator>Dmitry Vostokov</dc:creator>
		
		<category><![CDATA[Notes on Windows Internals]]></category>

		<category><![CDATA[Reading Notebook]]></category>

		<guid isPermaLink="false">http://www.softwaregeneralist.com/?p=94</guid>
		<description><![CDATA[Comments in italics are mine and express my own views, thoughts and opinions
Windows Internals by M. Russinovich, D. Solomon and A. Ionescu:
Diagnostic Policy Service, DPS (pp. 330 - 331)
SMART (p. 332) - Don&#8217;t confuse with recursive acronym Smart Memory Analysis in Real Time (coined by me)
Windows system responsiveness performance diagnostics (p. 332)
Program Compatibility Assistant, PCA (p. [...]]]></description>
			<content:encoded><![CDATA[<p><em>Comments in italics are mine and express my own views, thoughts and opinions</em></p>
<p style="text-align: left;"><strong><span>Windows Internals by M. <span>Russinovich</span>, D. Solomon and A. <span>Ionescu</span>:</span></strong></p>
<p style="text-align: left;">Diagnostic Policy Service, DPS (pp. 330 - 331)</p>
<p style="text-align: left;">SMART (p. 332) - <em>Don&#8217;t confuse with recursive acronym Smart Memory Analysis in Real Time (coined by me)</em></p>
<p style="text-align: left;">Windows system responsiveness performance diagnostics (p. 332)</p>
<p style="text-align: left;">Program Compatibility Assistant, PCA (p. 333)</p>
<p style="text-align: left;"><em></em></p>
<p style="text-align: left;"><span>_EPROCESS and _KPROCESS (pp. 337 - 339) - <em>x64 equivalents from W2K8:</em></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>lkd&gt; dt _EPROCESS<br />
ntdll!_EPROCESS<br />
   +0x000 Pcb              : _KPROCESS<br />
   +0x0c0 ProcessLock      : _EX_PUSH_LOCK<br />
   +0x0c8 CreateTime       : _LARGE_INTEGER<br />
   +0x0d0 ExitTime         : _LARGE_INTEGER<br />
   +0x0d8 RundownProtect   : _EX_RUNDOWN_REF<br />
   +0x0e0 UniqueProcessId  : Ptr64 Void<br />
   +0x0e8 ActiveProcessLinks : _LIST_ENTRY<br />
   +0x0f8 QuotaUsage       : [3] Uint8B<br />
   +0x110 QuotaPeak        : [3] Uint8B<br />
   +0x128 CommitCharge     : Uint8B<br />
   +0x130 PeakVirtualSize  : Uint8B<br />
   +0x138 VirtualSize      : Uint8B<br />
   +0x140 SessionProcessLinks : _LIST_ENTRY<br />
   +0x150 DebugPort        : Ptr64 Void<br />
   +0x158 ExceptionPortData : Ptr64 Void<br />
   +0x158 ExceptionPortValue : Uint8B<br />
   +0x158 ExceptionPortState : Pos 0, 3 Bits<br />
   +0x160 ObjectTable      : Ptr64 _HANDLE_TABLE<br />
   +0x168 Token            : _EX_FAST_REF<br />
   +0x170 WorkingSetPage   : Uint8B<br />
   +0x178 AddressCreationLock : _EX_PUSH_LOCK<br />
   +0x180 RotateInProgress : Ptr64 _ETHREAD<br />
   +0x188 ForkInProgress   : Ptr64 _ETHREAD<br />
   +0x190 HardwareTrigger  : Uint8B<br />
   +0x198 PhysicalVadRoot  : Ptr64 _MM_AVL_TABLE<br />
   +0x1a0 CloneRoot        : Ptr64 Void<br />
   +0x1a8 NumberOfPrivatePages : Uint8B<br />
   +0x1b0 NumberOfLockedPages : Uint8B<br />
   +0x1b8 Win32Process     : Ptr64 Void<br />
   +0x1c0 Job              : Ptr64 _EJOB<br />
   +0x1c8 SectionObject    : Ptr64 Void<br />
   +0x1d0 SectionBaseAddress : Ptr64 Void<br />
   +0x1d8 QuotaBlock       : Ptr64 _EPROCESS_QUOTA_BLOCK<br />
   +0x1e0 WorkingSetWatch  : Ptr64 _PAGEFAULT_HISTORY<br />
   +0x1e8 Win32WindowStation : Ptr64 Void<br />
   +0x1f0 InheritedFromUniqueProcessId : Ptr64 Void<br />
   +0x1f8 LdtInformation   : Ptr64 Void<br />
   +0x200 Spare            : Ptr64 Void<br />
   +0x208 VdmObjects       : Ptr64 Void<br />
   +0x210 DeviceMap        : Ptr64 Void<br />
   +0x218 EtwDataSource    : Ptr64 Void<br />
   +0x220 FreeTebHint      : Ptr64 Void<br />
   +0x228 PageDirectoryPte : _HARDWARE_PTE<br />
   +0x228 Filler           : Uint8B<br />
   +0x230 Session          : Ptr64 Void<br />
   +0x238 ImageFileName    : [16] UChar<br />
   +0x248 JobLinks         : _LIST_ENTRY<br />
   +0x258 LockedPagesList  : Ptr64 Void<br />
   +0x260 ThreadListHead   : _LIST_ENTRY<br />
   +0x270 SecurityPort     : Ptr64 Void<br />
   +0x278 Wow64Process     : Ptr64 Void<br />
   +0x280 ActiveThreads    : Uint4B<br />
   +0x284 ImagePathHash    : Uint4B<br />
   +0x288 DefaultHardErrorProcessing : Uint4B<br />
   +0x28c LastThreadExitStatus : Int4B<br />
   +0x290 Peb              : Ptr64 _PEB<br />
   +0x298 PrefetchTrace    : _EX_FAST_REF<br />
   +0x2a0 ReadOperationCount : _LARGE_INTEGER<br />
   +0x2a8 WriteOperationCount : _LARGE_INTEGER<br />
   +0x2b0 OtherOperationCount : _LARGE_INTEGER<br />
   +0x2b8 ReadTransferCount : _LARGE_INTEGER<br />
   +0x2c0 WriteTransferCount : _LARGE_INTEGER<br />
   +0x2c8 OtherTransferCount : _LARGE_INTEGER<br />
   +0x2d0 CommitChargeLimit : Uint8B<br />
   +0x2d8 CommitChargePeak : Uint8B<br />
   +0x2e0 AweInfo          : Ptr64 Void<br />
   +0x2e8 SeAuditProcessCreationInfo : _SE_AUDIT_PROCESS_CREATION_INFO<br />
   +0x2f0 Vm               : _MMSUPPORT<br />
   +0x358 MmProcessLinks   : _LIST_ENTRY<br />
   +0x368 ModifiedPageCount : Uint4B<br />
   +0x36c Flags2           : Uint4B<br />
   +0x36c JobNotReallyActive : Pos 0, 1 Bit<br />
   +0x36c AccountingFolded : Pos 1, 1 Bit<br />
   +0x36c NewProcessReported : Pos 2, 1 Bit<br />
   +0x36c ExitProcessReported : Pos 3, 1 Bit<br />
   +0x36c ReportCommitChanges : Pos 4, 1 Bit<br />
   +0x36c LastReportMemory : Pos 5, 1 Bit<br />
   +0x36c ReportPhysicalPageChanges : Pos 6, 1 Bit<br />
   +0x36c HandleTableRundown : Pos 7, 1 Bit<br />
   +0x36c NeedsHandleRundown : Pos 8, 1 Bit<br />
   +0x36c RefTraceEnabled  : Pos 9, 1 Bit<br />
   +0x36c NumaAware        : Pos 10, 1 Bit<br />
   +0x36c ProtectedProcess : Pos 11, 1 Bit<br />
   +0x36c DefaultPagePriority : Pos 12, 3 Bits<br />
   +0x36c PrimaryTokenFrozen : Pos 15, 1 Bit<br />
   +0x36c ProcessVerifierTarget : Pos 16, 1 Bit<br />
   +0x36c StackRandomizationDisabled : Pos 17, 1 Bit<br />
   +0x36c AffinityPermanent : Pos 18, 1 Bit<br />
   +0x36c AffinityUpdateEnable : Pos 19, 1 Bit<br />
   +0x36c CrossSessionCreate : Pos 20, 1 Bit<br />
   +0x370 Flags            : Uint4B<br />
   +0x370 CreateReported   : Pos 0, 1 Bit<br />
   +0x370 NoDebugInherit   : Pos 1, 1 Bit<br />
   +0x370 ProcessExiting   : Pos 2, 1 Bit<br />
   +0x370 ProcessDelete    : Pos 3, 1 Bit<br />
   +0x370 Wow64SplitPages  : Pos 4, 1 Bit<br />
   +0x370 VmDeleted        : Pos 5, 1 Bit<br />
   +0x370 OutswapEnabled   : Pos 6, 1 Bit<br />
   +0x370 Outswapped       : Pos 7, 1 Bit<br />
   +0x370 ForkFailed       : Pos 8, 1 Bit<br />
   +0x370 Wow64VaSpace4Gb  : Pos 9, 1 Bit<br />
   +0x370 AddressSpaceInitialized : Pos 10, 2 Bits<br />
   +0x370 SetTimerResolution : Pos 12, 1 Bit<br />
   +0x370 BreakOnTermination : Pos 13, 1 Bit<br />
   +0x370 DeprioritizeViews : Pos 14, 1 Bit<br />
   +0x370 WriteWatch       : Pos 15, 1 Bit<br />
   +0x370 ProcessInSession : Pos 16, 1 Bit<br />
   +0x370 OverrideAddressSpace : Pos 17, 1 Bit<br />
   +0x370 HasAddressSpace  : Pos 18, 1 Bit<br />
   +0x370 LaunchPrefetched : Pos 19, 1 Bit<br />
   +0x370 InjectInpageErrors : Pos 20, 1 Bit<br />
   +0x370 VmTopDown        : Pos 21, 1 Bit<br />
   +0x370 ImageNotifyDone  : Pos 22, 1 Bit<br />
   +0x370 PdeUpdateNeeded  : Pos 23, 1 Bit<br />
   +0x370 VdmAllowed       : Pos 24, 1 Bit<br />
   +0x370 SmapAllowed      : Pos 25, 1 Bit<br />
   +0x370 ProcessInserted  : Pos 26, 1 Bit<br />
   +0x370 DefaultIoPriority : Pos 27, 3 Bits<br />
   +0x370 ProcessSelfDelete : Pos 30, 1 Bit<br />
   +0x370 SpareProcessFlags : Pos 31, 1 Bit<br />
   +0x374 ExitStatus       : Int4B<br />
   +0x378 Spare7           : Uint2B<br />
   +0x37a SubSystemMinorVersion : UChar<br />
   +0x37b SubSystemMajorVersion : UChar<br />
   +0x37a SubSystemVersion : Uint2B<br />
   +0x37c PriorityClass    : UChar<br />
   +0x380 VadRoot          : _MM_AVL_TABLE<br />
   +0x3c0 Cookie           : Uint4B<br />
   +0x3c8 AlpcContext      : _ALPC_PROCESS_CONTEXT</code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>lkd&gt; dt _KPROCESS<br />
ntdll!_KPROCESS<br />
   +0x000 Header           : _DISPATCHER_HEADER<br />
   +0x018 ProfileListHead  : _LIST_ENTRY<br />
   +0x028 DirectoryTableBase : Uint8B<br />
   +0x030 Unused0          : Uint8B<br />
   +0x038 IopmOffset       : Uint2B<br />
   +0x040 ActiveProcessors : Uint8B<br />
   +0x048 KernelTime       : Uint4B<br />
   +0x04c UserTime         : Uint4B<br />
   +0x050 ReadyListHead    : _LIST_ENTRY<br />
   +0x060 SwapListEntry    : _SINGLE_LIST_ENTRY<br />
   +0x068 InstrumentationCallback : Ptr64 Void<br />
   +0x070 ThreadListHead   : _LIST_ENTRY<br />
   +0x080 ProcessLock      : Uint8B<br />
   +0x088 Affinity         : Uint8B<br />
   +0x090 AutoAlignment    : Pos 0, 1 Bit<br />
   +0x090 DisableBoost     : Pos 1, 1 Bit<br />
   +0x090 DisableQuantum   : Pos 2, 1 Bit<br />
   +0x090 ReservedFlags    : Pos 3, 29 Bits<br />
   +0x090 ProcessFlags     : Int4B<br />
   +0x094 BasePriority     : Char<br />
   +0x095 QuantumReset     : Char<br />
   +0x096 State            : UChar<br />
   +0x097 ThreadSeed       : UChar<br />
   +0x098 PowerState       : UChar<br />
   +0x099 IdealNode        : UChar<br />
   +0x09a Visited          : UChar<br />
   +0x09b Flags            : _KEXECUTE_OPTIONS<br />
   +0x09b ExecuteOptions   : UChar<br />
   +0x0a0 StackCount       : Uint8B<br />
   +0x0a8 ProcessListEntry : _LIST_ENTRY<br />
   +0x0b8 CycleTime        : Uint8B</code></span></span></p>
<p style="text-align: left;"><span>Working set list, MMWSL (p. 340) - <em>I guessed the structure name right:</em></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>lkd&gt; dt _MMWSL<br />
nt!_MMWSL<br />
   +0x000 FirstFree        : Uint4B<br />
   +0x004 FirstDynamic     : Uint4B<br />
   +0x008 LastEntry        : Uint4B<br />
   +0x00c NextSlot         : Uint4B<br />
   +0x010 Wsle             : Ptr64 _MMWSLE<br />
   +0x018 LowestPagableAddress : Ptr64 Void<br />
   +0x020 LastInitializedWsle : Uint4B<br />
   +0x024 NextEstimationSlot : Uint4B<br />
   +0x028 NextAgingSlot    : Uint4B<br />
   +0x02c EstimatedAvailable : Uint4B<br />
   +0x030 GrowthSinceLastEstimate : Uint4B<br />
   +0x034 NumberOfCommittedPageTables : Uint4B<br />
   +0x038 VadBitMapHint    : Uint4B<br />
   +0x03c NonDirectCount   : Uint4B<br />
   +0x040 LastVadBit       : Uint4B<br />
   +0x044 MaximumLastVadBit : Uint4B<br />
   +0x048 LastAllocationSizeHint : Uint4B<br />
   +0x04c LastAllocationSize : Uint4B<br />
   +0x050 NonDirectHash    : Ptr64 _MMWSLE_NONDIRECT_HASH<br />
   +0x058 HashTableStart   : Ptr64 _MMWSLE_HASH<br />
   +0x060 HighestPermittedHashAddress : Ptr64 _MMWSLE_HASH<br />
   +0x068 HighestUserAddress : Ptr64 Void<br />
   +0x070 MaximumUserPageTablePages : Uint4B<br />
   +0x074 MaximumUserPageDirectoryPages : Uint4B<br />
   +0x078 CommittedPageTables : Ptr64 Uint4B<br />
   +0x080 NumberOfCommittedPageDirectories : Uint4B<br />
   +0x088 CommittedPageDirectories : [128] Uint8B<br />
   +0x488 NumberOfCommittedPageDirectoryParents : Uint4B<br />
   +0x490 CommittedPageDirectoryParents : [1] Uint8B</code></span></span></p>
<p style="text-align: left;"><span>PEB (pp. 341 - 342) - <em>here&#8217;s x64 PEB structure from W2K8:</em></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>lkd&gt; dt _PEB<br />
ntdll!_PEB<br />
   +0x000 InheritedAddressSpace : UChar<br />
   +0x001 ReadImageFileExecOptions : UChar<br />
   +0x002 BeingDebugged    : UChar<br />
   +0x003 BitField         : UChar<br />
   +0x003 ImageUsesLargePages : Pos 0, 1 Bit<br />
   +0x003 IsProtectedProcess : Pos 1, 1 Bit<br />
   +0x003 IsLegacyProcess  : Pos 2, 1 Bit<br />
   +0x003 IsImageDynamicallyRelocated : Pos 3, 1 Bit<br />
   +0x003 SkipPatchingUser32Forwarders : Pos 4, 1 Bit<br />
   +0x003 SpareBits        : Pos 5, 3 Bits<br />
   +0x008 Mutant           : Ptr64 Void<br />
   +0x010 ImageBaseAddress : Ptr64 Void<br />
   +0x018 Ldr              : Ptr64 _PEB_LDR_DATA<br />
   +0x020 ProcessParameters : Ptr64 _RTL_USER_PROCESS_PARAMETERS<br />
   +0x028 SubSystemData    : Ptr64 Void<br />
   +0x030 ProcessHeap      : Ptr64 Void<br />
   +0x038 FastPebLock      : Ptr64 _RTL_CRITICAL_SECTION<br />
   +0x040 AtlThunkSListPtr : Ptr64 Void<br />
   +0x048 IFEOKey          : Ptr64 Void<br />
   +0x050 CrossProcessFlags : Uint4B<br />
   +0x050 ProcessInJob     : Pos 0, 1 Bit<br />
   +0x050 ProcessInitializing : Pos 1, 1 Bit<br />
   +0x050 ProcessUsingVEH  : Pos 2, 1 Bit<br />
   +0x050 ProcessUsingVCH  : Pos 3, 1 Bit<br />
   +0x050 ReservedBits0    : Pos 4, 28 Bits<br />
   +0x058 KernelCallbackTable : Ptr64 Void<br />
   +0x058 UserSharedInfoPtr : Ptr64 Void<br />
   +0x060 SystemReserved   : [1] Uint4B<br />
   +0x064 SpareUlong       : Uint4B<br />
   +0x068 SparePebPtr0     : Uint8B<br />
   +0x070 TlsExpansionCounter : Uint4B<br />
   +0x078 TlsBitmap        : Ptr64 Void<br />
   +0x080 TlsBitmapBits    : [2] Uint4B<br />
   +0x088 ReadOnlySharedMemoryBase : Ptr64 Void<br />
   +0x090 HotpatchInformation : Ptr64 Void<br />
   +0x098 ReadOnlyStaticServerData : Ptr64 Ptr64 Void<br />
   +0x0a0 AnsiCodePageData : Ptr64 Void<br />
   +0x0a8 OemCodePageData  : Ptr64 Void<br />
   +0x0b0 UnicodeCaseTableData : Ptr64 Void<br />
   +0x0b8 NumberOfProcessors : Uint4B<br />
   +0x0bc NtGlobalFlag     : Uint4B<br />
   +0x0c0 CriticalSectionTimeout : _LARGE_INTEGER<br />
   +0x0c8 HeapSegmentReserve : Uint8B<br />
   +0x0d0 HeapSegmentCommit : Uint8B<br />
   +0x0d8 HeapDeCommitTotalFreeThreshold : Uint8B<br />
   +0x0e0 HeapDeCommitFreeBlockThreshold : Uint8B<br />
   +0x0e8 NumberOfHeaps    : Uint4B<br />
   +0x0ec MaximumNumberOfHeaps : Uint4B<br />
   +0x0f0 ProcessHeaps     : Ptr64 Ptr64 Void<br />
   +0x0f8 GdiSharedHandleTable : Ptr64 Void<br />
   +0x100 ProcessStarterHelper : Ptr64 Void<br />
   +0x108 GdiDCAttributeList : Uint4B<br />
   +0x110 LoaderLock       : Ptr64 _RTL_CRITICAL_SECTION<br />
   +0x118 OSMajorVersion   : Uint4B<br />
   +0x11c OSMinorVersion   : Uint4B<br />
   +0x120 OSBuildNumber    : Uint2B<br />
   +0x122 OSCSDVersion     : Uint2B<br />
   +0x124 OSPlatformId     : Uint4B<br />
   +0x128 ImageSubsystem   : Uint4B<br />
   +0x12c ImageSubsystemMajorVersion : Uint4B<br />
   +0x130 ImageSubsystemMinorVersion : Uint4B<br />
   +0x138 ActiveProcessAffinityMask : Uint8B<br />
   +0x140 GdiHandleBuffer  : [60] Uint4B<br />
   +0x230 PostProcessInitRoutine : Ptr64     void<br />
   +0x238 TlsExpansionBitmap : Ptr64 Void<br />
   +0x240 TlsExpansionBitmapBits : [32] Uint4B<br />
   +0x2c0 SessionId        : Uint4B<br />
   +0x2c8 AppCompatFlags   : _ULARGE_INTEGER<br />
   +0x2d0 AppCompatFlagsUser : _ULARGE_INTEGER<br />
   +0x2d8 pShimData        : Ptr64 Void<br />
   +0x2e0 AppCompatInfo    : Ptr64 Void<br />
   +0x2e8 CSDVersion       : _UNICODE_STRING<br />
   +0x2f8 ActivationContextData : Ptr64 _ACTIVATION_CONTEXT_DATA<br />
   +0x300 ProcessAssemblyStorageMap : Ptr64 _ASSEMBLY_STORAGE_MAP<br />
   +0x308 SystemDefaultActivationContextData : Ptr64 _ACTIVATION_CONTEXT_DATA<br />
   +0x310 SystemAssemblyStorageMap : Ptr64 _ASSEMBLY_STORAGE_MAP<br />
   +0x318 MinimumStackCommit : Uint8B<br />
   +0x320 FlsCallback      : Ptr64 _FLS_CALLBACK_INFO<br />
   +0x328 FlsListHead      : _LIST_ENTRY<br />
   +0x338 FlsBitmap        : Ptr64 Void<br />
   +0x340 FlsBitmapBits    : [4] Uint4B<br />
   +0x350 FlsHighIndex     : Uint4B<br />
   +0x358 WerRegistrationData : Ptr64 Void<br />
   +0x360 WerShipAssertPtr : Ptr64 Void</code></span></span></p>
<p style="text-align: left;"><span>PEB and pointers to process heap (p. 340) - <em>couldn&#8217;t find them after PEB on x86 and x64. Needs more clarification: </em></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>7: kd&gt; !peb<br />
PEB at 7ffdb000<br />
[...]</code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>7: kd&gt; dt _PEB<br />
ntdll!_PEB<br />
[...]<br />
   +0x22c FlsHighIndex     : Uint4B</code></span></span></p>
<p style="text-align: left;"><span><span style="font-size: xx-small;"><code>7: kd&gt; dd 7ffdb000 +0x22c +4<br />
7ffdb230  00000000 00000000 00000000 00000000<br />
7ffdb240  00000000 00000000 00000000 00000000<br />
7ffdb250  00000000 00000000 00000000 00000000<br />
7ffdb260  00000000 00000000 00000000 00000000<br />
7ffdb270  00000000 00000000 00000000 00000000<br />
7ffdb280  00000000 00000000 00000000 00000000<br />
7ffdb290  00000000 00000000 00000000 00000000<br />
7ffdb2a0  00000000 00000000 00000000 00000000</code></span><br />
</span></p>
<p style="text-align: left;"><em></em></p>
<p><span>- <span>Dmitry</span> <span>Vostokov</span> @ </span><a href="http://www.softwaregeneralist.com/"><span><span>SoftwareGeneralist</span>.com</span></a> -</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwaregeneralist.com/2010/01/04/reading-notebook-04-january-10/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading Notebook: 07-December-09</title>
		<link>http://www.softwaregeneralist.com/2009/12/08/reading-notebook-07-december-09/</link>
		<comments>http://www.softwaregeneralist.com/2009/12/08/reading-notebook-07-december-09/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 10:21:04 +0000</pubDate>
		<dc:creator>Dmitry Vostokov</dc:creator>
		
		<category><![CDATA[Notes on Advanced .NET Debugging]]></category>

		<category><![CDATA[Notes on Advanced Windows Debugging]]></category>

		<category><![CDATA[Notes on Windows Internals]]></category>

		<category><![CDATA[Reading Notebook]]></category>

		<guid isPermaLink="false">http://www.softwaregeneralist.com/?p=93</guid>
		<description><![CDATA[Comments in italics are mine and express my own views, thoughts and opinions
Windows Internals by M. Russinovich, D. Solomon and A. Ionescu:
WMI CIM Studio (pp. 321 - 322)
dynamic and static MOF classes (p. 323) 
WbemTest, BMF (binary MOF), Mofcomp.exe (p. 323)
Object keys as WMI class instance specifiers (\\computer\root\namespace:class_name.Key1=&#8221;&#8230;&#8221;, Key2=&#8221;&#8230;&#8221;, &#8230; ) (pp. 324 - 325)
WMI association classes (p. [...]]]></description>
			<content:encoded><![CDATA[<p><em>Comments in italics are mine and express my own views, thoughts and opinions</em></p>
<p style="text-align: left;"><strong><span>Windows Internals by M. <span>Russinovich</span>, D. Solomon and A. <span>Ionescu</span>:</span></strong></p>
<p style="text-align: left;">WMI CIM Studio (pp. 321 - 322)</p>
<p style="text-align: left;">dynamic and static MOF classes (p. 323) </p>
<p style="text-align: left;"><span><span>WbemTest</span>, BMF (binary MOF), <span>Mofcomp</span>.exe (p. 323)</span></p>
<p style="text-align: left;"><span>Object keys as WMI class instance specifiers (\\computer\root\<span>namespace</span>:class_name.Key1=&#8221;&#8230;&#8221;, Key2=&#8221;&#8230;&#8221;, &#8230; ) (pp. 324 - 325)</span></p>
<p style="text-align: left;">WMI association classes (p. 325) </p>
<p style="text-align: left;"><span>WQL <span>exampe</span> (p. 327)</span></p>
<p style="text-align: left;"><span><span>wmiprvse</span>.<span>exe</span> as a WMI provider host (p. 327)</span></p>
<p style="text-align: left;"><span><span>wmic</span>.<span>exe</span> (p. 328)</span></p>
<p style="text-align: left;"><span><span>Namespace</span> level WMI <span>secutiry</span> (p. 329)</span></p>
<p style="text-align: left;"><span>WDI, Windows Diagnostic Infrastructure and its instrumentation, <span>DiagLog</span>, SEM Scenario Event Mapper, on-demand diagnosis (pp. 329 - 330) - </span><em><span>looks interesting, especially in the context of possible first fault software problem solving techniques (<span><a href="http://www.opentask.com/" target="_blank">OpenTask</a></span> has published a book on this topic: </span></em><a href="http://www.dumpanalysis.com/First+Fault+Software+Problem+Solving"><em>http://www.dumpanalysis.com/First+Fault+Software+Problem+Solving</em></a><em>)</em></p>
<p style="text-align: left;"><strong><span>Advanced Windows Debugging by M. <span>Hewardt</span> and D. <span>Pravat</span>:</span></strong></p>
<p style="text-align: left;">LRPC_CCALL(ADDRESS) vs. OSF_CCALL(ADDRESS) vs. DG_CCALL(ADDRESS) (pp. 389 - 390)</p>
<p style="text-align: left;">Undocumented MSRPC (p. 391) - <em>there is an empirical technique to find LRPC server endpoint: </em><a href="http://www.dumpanalysis.org/blog/index.php/2008/07/11/in-search-of-lost-pid/"><em><span>http://www.dumpanalysis.org/blog/index.<span>php</span>/2008/07/11/in-search-of-lost-<span>pid</span>/</span></em></a></p>
<p style="text-align: left;">!lpc message (p. 393) - <em>some additional scenarios can be found in patterns: </em><a href="http://www.dumpanalysis.org/blog/index.php/2008/12/17/crash-dump-analysis-patterns-part-42e/"><em><span>http://www.dumpanalysis.org/blog/index.<span>php</span>/2008/12/17/crash-dump-analysis-patterns-part-42e/</span></em></a><em>, </em><a href="http://www.dumpanalysis.org/blog/index.php/2007/11/29/crash-dump-analysis-patterns-part-9d/"><em><span>http://www.dumpanalysis.org/blog/index.<span>php</span>/2007/11/29/crash-dump-analysis-patterns-part-9d/</span></em></a><em> and various case studies involving LPC chains: </em><a href="http://www.dumpanalysis.org/blog/index.php/pattern-cooperation/"><em><span>http://www.dumpanalysis.org/blog/index.<span>php</span>/pattern-cooperation/</span></em></a></p>
<p style="text-align: left;">_PS_IMPERSONATION_INFORMATION (p. 395) - <em>Looks like on W2K8 x64 it is another bit union:</em></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code><span><span>lkd</span>&gt; <span>dt</span> -r _ETHREAD</span><br />
[&#8230;]<br />
  +0&#215;3b0 ClientSecurity   : _PS_CLIENT_SECURITY_CONTEXT<br />
<span>      +0&#215;000 <span>ImpersonationData</span> : Uint8B</span><br />
      +0&#215;000 ImpersonationToken : Ptr64 Void<br />
<span>      +0&#215;000 <span>ImpersonationLevel</span> : <span>Pos</span> 0, 2 Bits</span><br />
      +0&#215;000 EffectiveOnly    : Pos 2, 1 Bit</code></span></p>
<p style="text-align: left;">RPC cell debugging configuration (pp. 397 - 398)</p>
<p style="text-align: left;"><strong><span>Advanced .NET Debugging by M. <span>Hewardt</span>:</span></strong></p>
<p style="text-align: left;"><span><span>Lutz</span> <span>Roeder&#8217;s</span> .NET Reflector (pp. 15 - 16)</span></p>
<p style="text-align: left;"><span>Roberto Farah&#8217;s <span>PowerDbg</span> (pp. 17 -18)</span></p>
<p style="text-align: left;">MDA Managed Debugging Assistants (pp. 19 - 21) - <em><span>looks similar to WDI (Windows Diagnostic Infrastructure) on-demand diagnostics for <span>unmanaged</span> code mentioned in Windows Internals book</span></em></p>
<p style="text-align: left;">CLI(+BCL) -&gt; CLR (p. 24)</p>
<p style="text-align: left;">Rotor (p. 25) - <em><span>looks like it has the same value as WINE for <span>unmanaged</span> code: </span></em><a href="http://www.dumpanalysis.org/blog/index.php/2006/11/16/how-wine-can-help-in-crash-dump-analysis/"><em>http://www.dumpanalysis.org/blog/index.php/2006/11/16/how-wine-can-help-in-crash-dump-analysis/</em></a> </p>
<p style="text-align: left;"><span>- <span>Dmitry</span> <span>Vostokov</span> @ </span><a href="http://www.softwaregeneralist.com/"><span><span>SoftwareGeneralist</span>.com</span></a> -</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwaregeneralist.com/2009/12/08/reading-notebook-07-december-09/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Reading Notebook: 25-November-09</title>
		<link>http://www.softwaregeneralist.com/2009/11/25/reading-notebook-25-november-09/</link>
		<comments>http://www.softwaregeneralist.com/2009/11/25/reading-notebook-25-november-09/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 22:48:30 +0000</pubDate>
		<dc:creator>Dmitry Vostokov</dc:creator>
		
		<category><![CDATA[Notes on Advanced .NET Debugging]]></category>

		<category><![CDATA[Notes on Windows Internals]]></category>

		<category><![CDATA[Reading Notebook]]></category>

		<guid isPermaLink="false">http://www.softwaregeneralist.com/?p=92</guid>
		<description><![CDATA[Comments in italics are mine and express my own views, thoughts and opinions
Windows Internals by M. Russinovich, D. Solomon and A. Ionescu:
FailureActionsOnNonCrashFailures (p. 310)
WaitToKillApp(Service)Timeout (p. 311)
Shutdown ordering and preshutdown notification (pp. 312 - 313)
Shared services vulnerability to a crashing bug (p. 313) - Because an exception in one thread doesn&#8217;t affect another thread if there [...]]]></description>
			<content:encoded><![CDATA[<p><em>Comments in italics are mine and express my own views, thoughts and opinions</em></p>
<p style="text-align: left;"><strong>Windows Internals by M. Russinovich, D. Solomon and A. Ionescu:</strong></p>
<p style="text-align: left;">FailureActionsOnNonCrashFailures (p. 310)</p>
<p style="text-align: left;">WaitToKillApp(Service)Timeout (p. 311)</p>
<p style="text-align: left;">Shutdown ordering and preshutdown notification (pp. 312 - 313)</p>
<p style="text-align: left;">Shared services vulnerability to a crashing bug (p. 313) - <em>Because an exception in one thread doesn&#8217;t affect another thread if there is no dependency (see MTCrash application, </em><a href="http://www.dumpanalysis.org/blog/index.php/2008/12/31/mtcrash/"><em>http://www.dumpanalysis.org/blog/index.php/2008/12/31/mtcrash/</em></a><em>) if we preserve the crashed process, for example, using Crash2Hang tool (</em><a href="http://www.dumpanalysis.org/blog/index.php/2008/12/29/crash2hang/"><em>http://www.dumpanalysis.org/blog/index.php/2008/12/29/crash2hang/</em></a><em>) we might temporarily preserve functionality of the remaining services (if there is no dependency)</em></p>
<p style="text-align: left;">CNG-KeyIso service (p. 313)</p>
<p style="text-align: left;">Viewing services inside processes (pp. 315 - 316) - <em>We can also see them in Task Manager when we sort Processes by PID:</em></p>
<p style="text-align: left;"><img src="http://softwaregeneralist.com/files/ServicesInsideProcesses.jpg" alt="" /></p>
<p style="text-align: left;">SubProcessTag (p. 316) - <em>Here is an example from svchost.exe PID 1016 from the screenshot above:</em></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>lkd&gt; !process 0n1016 1f<br />
Searching for Process with Cid == 3f8<br />
Cid Handle table at fffff88008156000 with 1063 Entries in use<br />
PROCESS fffffa8004adec10<br />
    SessionId: 0  Cid: 03f8    Peb: 7fffffdd000  ParentCid: 0280<br />
    DirBase: add75000  ObjectTable: fffff88007f3c4d0  HandleCount: 436.<br />
    Image: svchost.exe<br />
    VadRoot fffffa80048b9220 Vads 153 Clone 0 Private 1630. Modified 1512. Locked 6.<br />
    DeviceMap fffff8800802ef40<br />
    Token                             fffff880080aa060<br />
    ElapsedTime                       5 Days 01:31:56.632<br />
    UserTime                          00:00:05.257<br />
    KernelTime                        00:00:04.555<br />
    QuotaPoolUsage[PagedPool]         132496<br />
    QuotaPoolUsage[NonPagedPool]      21488<br />
    Working Set Sizes (now,min,max)  (3650, 50, 345) (14600KB, 200KB, 1380KB)<br />
    PeakWorkingSetSize                3725<br />
    VirtualSize                       78 Mb<br />
    PeakVirtualSize                   84 Mb<br />
    PageFaultCount                    38144<br />
    MemoryPriority                    BACKGROUND<br />
    BasePriority                      8<br />
    CommitCharge                      3976</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>[...]</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>        THREAD fffffa8004b55060  Cid 03f8.046c  <font color="blue">Teb: 000007fffff9e000</font> Win32Thread: 0000000000000000 WAIT: (UserRequest) UserMode Alertable<br />
            fffffa8004b54a80  NotificationEvent<br />
            fffffa8004b52a50  SynchronizationEvent<br />
            fffffa8004b55e00  NotificationEvent<br />
            fffffa8004b55118  NotificationTimer<br />
        Not impersonating<br />
        DeviceMap                 fffff8800802ef40<br />
        Owning Process            fffffa8004adec10       Image:         svchost.exe<br />
        Attached Process          N/A            Image:         N/A<br />
        Wait Start TickCount      28044441       Ticks: 4968 (0:00:01:17.501)<br />
        Context Switch Count      3784            <br />
        UserTime                  00:00:00.000<br />
        KernelTime                00:00:00.000<br />
        Win32 Start Address dhcpcsvc6!Dhcpv6Main (0&#215;000007fefd726884)<br />
        Stack Init fffffa6003c47db0 Current fffffa6003c47230<br />
        Base fffffa6003c48000 Limit fffffa6003c42000 Call 0<br />
        Priority 9 BasePriority 8 PriorityDecrement 0 IoPriority 2 PagePriority 5<br />
        Child-SP          RetAddr           Call Site<br />
        fffffa60`03c47270 fffff800`018a46fa nt!KiSwapContext+0&#215;7f<br />
        fffffa60`03c473b0 fffff800`018a9feb nt!KiSwapThread+0&#215;13a<br />
        fffffa60`03c47420 fffff800`01b03a8e nt!KeWaitForMultipleObjects+0&#215;2eb<br />
        fffffa60`03c474a0 fffff800`01b040d3 nt!ObpWaitForMultipleObjects+0&#215;26e<br />
        fffffa60`03c47960 fffff800`018a1ef3 nt!NtWaitForMultipleObjects+0xe2<br />
        fffffa60`03c47bb0 00000000`776e72ca nt!KiSystemServiceCopyEnd+0&#215;13 (TrapFrame @ fffffa60`03c47c20)<br />
        00000000`0272f5e8 00000000`7758bc03 ntdll!ZwWaitForMultipleObjects+0xa<br />
        00000000`0272f5f0 000007fe`fd726117 kernel32!WaitForMultipleObjectsEx+0&#215;10b<br />
        00000000`0272f700 000007fe`fd726944 dhcpcsvc6!ProcessDhcpv6RequestForever+0&#215;143<br />
        00000000`0272f7c0 00000000`7758be3d dhcpcsvc6!Dhcpv6Main+0xc0<br />
        00000000`0272f800 00000000`776c6a51 kernel32!BaseThreadInitThunk+0xd<br />
        00000000`0272f830 00000000`00000000 ntdll!RtlUserThreadStart+0&#215;1d</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>[...]</code></span></p>
<p style="text-align: left;"><span style="font-size: xx-small;"><code>lkd&gt; dt _TEB 000007fffff9e000 SubProcessTag<br />
ntdll!_TEB<br />
   +0x1720 SubProcessTag : 0x00000000`00000011</code></span></p>
<p style="text-align: left;"><strong>Advanced .NET Debugging by M. Hewardt:</strong></p>
<p style="text-align: left;">Debugging Tools for Windows (pp. 3 -4) - <em>Here are quick links for download: </em><a href="http://windbg.org"><em>http://windbg.org</em></a></p>
<p style="text-align: left;">No major CLR changes for .NET 3.x (p. 5)</p>
<p style="text-align: left;">DbgClr (p. 6)</p>
<p style="text-align: left;">MSBUILD XML example (pp. 6 - 7)</p>
<p style="text-align: left;">.load vs. .loadby (pp. 8 - 11) - <em>Some additional load scenarios for legacy SOS and its server version can be found in comments to Managed Code Exception pattern: </em><a href="http://www.dumpanalysis.org/blog/index.php/2007/07/20/crash-dump-analysis-patterns-part-17/"><em>http://www.dumpanalysis.org/blog/index.php/2007/07/20/crash-dump-analysis-patterns-part-17/</em></a></p>
<p style="text-align: left;">SOSEX (pp. 10 - 11) - <em>Added to my blog roll and links on </em><a href="http://DumpAnalysis.org"><em>http://DumpAnalysis.org</em></a></p>
<p style="text-align: left;">CLR Profiler (pp. 11 - 13) - <em>Looks similar to functionality of unmanaged UMDH tool (user mode heap stack trace database)</em></p>
<p style="text-align: left;">- Dmitry Vostokov @ <a href="http://www.softwaregeneralist.com/">SoftwareGeneralist.com</a> -</p>
]]></content:encoded>
			<wfw:commentRss>http://www.softwaregeneralist.com/2009/11/25/reading-notebook-25-november-09/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
