Welcome to MSDN Blogs Sign in | Join | Help

We had two interesting days as outlined in Kernel Debugging Day 1 - Interesting snippets of information for debugging in the trenches and Kernel Debugging Day 2 - Interesting snippets of information for debugging in the trenches. Today was a journey at Mach 3 … I need the weekend to do a core brain dump and assimilate what ‘Roy’ has taught us in three very-fast paced, in-depth, guided and extremely interesting days. Therefore you will find no detailed step through today … I will continue this thread after digesting everything and once I start using the WinDBG debugger as a friend, not a strange and powerful alien :)

image The commands have multiplied and I decided to combine all of the commands I used over these three days in one consolidated table. Note that this with (hang) in the description are good starting points when analysing a crash dump that is concerned with a hang condition.

So, we promised no detailed step-through, but should at least look at one of the “hang” dumps:

  • We open he crash dump with WinDBG as usual.
  • Run !analyze –v to get detailed debugging information.
  • Run .trap … to display the trap frame register state and also sets the register context.
    image
  • Run knv to display the stack trace 
     image
  • Run up @eip to show the code at the point of disaster
    image
  • Run r to display the registers 
    image
  • Run !vm to display virtual memory usage, whereby we take note of the pool allocation warning:
    image
  • In the analysis we dug into the code, looked at what the cause could be by following the assembly code in reverse. In essence we have run out of pool memory and the statement “rep stos dword ptr es:[edi]”, which is a memset, fails because the pointer we are working with is invalid.
  • Run !process 0 0 … and we notice that process WRSSSDK is not releasing its handles. Common mistake when creating a thread and not closing the handle once the thread has said goodbye.
    image 

That’s it …

Clipart Illustration of a Full Classroom Of Students Sitting In Their School Desks And Listening To Their Professor As He Stands At A Chalkboard Have a look at the www.codemachine.com and their training programs, which are definitely worth it! Tilakraj ‘Roy’ Roychoudhury had to contend with a classroom full of keen software engineers, most of whom have never and will probably never develop and debug kernel mode drivers, yet he managed to bring all of us home and share an immense amount of knowledge.

Thank you ‘Roy’ … it was a real adventure :)

What I admire about Canada and especially the Microsoft Canada Development Centre is the diversity of cultures and continuous innovations at work, in the communities and now in the kitchen.

"Hot off the press" ... MCDC has just released its International Cookbook, which combines the large variety and fascination of cultures. If you love cooking and or food, this is a book you need to get yourself a copy.

image … it contains 37 gems from all over the world!

Well, I recently CC’d a distribution list to trigger awareness around a new member who had joined the Rangers initiatives and the following response from Robert was just classic: “Welcome […] to the hardest working Microsoft community :)”.

We may not be the largest community, but we are definitely a passionate and competent technology family made up of members from the Microsoft Product Group, Microsoft Services, Microsoft Most valued Professionals and other partners working on strategic solutions.

Find more information on the Rangers and their solutions at VSTS Rangers Home.

Here is a snapshot of the current members for whom I have managed to obtain a photo … there are many more:

image

Two of these Rangers will soon be completing a sabbatical with the TFS Integration Platform team and we are looking forward to hearing all about their experience from their own keyboard :) My sabbatical is already years back, but I definitely remember the very special baseball game that Bill (7th gentlemen from the left, top row) took me to.

The dust is settling after the TFS Integration Platform “Alpha” shipped, although the downloads indicate that the dust is far from over.

imageWhile the platform team is working on the BETA release, the Rangers are continuing with the samples for the custom adapter developers and helping partners to figure out what needs to be planned for a potential migration. While the migration guidance, getting started and other documentation, which you can find on the Codeplex site, will get you into the right mindset and prepared for a possible migration or synchronisation, a great deal of planning and analysis is needed to make the experience a painless and successful one.

We have started creating a batch of questions that we feel should be asked and answered. To ensure that we close the loop as much as possible, we would appreciate if you could give the list a quick scan and give us your comments in terms of the questions.

If you have a need for migration and synchronization I recommend that you visit Team Foundation Server Migration and Integration Solutions as your first stop and then TFS Integration Platform.

  • Version Control Specific

    • What migration / synchronisation type are you considering?

    • What is your definition of required history?

    • What volume of data in terms of MB and number of files is involved?

    • What is the overall project structure?

    • What is the priority/ranking of migrating/sync’ing the project version control?

    • What does your branching structure look like on the source?

    • What does your branching structure look like on the target?

    • Is it necessary to keep current parent-child relationship between branches ?

    • What are the dependencies between projects ?

    • What is the manual process of migrating/sync’ing the data?

    • What trigger are you expecting? Manual or automatic? In case of latter timer or event based?

    • What is the evaluation and validation process and criteria? What makes the use case a win?

  • Work item Specificimage

    • What migration / synchronisation type are you considering?

    • What is your definition of required history?

    • What are the linking requirements?

    • What volume of data in terms number of work items and revisions is involved?

    • What is the overall project structure?

    • What is the priority/ranking of migrating/sync’ing the project work items?

    • What does your process template (fields and states) look like on the source?

    • What does your process template (fields and states) look like on the target?

    • What are the field and state mapping rules?

    • What trigger are you expecting? Manual or automatic? In case of latter timer or event based?

    • What is the evaluation and validation process and criteria? What makes the use case a win?

    • Are we supposed to migrate attachments ?

    • Are there any many-to-one field mappings ?

We have not forgotten the time and capacity planning, which is the area that is still marked as “under construction” on the migration guidance poster you find on Codeplex.

This post continues on day 2 of a debugging adventure we started in Kernel Debugging Day 1 - Interesting snippets of information for debugging in the trenches. Today the spinning heads were still there … just spinning a lot faster, screaming for the caffeine boost regularly.

Some random, but interesting information I made a note of today
CLIPART_OF_10868_SM_thumb2

Did you know … that:

  1. KeBugCheckEx is the kernel ejection seat, which brings down the system in a controlled manner when the kernel discovers an unrecoverable inconsistency?
    P7060036 
  2. PDO stands for physical device object, which us always the bottom most driver in the devstack, FDO stands for function driver object, highlighted as servicename? Any drivers above FTO are filters? 
    kd> !drvobj pci
    Driver object (81238050) is for:
    \Driver\PCI
    Driver Extension List: (id , addr)

    Device Object list:
    81264668  812659a0  81265ce8  81265030
    81292438  81292780  81292ac8  81292ca8
    81292020  81293030  81201490  81201680
    81201870  81201a60  81201c50  81201e40
    81238620 
    kd> !devstack 81264668 
      !DevObj   !DrvObj            !DevExt   ObjectName
      ffbb4038  \Driver\abcmtag    ffbb40f0  Video0
      81264298  \Driver\agp440     81264350  
      812643f8  \Driver\ACPI       8129a450  00000056
    > 81264668  \Driver\PCI        81264720  ABCPNP_PCI0013
    !DevNode 81264160 :
      DeviceInst is "PCI\VEN_1002&DEV_4C59&SUBSYS_001A103C&REV_00\4&74c6020&0&0008"
      ServiceName is "abctag”

  3. imageIRP stands for I/O Request Packet. It is the basic I/O manager structure used to communicate with drivers and to allow drivers to communicate with each other, which involves two important functions are IoCallDriver and IoCompleteRequest, as shown in diagram. 
     
  4. IRQL stands for interrupt request level and defines the hardware priority at which a processor operates at any given time.

Some more Important Commands
CLIPART_OF_31354_SMJPG_thumb10 

Command

description from WinDBG Help (go there for detailed help!)

!address displays information about the memory that the target process or target computer uses.
!pte displays the page table entry (PTE) and page directory entry (PDE) for the specified address.
.cxr displays the context record saved at the specified address. It also sets the register context.
.kFrames sets the default length of a stack trace display, i.e. 0n256 = 256 length

More analysis of crash dumps?
----------------------------------

Instead of boring everyone with more crash dump crawl through, giving us all an opportunity to get some real sleep for a  change and allowing our spinning heads to calm down for day 3, I will simply highlight a few cool things I picked up during one of the crash dump analysis.

Figuring our the arguments

Let’s assume we are starting at the following code and would like to know what data is passed to the swprintf function.

  1. 0: kd> kvn
  2. # ChildEBP RetAddr Args to Child
  3. 00 eb45ba8c 8046305e eb45baa4 eb369ca8 eb45bae8 nt!_woutput+0x463 (FPO: [Non-Fpo])
  4. 01 eb45bac4 eb369daa eb45bb08 eb369c74 eb45bd08 nt!swprintf+0x2e (FPO: [Non-Fpo])
  5. 02 eb45bd60 805023a8 857de298 857de288 80477abc ABCM+0x1daa
  6. 03 eb45bd78 804176b5 857de288 00000000 00000000 nt!SepNotifyFileSystems+0x32 (FPO: [Non-Fpo])
  7. 04 eb45bda8 804565fc 857de288 00000000 00000000 nt!ExpWorkerThread+0xaf (FPO: [Non-Fpo])
  8. 05 eb45bddc 8046b6a6 80417606 00000001 00000000 nt!PspSystemThreadStartup+0x54 (FPO: [Non-Fpo])
  9. 06 00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x16

From online documentation we know that we are passing an address to a buffer, formatting information and a variable number of data arguments. To begin we display the contents of the two arguments on the stack, highlighted in the above code:

  1. 0: kd> du /c 100 eb45bb08
  2. eb45bb08 "System:8 60 LOGOFF 000D0F0A: \\蔍뮘.ᥐ薂.."
  3. 0: kd> du /c 100 eb369c74
  4. eb369c74 "%s %d LOGOFF %08I64X: \\%s\%s %I64d Hours %I64d Minutes"

Line two above, shows the data and some strange characters towards the end. The following code is colour coded, to match the format string tokens with the data. Note that the addresses in lines 11 and 12 below are suspect. Also note that the data starts at ebp + 8 on the stack … just something we should all know when we are born.

image

To prove this, we check the first one out a bit more:

  1. 0: kd> !pte 05000000
  2. 05000000 - PDE at C0300050 PTE at C0014000
  3. contains 00000000 unavailable

… that explains the crash we were looking at.

Figuring out a function internals

Let’s look at the same stack frame and figure out how we can display the complete code for the function that calls swprintf:

image

imageThe trick is to

  1. Take the return address on line 6, which is the address to function (Y) where we will return after calling the function (X) that calls swprintf … puzzled? I was … therefore my cryptographic sketch on the right.
  2. Then use the ub (determines the memory range to disassemble by counting backward) command to display the calling function backwards from the point of return to find the call to function Y.
  3. Then use the uf (displays an assembly translation of the specified function in memory) command to display the function X and find the call to swprintf.

Let’s do it, as Zayd would say.

  1. 0: kd> ub 805023a8
  2. nt!SepNotifyFileSystems+0x19:
  3. 8050238f e89c3af6ff call nt!ExAcquireFastMutexUnsafe (80465e30)
  4. 80502394 8b3570744780 mov esi,dword ptr [nt!SeFileSystemNotifyRoutinesHead (80477470)]
  5. 8050239a 85f6 test esi,esi
  6. 8050239c 7410 je nt!SepNotifyFileSystems+0x38 (805023ae)
  7. 8050239e 8b4508 mov eax,dword ptr [ebp+8]
  8. 805023a1 8d5810 lea ebx,[eax+10h]
  9. 805023a4 53 push ebx
  10. 805023a5 ff5604 call dword ptr [esi+4]

Line 10 above is the actual call to function (X), which gives us the start address of the function. To figure out the address we need to work out where esi is set and that happens on line 4. So …

  1. 0: kd> dps 80477470 L1
  2. 80477470 e3c2d4c8
  3. 0: kd> dps e3c2d4c8+4 L1
  4. e3c2d4cc eb369ce4 ABCM+0x1ce4

On Line 1 we display the memory at the address as seen on line 4 in the previous code block and highlighted in red. We know now the value of esi, we add 4 as the statements states [esi+4] and display the memory. Line 4 gives us the starting address of function (X) on our diagram.

next we execute a uf command to list the complete function. I am only showing extracts, else you would scroll through assembler code forever:

  1. 0: kd> uf ABCM+0x1ce4
  2. ABCM+0x1ce4:
  3. eb369ce4 55 push ebp
  4. eb369ce5 8bec mov ebp,esp
  5. eb369ce7 81ec58020000 sub esp,258h
  6. eb369ced 56 push esi
  7. eb369cee ff7508 push dword ptr [ebp+8]
  8. eb369cf1 e88eeaffff call ABCM+0x784 (eb368784)
  9. eb369cf6 8bf0 mov esi,eax
  10. eb369cf8 85f6 test esi,esi
  11. eb369cfa 0f84d4000000 je ABCM+0x1dd4 (eb369dd4)
  12. ABCM+0x1d00:
  13. eb369d00 53 push ebx
  14. …cut code…
  15. eb369d29 8b4008 mov eax,dword ptr [eax+8]
  16. ABCM+0x1d2c:
  17. eb369d2c 3bf8 cmp edi,eax
  18. eb369d2e 75fc jne ABCM+0x1d2c (eb369d2c)
  19. ABCM+0x1d30:
  20. eb369d30 ff15288336eb call dword ptr [ABCM+0x328 (eb368328)]
  21. …cut code…Blue Doctor Man Sitting at a Computer and Viewing an Xray of a Head Clipart Illustration
  22. eb369d98 8d85a8fdffff lea eax,[ebp-258h]
  23. eb369d9e 68749c36eb push offset ABCM+0x1c74 (eb369c74)
  24. eb369da3 50 push eax
  25. eb369da4 ff15c88236eb call dword ptr [ABCM+0x2c8 (eb3682c8)]
  26. eb369daa 83c430 add esp,30h
  27. eb369dad 8d85a8fdffff lea eax,[ebp-258h]
  28. eb369db3 b900b236eb mov ecx,offset ABCM+0x3200 (eb36b200)
  29. eb369db8 50 push eax
  30. eb369db9 8d45e8 lea eax,[ebp-18h]
  31. eb369dbc 50 push eax
  32. eb369dbd 8d45f0 lea eax,[ebp-10h]
  33. eb369dc0 50 push eax
  34. eb369dc1 e824070000 call ABCM+0x24ea (eb36a4ea)
  35. eb369dc6 50 push eax
  36. eb369dc7 e8d2eaffff call ABCM+0x89e (eb36889e)
  37. eb369dcc 56 push esi
  38. eb369dcd e89ee7ffff call ABCM+0x570 (eb368570)
  39. eb369dd2 5f pop edi
  40. eb369dd3 5b pop ebx
  41. ABCM+0x1dd4:
  42. eb369dd4 5e pop esi
  43. eb369dd5 c9 leave
  44. eb369dd6 c20400 ret 4

If we go back to the stack frame we know that swprintf returns to eb369daa, which means the address before is where we call swprintf. We have reverse engineered our way to the point of calling the function.

Last but not least …

May the force be with us for day 3 … I am off to sleep and to wake up in 4 hours again :| Tomorrow we shall introduce the presenter and the company delivering this exceptional course.

  • .wake command causes sleep mode to end.

Blue Male Doctor In A Lab Coat, Sitting On A Stool And Bandaging A Blue Person That Has Been Hurt On The Head, Arm And Ankle Clipart GraphicContext

Two weeks ago an invite went out for a “Kernel Mode Debugging” course and as I am always interested in debugging and a challenge, I signed up.

That’s where I was today and for the next two days. I have not done any kernel mode development for some time and am not planning to for the foreseeable future … so why am I here? Well, as mentioned, I love the challenge of exploring new things, but more importantly I have always been interested in being able to ponder over a “blue screen” and then be able to analyse and “kind-of-determine” what “could” have happened. 

By the way, if you are interested in debugging you must subscribe to this blog: If broken it is, fix it you should!

Some random, but interesting information I made a note of today
Blue Man Holding a Pencil and Drawing a Circle on a Blueprint Clipart Illustration

Did you know … that:

  1. User mode stack is 1MB by default and kernel mode stack is limited to 12k?
  2. User mode knows a heap and kernel mode a pool?
  3. User mode has the AppVerifier and kernel mode the DriverVerifier?
  4. user mode is at home between addresses 00000000h and 7FFFFFFFh, while kernel mode lives and breathes between 800000000h and FFFFFFFFh?

How are crash dumps created?
Blue Man Leaning Against a Stack of Papers Clipart Illustration

My focus, as mentioned, is not on driver development and debugging, but trying to understand kernel mode crash dumps.

What types of crash dumps do we have?image

  • Small Dump … limited crash dump containing context and stack information for the faulting thread, current tread and process structures, kernel mode list, memory management data structures and pseudo-random pages related to the crash.
  • Kernel Dump … contains resident kernel pages only and NO user mode stack or data. This type is good for blue screen analysis as most blue screens are hardware, driver and kernel mode related.
  • Full Dump … contains the entire physical memory, and both kernel and user mode resident pages. Caution when running on 64-bit systems with lots and lots of RAM … the crash dump file will be huge!

How and when are they created?

  • First we have to configure the system to write a crash dump … see Start-up and Recovery dialog on the right.
  • Important Notes:
    • Crash dumps created soon after system boot can be compressed much better, as the memory space and therefore the crash dump are primarily zeroes. Over time, memory is filled with data and becomes less compressible.
    • The page file must be large enough to accommodate the crash dump, else no crash dump will be created.
    • If you need a tool to force a crash dump, have a look at Bang on Bing.
  • When the system crashes, the physical memory is written to the page file … based on the type of crash dump selected this can range from a few kilobytes to Terabytes on a 64-bit machine.
  • When the system reboots, a special program (savedump.exe) copies the page file contents to the crash dump file.

… so now that we have the basics of crash dumps, what is possible when we are staring at a crash dump file. Today we covered the following scenarios, each of which I will cover briefly. A more detailed walkthrough of these scenarios are beyond the scope of this blog or my understanding … if needed, you best refer to books such as “Advanced Windows Debugging ISBN:0321374460” or “Memory Dump Analysis Anthology”.

Some of the Important Commands
Clipart Illustration of a White Character Taking Notes Down On A Clipboard, A Supervisor, Manager, Or Someone Taking Inventory 

Command with an exclamation mark (!) in front are extensions to WinDBG. To display the extension DLLs, run the command:

kd> .chain
Extension DLL search Path:
c:\windbg\WINXP;c:\windbg\winext;c:\windbg\winext\arcade;c:\windbg\pri;c:\windbg;c:\windbg\winext\arcade;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Windows Imaging\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft Magellan Code Coverage Toolset\;c:\Program Files\System Center Operations Manager 2007\;C:\Program Files\Gumshoe\
Extension DLL chain:
    dbghelp: image 6.11.0001.404, API 6.1.6, built Wed Feb 25 17:55:30 2009
        [path: c:\windbg\dbghelp.dll]
    ext: image 6.11.0001.404, API 1.0.0, built Wed Feb 25 17:55:30 2009
        [path: c:\windbg\winext\ext.dll]
    exts: image 6.11.0001.404, API 1.0.0, built Wed Feb 25 17:55:24 2009
        [path: c:\windbg\WINXP\exts.dll]
    kext: image 6.11.0001.404, API 1.0.0, built Wed Feb 25 17:55:24 2009
        [path: c:\windbg\winext\kext.dll]
    kdexts: image 6.1.7015.0, API 1.0.0, built Wed Feb 25 17:54:56 2009
        [path: c:\windbg\WINXP\kdexts.dll]

To get help for the extensions, run the following command:

kd> !kdexts.help
acpicache [flags]      - Displays cached ACPI tables
acpiinf                      - Displays ACPI Information structure

… outout clipped …

Command

description from WinDBG Help (go there for detailed help!)

!analyze -v displays information about the current exception or bug check.
!devstack displays a formatted view of the device stack associated with a device object.
!drvobj displays detailed information about a DRIVER_OBJECT.
!handle displays information about a handle or handles that one or all processes in the target system own.
!irql displays the interrupt request level (IRQL) of a processor on the target computer before the debugger break.
!memusage displays summary statistics about physical memory use.
!poolused displays memory use summaries, based on the tag used for each pool allocation.
!podev displays the power capabilities of the target computer.
!process displays information about the specified process, or about all processes, including the EPROCESS block.
!pte displays the page table entry (PTE) and page directory entry (PDE) for the specified address.
!ready displays summary information about each thread in the system in a READY state.
!session displays one or more user sessions, or displays a specified process running in multiple user sessions.
!stacks displays information about the kernel stacks.
!teb displays a formatted view of the information in the thread environment block (TEB).
!thread displays summary information about a thread on the target system, including the ETHREAD block.
!vm displays summary information about virtual memory use statistics on the target system.
.reload deletes all symbol information for the specified module and reloads these symbols as needed
.sympath changes the default path of the host debugger for symbol search.
.trap displays the trap frame register state and also sets the register context.
dps The dds (double word), dps (pointer-sized), and dqs (quad-word) commands display the contents of memory in the given range.
kvf, kvn display the stack frame of the given thread, together with related information
lm displays the specified loaded modules.
r displays or modifies registers, floating-point registers, flags, pseudo-registers, and fixed-name aliases.
ub displays an assembly translation of the specified program code in memory.
uf displays an assembly translation of the specified function in memory.
up displays an assembly translation of the specified program code in physical memory.
vertarget displays the current version of the Microsoft Windows operating system of the target computer.

How do we analyse these crash dumps?
Pissed Blue Person Breaking A Flat Screen Computer Monitor With A Hammer Clipart Illustration Graphic

  • ---------------------------------------------------
    Scenario 1 – Light up the driver
    1. Main commands used:
      • !analyze –v
      • dps
      • lmvm
      • .sympath
    2. Extract of crash dump analysis: http://blogs.msdn.com/willy-peter_schaub/pages/kernel-mode-debugging-scenario-identify-the-problematic-driver.aspx
    3. Steps to crash dump analysis:
      • {line:35} We run dps on the work item address as hinted in {line:9,10}. We notice a third-party driver {line40} … the less than friendly driver+address format gives it away.
      • {line:68} lmvm gives us more detail for the cdp driver.
      • {line:78} We load the symbols, by running .sympath
      • {line:83} Running dps again, shows us that the driver has lit up and we even see the offending method.
  • ---------------------------------------------------
    Scenario 2 – Find the module responsible for a crashClipart Illustration of a White Character Inspecting A Laptop Computer With A Magnifying Glass, Over White
    • Main commands used:
      • !analyze –v
      • !devstack
      • !podev
    • Extract of crash dump analysis: http://blogs.msdn.com/willy-peter_schaub/pages/kernel-mode-debugging-scenario-find-the-module-responsible-for-a-crash.aspx
    • Steps to crash dump analysis:
      • {line:24} !analyze –v creates the analysis for easier reading
      • {lines:31-34} The analysis pretty much tells us what the problem is, how to fix it in the driver and who the offending driver is … but for the latter, let’s do a few more steps.
      • {line:92"} !devstack 814a32d0 gives us the device stack and we can see that NTPNP_PCI0005 is the bus driver (bottom) and the others drivers. By the way, we got the address from {line:34}.
      • {lines: 101,109,117 and 125} !podev shows us the power abilities for each driver.
      • {line:107} We notice the invalid power flags, highlighted in yellow and assume that the xyzHostLegacyVideo driver is the area of concern.
      • {line:33} Points us to the same driver … voila, we know who to call.
  • ---------------------------------------------------
    Scenario 3 – Identify the cause of a driver crash
    • Main commands used:
      • !analyze –v
      • !drvobj
      • !irp
    • Extract of crash dump analysis: http://blogs.msdn.com/willy-peter_schaub/pages/kernel-mode-debugging-scenario-identify-the-cause-of-a-driver-crash.aspx
    • Steps to crash dump analysis:
      • {line:17} analyze –v creates the analysis for easier reading
      • {lines 50-60} quite clearly point us towards the dummydma driver as the problem child
      • {line:62"} !drvobj abcdma 2 gives us the dispatch routines for the driver.
      • Option A
        • {line:34} Defines the return address as f90a8799.
        • {lines:94-99} We calculate the address as 799. Looking at the dispatch table we note that IRP_MJ_CLEANUP is closest to this address and hence the likely candidate.
      • Option B – Oh, Oh
        • {line:100} We assume that the second parameter is an IRP (I/O request packet) after reviewing the IoCallDriver method. The !irp 80068f7c command fails?!?
        • {line:37} Note the f, which indicates fast calling method. This means that the IRP is passed in registers, not the call stack.
      • Option C
        • {line:103} We assume the second parameter to the dummydma call is the IRP and call !irp ffb31d48
        • {line:109} The secret is out, the IRP specifies the 12th dispatch routine, which is indeed IRP_MJ_CLEANUP.
      • Option D
        • {line:114} !thread gives us the running thread and on {line:117} the same IRP.

Last but not least …

Just when I felt like one after a head-spinning day, I found this command:

  • !zombies This extension displays all dead ("zombie") processes or threads.

Stock Illustration of a Busy White Person Holding And Talking On Three Corded Telephones What happened to the Rangers? PB030271Why the silence … my apologies, but due to personal circumstances I have been promoted to commander-in-chief at home for 3 weeks, which means I am performing both the mom and dad role at home, the Rangers role at work, attending a kernel debugging course and in between trying to balance all the worlds as time available is typically in the negative. I am not sure whether it is more complex to manage a Rangers project or my sons soccer, swimming, school and extra-curriculum activities … when the dust settles in just under two weeks, I may take some time out and make a decision :) Then again we do not have much dust, because the past 2 weeks have been solid rain, strong winds and chilly temperatures in Vancouver … no, neither swimming (which is mainly in-doors in this country), nor soccer (which is outdoors and the soccer season is winter, not summer as in South-Africa) are cancelled.

Lovely picture of an early fairly clear-sky morning…

The Rangers have been hard at work, getting the completed solutions to ship on Codeplex … we have shipped one and have five in the queue … starting new projects, and continuing work on other currently active projects. One of the imminent ones is the virtualisation initiative, which includes a set of pre-installation and post-installation PowerShell scripts, automating the configuration, optimisation and cleanup of our images generated by the Rangers VM factory.

While the main ship is in awaiting the champagne bottle to strike and notify “shipment”, we have a smaller ship that is piggy-backing on the main initiative and creating automation scripts for the hands-on-lab (HOL) environments each Rangers project must deliver as part of its deliverables. I thought that instead of continued silence I could share one of the scripts that Robert and I have created and have been troubleshooting for a while.

In essence this script creates a set of HOL users and adds them to the relevant Team Foundation Server groups.

   1: # Copyright © Microsoft Corporation.  All Rights Reserved.
   2: # This code released under the terms of the 
   3: # Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
   4: #
   5: #<#  
   6: #.SYNOPSIS  
   7: #   This script configures the enviroment for the hands on labs scenarios.
   8: #    It is only intended to be run after the TFS enviroment is fully configured.
   9: #
  10: #.DESCRIPTION  
  11: #    This script performs the following steps:
  12: #     1) Creates the sample users
  13: #     2) Adds the sample users to the correct TFS groups
  14: #
  15: #.NOTES  
  16: #    File Name  : 3-hol.ps1  
  17: #    Author     : VSTS Rangers 
  18: #    Requires   : PowerShell V1
  19: #
  20: #.LINK  
  21: #   This script posted to:  
  22: #        http://???.codeplex.com 
  23: #    License:
  24: #        http://opensource.org/licenses/ms-pl.html
  25: #
  26: #.EXAMPLE  
  27: # .\3-hol.ps1
  28: #> 
  29:  
  30: #Simply writes a blank to the screen
  31: function blankLine
  32: {
  33:     Write-Host -Object:""
  34: }
  35:  
  36: #Get the machine hostname
  37: $hostname = hostname
  38:  
  39: $projectName = ""
  40:  
  41:  
  42: function introduction
  43: {
  44:     blankLine
  45:     blankLine
  46:     Write-Host -ForegroundColor Yellow -Object "Welcome to the TFS 2010 Virtual Machine Configuration Script - Hands On Labs Setup"
  47:     "
  48:  
  49: Copyright © Microsoft Corporation.  All Rights Reserved.
  50: This code released under the terms of the 
  51: Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)
  52:  
  53: "
  54:     Write-Host -ForegroundColor Red -Object "Note: Please make sure you have checked the README.TXT file for information about pre-requisites and known issues prior to running this script."    
  55: "
  56:  
  57: This script is intended to configure the TFS virtual machine. 
  58:  
  59: WARNING: THIS IS NOT INTENDED FOR PRODUCTION USE!
  60:  
  61: This script will
  62: - Create sample TFS user accounts
  63: - Assign TFS users to TFS groups
  64:  
  65: If you wish to abort press Ctrl+C now, else 
  66:     
  67: Press any key to begin..."
  68:   $inputKey = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp")      
  69: }
  70:  
  71: function createUser([string]$accountName, [string]$password, [string]$name) 
  72: {  
  73:     $computer = [adsi] "WinNT://$hostname"  
  74:     $user = $computer.Create("User", $accountName)      
  75:     $user.SetPassword($password)
  76:     $user.SetInfo()         
  77:     $user.FullName = $name
  78:     $user.put("UserFlags",65536 -bor 64)
  79:     $user.SetInfo()         
  80: }
  81:  
  82: function createSampleAccounts
  83: {
  84:     createUser "michaf" "P@ssw0rd" "Michael Affronti (PM)"
  85:     createUser "aprist" "P@ssw0rd" "April Stewart (Dev Lead)"
  86:     createUser "dorikr" "P@ssw0rd" "Doris Krieger (Dev)"
  87:     createUser "abuobe" "P@ssw0rd" "Abu Obeida Bakhach (Dev)"
  88:     createUser "chriko" "P@ssw0rd" "Christine Koch (Tester)"
  89:     createUser "chriba" "P@ssw0rd" "Chris Barry (Business Stakeholder)"
  90:     createUser "robiwo" "P@ssw0rd" "Robin Wood (End User)"
  91: }
  92: function addToTFS([string]$accountName, [string]$groupname, [string]$targetProjectName = "") 
  93: {  
  94:     $target = ""
  95:     if ($targetProjectName -ne "")
  96:     {
  97:         $target = "[" +$targetProjectName + "]\" +$groupname
  98:     }
  99:     else
 100:     {
 101:         $target = $groupname
 102:     }
 103:     
 104:     if (!$accountName.Contains("\"))
 105:     {
 106:         $accountName = $hostname + "\" + $accountName
 107:     }
 108:     
 109:     $currentLocation = Get-Location
 110:     Set-Location "c:\Program Files\Microsoft Team Foundation Server 2010\Tools"
 111:     $argument = $hostname + "/defaultcollection"
 112:     .\tfssecurity /g+ $target n:$accountName /collection:$argument
 113:     Set-Location $currentLocation
 114: }
 115:  
 116:  
 117: function addSampleAccountsToGroups
 118: {    
 119:     addToTFS "michaf" "Team Foundation Administrators"
 120:     addToTFS "aprist" "Team Foundation Administrators"
 121:     addToTFS "dorikr" "Contributors" $projectName
 122:     addToTFS "abuobe" "Contributors" $projectName
 123:     addToTFS "chriko" "Contributors" $projectName
 124:     addToTFS "chriba" "Contributors" $projectName
 125:     addToTFS "robiwo" "Readers" $projectName
 126: }
 127: Clear-Host
 128: introduction
 129: $projectName = Read-Host -Prompt "Project name to add contributors and readers to"
 130: createSampleAccounts
 131: addSampleAccountsToGroups

What’s next? When the Microsoft PowerTools for Visual Studio 2010 ship for 2010 BETA-2, in particular the FTPT program, we will be adding the automatic creation of Team Projects and the automated setup of branches, workspaces, etc.

Here is a snippet of such a script under construction:

   1: function CreateHOLSpaceForTP_B
   2: {
   3:  #Create team project with tfpt (TFPT createteamproject TP-B.xml)
   4:  #... waiting for working 2010 BETA-2 edition
   5:  
   6:  #Create Workspace
   7:  &'\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe' workspace /new TP-B /noprompt
   8:  
   9:  #Do the mapping
  10:  &'\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe' workfold  /unmap $/
  11:  
  12:  #Create the VC space as per HOL
  13:  &'\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe' workfold  /map $/TP-B 'C:\HOL\Source Code\Demo\Sandbox-B' /workspace:TP-B
  14:  &'\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe' add       'C:\HOL\Source Code\Demo\Sandbox-B\Main' /recursive
  15:  &'\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe' checkin   'C:\HOL\Source Code\Demo\Sandbox-B\Main' /recursive /noprompt
  16:  &'\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe' branch    'C:\HOL\Source Code\Demo\Sandbox-B\Main’  ‘$/TP-B/Dev’
  17:  &'\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe' checkin   'C:\HOL\Source Code\Demo\Sandbox-B\Dev' /noprompt
  18:  &'\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe' add       'C:\HOL\Source Code\Demo\Sandbox-B\Dev\HelloWorldDemo' /recursive
  19:  &'\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe' checkin   'C:\HOL\Source Code\Demo\Sandbox-B\Dev' /recursive /noprompt
  20: }
  21:  
  22: CreateHOLSpaceForTP_B

The above scripts are both under construction, not supported and shared only to show you what we are busy with and what is possible.

For today and the next two days I will be exploring kernel debugging and therefore will be focusing my blogs on the exciting world of debugging again.

Dev4Devs is an exciting initiative that Eben initiated in South-Africa, bringing speakers and potential speakers together to talk about technology in 20 minutes slots. A great collaboration  opportunity and  I noticed that two of the SA Architect leads and Rangers in South-Africa are presenting a topic as well :)

image

Make sure you register and  find your way to Microsoft on the 28th!

In Chatter: Basic Manual Project Management – Part 1: Cost Evaluation we looked at some of the basic cost evaluation techniques, in Chatter: Basic Manual Project Management – Part 2: PERT Techniques we explored the PERT techniques and in the end we mentioned that we may chat about the significance of the standard deviation in the next blog post, to calculate the probability of completing the project on time.Clipart Illustration of a Stressed White Employee Staring At Stacks Of Paperwork On A Desk, Trying To Figure Out Where They Can Put Their Computer Keyboard

Well, let’s conclude that topic for completeness.

image … extract from diagram in previous related post.

As part of the Chatter: Basic Manual Project Management – Part 2: PERT Techniques post, we determined that the standard deviation is 1.178 and for the sake of this post we assume that a stakeholder asks you what the probability is of you finishing this project on time in 14 (yeah), 16 (really) and in 20 days.

For this we dust off yet another calculation, namely z-value = (Target Date – Target Expected (te)) / standard deviation (s)

For …

  • 14 days we get a value of –1.698
  • 16 days we get a value of 0.00 and for
  • 20 days a value of 3.39.

Using a standard normal deviates table, which can be found on the Internet or in most stats books, we can determine the probability as follows:

 image   … by the way, I hand crafted this diagram. DO NOT se it for your project management planning … it is merely intended to illustrate the concept.

Therefore, based on the calculated z-values, we have a good chance of making the 16 days and a very good chance of making the 20 days.

That concludes my brief excursion through the basic project planning world.

Derek, please no frowning … I understand that the “Master of Project Management” has probably had a few nervous twitches while listening to a developer talk about project management topics :)

The latest Rangers project just “kicked off” this morning and my next dev lead adventure. Included in this post is the motivation, the vision and the objective of the project, whereby I am more than happy to discuss more details with you if needed. For the sake of text re-use, all text indicated in italic has been copy-pasted from the project announcement emails from Clipart Illustration of a White Person With A Red Megaphone Head, Shouting Out InformationBijan:

Motivation

The Visual Studio 2010 Architect edition is paradigm shift in application design and development. The best practices are unknown at this stage, which means that the field, customers and partners have a hard time figuring out how to leverage tools and features effectively.

Vision

Provide guidance for VSTS 2010 Architect Edition based on real world best practices from PG SMEs and VSTS Rangers to help customers successfully adopt the new features

Scope

As part of the scope we are planning to cover both guidance and extensibility. As with all other rangers projects the scope includes a hands-on-labs as well and we want to ship with or preferably before Visual Studio 2010 is released to market.

The team is made up of a number of members from the product group and from the Rangers, and is promising to deliver invaluable guidance for an edition of Visual Studio that I am very excited about. I will share the team leads and their friendly faces as soon as the kick-off dust has settled. Watch the space …

Clipart Illustration of a White Employee Seated At A Wooden Desk And Using A Laptop While Doing Paperwork At The Office In Chatter: Basic Manual Project Management – Part 1: Cost Evaluation we looked at some of the basic cost evaluation techniques when dealing with a number of projects and having to decide which will be the right one … not from a “technical having fun” perspective, but from a cost effectiveness.

In this post we will briefly look at risk planning, in particular the PERT techniques.

Before we start, we should cover the four basic ways we can deal with project risks, namely acceptance, avoidance, reduction and transfer.

  • acceptance” … we literally accept the risk, which is a feasible option when the cost of taking any action is likely going to be more than any probable damage … although I personally do not like this option and had a hard time in one of my assignments trying to justify it.
  • avoidance”  … we avoid everything that is a risk, which is probably why I will never jump out of a fully functional aircraft and hope that the parachute opens.
  • reduction” … we take proactive and preventative measures to actively reduce the probability of risk, such as packing a safety parachute if you are insane enough to jump out of a fully functional aircraft.
  • transfer” … we transfer the risk to another person or organisation, which typically involves outsourcing and/or calling the cavalry.

PERT

PERT stands for program evaluation and review technique and based on literature I read, it was developed for the fleet ballistic missile program. It requires us to define three estimates for every activity including most likely, optimistic and pessimistic.

PERT expected duration formula = (optimistic + (4 x most likely) + pessimistic)/6

Before we look at an example, we need to cover the formula for calculating the standard deviation of an activity time, which is (pessimistic – optimistic)/6

Example

image

The table shows 6 tasks, with the optimistic likely and pessimistic estimates. The figures in bold indicate the calculated expected duration and standard deviation. The figures in red are the estimates done using the formula I have been given by my mentor in the early 80’s and have used ever since … pretty close and therefore the PERT technique gives me a good warm fuzzy feeling.

PERT uses the following activity template to visualize the above as events:

image

If we draw the five activities using this template, we get:

image

When we calculate the standard deviation for event “4”, we have to first calculate the square root of the sum of squares of the individual standard deviations using tasks A and C, as well as B and D as shown. The resultant standard deviation of A & C, shown as standard deviation 4 using 1 & 2, is the greater of the two and therefore the one we use for event 4.

If there is any interest, we can chat about the significance of the standard deviation in the next blog post, to calculate the probability of completing the project on time … assuming we have to complete within 17 days.

image CLIPART_OF_12921_SM

It is always great to see when a solution bubbles up from “Future Projects” list to the “Current Ranger Solutions” list :) Have a peek at our Rangers site here, to visit the TFS Integration Platform site on Codeplex as well, and most importantly to always give us candid feedback on both our Rangers home site and the solutions.

Have a great weekend! I have tempted Friday 13th long enough and am signing off for the weekend.

Part of my part-time studies … don’t ask … included project management and two areas, which we take for granted when using the Microsoft Project tool are cost calculations and evaluations, as well as the application of PERT techniques. I personally found these topics interesting and will chat about then briefly in two separate posts … this being the first and embracing the cost calculations and evaluations.Blue Male Student in a Graduation Cap, Reading a Book and Leaning Against a Stack of Books Clipart Illustration

The following table showing cash flow projections for two 5 year projects, will serve as example data for the duration of this blog post:

Year Project A Project B Project C
0 -100,000 -2,000,000 -1,000,000
1 20,000 400,000 400,000
2 20,000 400,000 400,000
3 20,000 400,000 100,000
4 10,000 400,000 100,000
5 70,000 100,000 10,000

Net Profit

Is the difference between the total cost and the total income of the project.

Looking at Project A, B and C we get:

  • Project A: 20,000 + 20,000 + 20,000 + 10,000 + 70,000 – 100,000 = 40,000
  • Project B: 400,000 + 400,000 + 400,000 + 400,000 + 100,000 – 2,000,000 = –300,000
  • Project C: 400,000 + 400,000 + 100,000 + 100,000 + 10,000 – 1,000,000 = 10,000
  • Therefore Project A and C are making a profit :) and Project B a loss :(
  • Based on Net Profit, I would personally pick project A, because there is more money left over.

Payback Period

Defines the time it takes to break even and be able to payback the initial investment.

  • Project B is looking grim as we have not broken even after 5 years. 
  • Project A looks a bit better, because after 4 years we have a cash flow of –30,000. With us making 70,000 in year 5, we will have broken even after 4.43 years.
  • Project C looks slightly better, because after 4 years we have a zero balance … which is what all of us would love to see after a one million loan.
  • Based on the payback period, I would personally pick project C as the payback period is the shortest. I would literally sleep better sooner …

Return of Investment (ROI)

Is also known as the accounting rate of return (APR) and in principal provides a way of comparing the net profitability to the investment required.

The calculation for ROI is the (average annual profit / investment) * 100. Hence …

  • Project A = ((40,000/5)/100,000)*100 = 8%
  • Project B = ((-300,000/5)/-2,000,000)*100 = –3%
  • Project C = ((10,000/5)/1,000,000)*100= 0.2%
  • Based on ROI, I would personally pick project A again as it has the highest ROI percentage.

Net Present Value

Is a project evaluation technique, that takes into account the profitability of a project and the timing of the cash flows produced.

  • The present value is defined as = ( value in year X ) / ( 1 + discount rate ) to the power of the number of years into the future that the cash flow occurs.
  • To calculate the discount factor (DF in table below) we calculate as 1 / ( ( 1 + discount rate ) to the power of the number of years, whereby we are borrowing the investment at an interest of 5%, or a discount rate of 0.05.
  • This one had me going for some time and we will select project A and call Excel for assistance:
    image
  • The Project A discounted cash flow looks worse than the net profit, but the good news (in my simple understanding of project management) is that we are still making a profit.

Hopefully when the project managers are chatting amongst each other, you will be able to catch and understand a few more fragments of their lingo and acronyms :) Next time we will chat about PERT techniques.

image Clipart Illustration of a Blue AO-Maru Robot Distorted With Pixels, Leaning Back And Looking Upwards With Strands Of Binary Coding

The TFS Integration Platform has a new home on Codeplex, where the product group and the VSTS Rangers have posted the ALPHA release of the platform.  The intention of the Alpha release is to improve the transparency of the project, for the community to be able to give feedback to be considered for the next release and especially to give custom adapter and tooling developers an opportunity to experiment with the new software development toolkit (SDK).

See Matt’s post TFS Integration Platform Alpha Released on CodePlex for more details.

Visit us at http://www.codeplex.com/TFSIntegration and give us feedback on the TFS Migration and Integration Forum here.

From a VSTS Rangers perspective we are working on additional adapter samples and refining the migration planning poster. More about these exciting value-adds in due course.

When you have a look at most of the TFS Integration Platform configuration files, you will notice the EnableBypassRuleDataSubmission, as shown in line 23 and 37 in the following Sample Configuration file:

   1: <?xml version="1.0" encoding="utf-16"?>
   2: <Configuration UniqueId="{7439CF38-BBF4-4B16-A8C9-B5CB3B5A82E5}"
   3:                FriendlyName="TR9 HOL AS">
   4:     <Providers>
   5:         <Provider FriendlyName="CR TFS 2010 Migration WIT Provider" 
   6:                 ReferenceName="04201D39-6E47-416f-98B2-07F0013F8455" />
   7:       <Provider FriendlyName="CR TFS 2010 VC Migration Provider" 
   8:                 ReferenceName="FEBC091F-82A2-449e-AED8-133E5896C47A" />
   9:     </Providers>
  10:                   
  11:     <SessionGroup FriendlyName="Session Group Friendly Name AS" 
  12:                           SessionGroupGUID="{06D11897-EF77-4326-888F-96E4F856A2E3}"
  13:                           WorkFlowType="OneDirectionalSynchronizationWithoutContextSync">
  14:       <MigrationSources>
  15:         <!-- WIT Migration Sources -->
  16:         <MigrationSource InternalUniqueId="A0E4FBE9-5E44-4D12-A274-958F259A9B6D" 
  17:                          FriendlyName="TFS2010B1X32T Source AS" 
  18:                          ServerIdentifier="TFS2010B1X32T Source AS" 
  19:                          ServerUrl="http://TFS2010B1X32T:8080/tfs/defaultcollection" 
  20:                          SourceIdentifier="TP-A" 
  21:                          ProviderReferenceName="04201D39-6E47-416f-98B2-07F0013F8455">
  22:           <CustomSettings>
  23:             <!--<CustomSetting SettingKey="EnableBypassRuleDataSubmission" SettingValue="false" />-->
  24:             <!--<CustomSetting SettingKey="DisableAreaPathAutoCreation" SettingValue="" />-->
  25:             <!--<CustomSetting SettingKey="DisableIterationPathAutoCreation" SettingValue="" />-->
  26:           </CustomSettings>
  27:           <StoredCredential />
  28:         </MigrationSource>
  29:         
  30:         <MigrationSource InternalUniqueId="EF98D1AE-2101-444F-9FAB-DC9C354E861A" 
  31:                          FriendlyName="TFS2010B1X32T Target AS" 
  32:                          ServerIdentifier="TFS2010B1X32T Target AS" 
  33:                          ServerUrl="http://TFS2010B1X32T:8080/tfs/defaultcollection" 
  34:                          SourceIdentifier="TP-C" 
  35:                          ProviderReferenceName="04201D39-6E47-416f-98B2-07F0013F8455">
  36:           <CustomSettings>
  37:             <!--<CustomSetting SettingKey="EnableBypassRuleDataSubmission" SettingValue="false" />-->
  38:           </CustomSettings>
  39:           <StoredCredential />
  40:         </MigrationSource>
  41:  
  42:         <!-- VC Migration Sources -->
  43:         <MigrationSource InternalUniqueId="13828D85-46F5-40A4-9A38-D95CF96B01DB"
  44:                FriendlyName="TFS2010B1X32T VC Source AS"
  45:                ServerIdentifier="TFS2010B1X32T VC Source AS"
  46:                ServerUrl="http://TFS2010B1X32T:8080/tfs/defaultcollection"
  47:                SourceIdentifier="Source System"
  48:                ProviderReferenceName="FEBC091F-82A2-449e-AED8-133E5896C47A">
  49:           <CustomSettings>
  50:             <SettingXml />
  51:             <SettingXmlSchema />
  52:           </CustomSettings>
  53:         </MigrationSource>
  54:         
  55:         <MigrationSource InternalUniqueId="9848394A-112D-4B8B-9866-0E309BB372CB"
  56:                FriendlyName="TFS2010B1X32T VC Target AS"
  57:                ServerIdentifier="TFS2010B1X32T VC Target AS"
  58:                ServerUrl="http://TFS2010B1X32T:8080/tfs/defaultcollection"
  59:                SourceIdentifier="Target System"
  60:                ProviderReferenceName="FEBC091F-82A2-449e-AED8-133E5896C47A">
  61:           <CustomSettings>
  62:             <SettingXml />
  63:             <SettingXmlSchema />
  64:           </CustomSettings>
  65:         </MigrationSource>
  66:       </MigrationSources>
  67:       
  68:       <Sessions>
  69:         <Session SessionUniqueId="CE189D49-EAA3-4CB9-883D-FC68F79656FF"
  70:                  FriendlyName="WIT session AS"
  71:                  LeftMigrationSourceUniqueId="A0E4FBE9-5E44-4D12-A274-958F259A9B6D"
  72:                          RightMigrationSourceUniqueId="EF98D1AE-2101-444F-9FAB-DC9C354E861A"
  73:                          SessionType="WorkItemTracking">
  74: <!-- LAB1 -->
  75:       <CustomSettings />
  76:           <Filters>
  77:             <FilterPair>
  78:               <FilterItem MigrationSourceUniqueId="A0E4FBE9-5E44-4D12-A274-958F259A9B6D" FilterString="" />
  79:               <FilterItem MigrationSourceUniqueId="EF98D1AE-2101-444F-9FAB-DC9C354E861A" FilterString="" />
  80:             </FilterPair>
  81:           </Filters>
  82:         </Session>
  83:  
  84: <!-- LAB 3         
  85:         <Session SessionUniqueId="7092283E-8776-4458-A0BC-1A96385C635F"
  86:                        FriendlyName="Control session AS"
  87:                        LeftMigrationSourceUniqueId="13828D85-46F5-40A4-9A38-D95CF96B01DB"
  88:                        RightMigrationSourceUniqueId="9848394A-112D-4B8B-9866-0E309BB372CB"
  89:                        SessionType="VersionControl">
  90:           <CustomSettings>
  91:           </CustomSettings>
  92:           
  93:           <Filters>
  94:             <FilterPair>
  95:               <FilterItem MigrationSourceUniqueId="13828D85-46F5-40A4-9A38-D95CF96B01DB" FilterString="$/TP-A" />
  96:               <FilterItem MigrationSourceUniqueId="9848394A-112D-4B8B-9866-0E309BB372CB" FilterString="$/TP-C" />
  97:             </FilterPair>  
  98:           </Filters>
  99:         </Session>
 100: LAB 3 -->
 101:       </Sessions>
 102:       
 103:       <Linking EngineProviderReferenceName="04201D39-6E47-416f-98B2-07F0013F8455">
 104:         <!--<CreationTime>0001-01-01T00:00:00</CreationTime>-->
 105:         <CustomSettings>
 106:           <SettingXml />
 107:           <SettingXmlSchema />
 108:         </CustomSettings>
 109:         <LinkTypeMappings /> 
 110:       </Linking>
 111:       
 112:     </SessionGroup>
 113: </Configuration>

So what is this feature all about”, some of you are asking?

What does it do?
Smart Blue Man Seated With His Legs Crossed, Brainstorming and Writing Ideas Down in a Notebook, Lightbulb Over His Head Clipart Illustration

The best  is to work through the TFS Integration Platform – Getting Started Basic Scenario, which performs a bi-direction synchronization with the EnableBypassRuleDataSubmission enabled and then the TFS Integration Platform – Getting Started Advanced Scenario which repeats the walkthrough, but with the feature disabled. Seeing is believing and working through the walkthrough, or watching the forthcoming video recordings of the two scenarios, will explain the feature better than a blog consisting of a large amount of descriptive text.

When this feature is enabled the WIT Adapter will, in particular the TfsMigrationWorkItemStore class, will react accordingly and submit WIT changes using a XmlDocument  with the BypassRule enabled.

   if (ByPassrules)
        SubmitChangesWithUpdateDoc(changeGroup, changeResult, sourceSideSourceId);
   else
        SubmitChangesWithWitOM(changeGroup, changeResult, sourceSideSourceId);

This enforces, that all WITD rule evaluations, such as valid value list and state transitions, are disabled for submitted WIT data and that changes are applied as instructed ... no questions asked. Additionally, turning on bypass-rule for WIT changes submission is requisite for higher migration content fidelity. In particular, the author of the source WIT change, regardless being a valid user or not on the target TFS server, is preserved. If bypass-rule is disabled, the migration service account will be the author of *all* the migrated WIT changes on the target TFS server.

What are the ranges of SettingValue?
a Blue Man on Another Man's Shoulders, Holding up a Bar in a Graph Clipart Illustration

The SettingValue is ignored at this stage. To enable the EnableBypassRuleDataSubmission, add the following line to the WIT session configuration:
   <MigrationSource InternalUniqueId="EF98D1AE-2101-444F-9FAB-DC9C354E861A"
                    FriendlyName="TFS2010B1X32T Target AS" 
                    ServerIdentifier="TFS2010B1X32T Target AS" 
                    ServerUrl="
http://TFS2010B1X32T:8080/tfs/defaultcollection
                    SourceIdentifier="TP-C" 
                    ProviderReferenceName="04201D39-6E47-416f-98B2-07F0013F8455">
       <CustomSettings>
           <CustomSetting SettingKey="EnableBypassRuleDataSubmission" SettingValue="false" />
       </CustomSettings>
       <StoredCredential />
   </MigrationSource>

In addition to enabling the rule, you must also ensure that the user account that will be performing the synchronization and submitting the WIT changes, is a member of the Team Foundation Service Group and thus authorised to bypass the rule evaluations.

The following is a sample script file used as part of the TFS Integration Platform – Getting Started Basic Scenario:

   1: cd "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE>"
   2: tfssecurity /g+ srv: tfs2010b1x32t\Administrator /server:tfs2010b1x32t\defaultcollection
   3: pause

To disable, either remove it or comment it out as shown:

   <CustomSettings>
       <!--<CustomSetting SettingKey="EnableBypassRuleDataSubmission" SettingValue="false" />—>
   </CustomSettings>

When should you use this rule?

Blue Businessman Seated at a Desk, Instructing Employees Clipart Illustration Bypassing any rule is extending a huge trust to the user submitting the WIT changes and as possible state and data corruption is possible, the recommendation is not to use this feature. Instead use the new conflict resolution tool to create appropriate rules. That said, we recommend to enable (use) the BypassRule, if the preservation of the “original author” in the migrated work items is important, and avoid it in all other cases.

Acronyms Used

| TFS – Team Foundation Server | WIT – Work Item Tracking | WITD – WIT Definition |

More Posts Next page »
 
Page view tracker