25
Hands-On Lab: HORM Lab Manual Expediting Power Up with HORM

Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

  • Upload
    vandieu

  • View
    222

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Lab Manual

Expediting Power Up with HORM

Page 2: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

SummaryIn this lab, you will learn how to build a XP embedded images capable of supporting HORM (HibernateOnce Resume Many). You will also learn how to utilize EWFMGR command line interface and EWFAPI to monitor and control state of HORM.

Estimated Time to Complete This HOL1 hour

Applies toThis feature is used when customer wants a quick power up to a known state.

Last Update7/12/2007

Page 3: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

This is a preliminary document and may be changed substantially prior to final commercial release of the software describedherein.The information contained in this document represents the current view of Microsoft Corporation on the issues discussed as ofthe date of publication. Because Microsoft must respond to changing market conditions, it should not be interpreted to be acommitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information presented after the dateof publication.This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED ORSTATUTORY, AS TO THE INFORMATION IN THIS DOCUMENT.Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights under copyright, nopart of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by anymeans (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express writtenpermission of Microsoft Corporation.Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subjectmatter in this document. Except as expressly provided in any written license agreement from Microsoft, the furnishing of thisdocument does not give you any license to these patents, trademarks, copyrights, or other intellectual property.Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people,places and events depicted herein are fictitious, and no association with any real company, organization, product, domainname, email address, logo, person, place or event is intended or should be inferred.© 2006 Microsoft Corporation. All rights reserved.Microsoft, Windows, ActiveSync, Outlook, Visual Studio, and Windows Mobile are either registered trademarks or trademarksof Microsoft Corporation in the United States and/or other countries.The names of actual companies and products mentioned herein may be the trademarks of their respective owners.

Page 4: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

HOL RequirementsThe following applications are required to run this HOL:

Target Designer

Credentials UsedNone

Page 5: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Contents

Expediting Power Up with HORM ...........................................................................................................................1

Lab 1: Expediting Power Up with HORM............................................................................................................6

Exercise 1:Creating the image that supports HORM .............................................................................................6Exercise 2:Exercising the EWFMGR command line interface to monitor and control HORM.............................17Exercise 3:Exercising the EWF API interface to monitor and control HORM......................................................22

Page 6: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

6

Lab 1: Expediting Power Up with HORMLab ObjectiveLearn how to build a XP embedded images capable of supporting HORM. Also, learn how to utilizeEWFMGR command line interface and EWF API to monitor and control state of HORM.

In this HOL you will perform the following exercises:

Creating the image that supports HORM,

Exercising the EWFMGR command line interface to monitor and control HORM,

Exercising the EWF API interface to monitor and control HORM, and

Exercise 1: Creating the image that supports HORM

1. In this exercise we will build and EWF image that supports HORM. We will use the tools in D:\ driveto build the image. The image will be configured to run on and protect the C:\ drive.

2. Open Target Designer

3. Click on File -> New and give the new configuration a name:

Click OK and create the new configuration

Page 7: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

7

4. Find Virtual PC Helper macro in the configuration browser pane by searching for “virtual PC helpermacro” component

Page 8: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

8

5. Drag and drop Virtual PC to the configuration editor pane:

Page 9: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

9

6. Using the same search, and drag and drop method, add the following components to theConfiguration Editor Pane:

a. Background Disk Defragmentation Disable

b. Enhanced Write Filter

c. Enhanced Write Filter API (EWF API)

d. EWF NTLDR

e. EWF Manager Console Application

f. NTFS

g. NTFS Format

h. Windows Logon

i. English Language Support

j. Explorer Shell

k. Power Management Application

l. CMD – Windows Command Process

m. .Net Framework 2.0

Page 10: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

10

7. Configure Target Designer to automatically resolve dependencies by clicking Tools->Options.Choose “Dependency Check” tab and pick Auto-Resolve Dependencies.

8. Check dependencies for Virtual PC Helper Macro by clicking on Configuration-> CheckDependencies

Page 11: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

11

9. We are now ready to configure EWF and HORM. Click on “Advanced Configuration and PowerInterface (ACPI) PC”. Click Settings. The System Settings appear in the Details Pane.

10. Under “Power Management Settings”, click Show. The Power Management Settings are displayed.To enable system hibernation, select “Enable hibernation support”.

Page 12: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

12

11. In Enhanced Write Filter configuration settings, check “Enable Hibernate-Once-Resume-ManyMode”.

Page 13: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

13

12. Build the image by clicking on Configuration->Build Target Image. Click Yes on doing thedependency check. Close the dependency check window and the build will continue. The image willbe saved under “c:\Windows Embedded Images” by default.

13. Save the configuration and exit Target Designer.

Page 14: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

14

14. We are now ready to change the boot.ini file on the directory that contains the embedded image tomake the system dual boot. Open a shell command window, and edit the boot.ini file in“D:\Windows Embedded Images”. After modifications, the file should look like the following:

Page 15: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

15

15. Copy all the content of D:\Windows Embedded Images to C:\ drive:

Page 16: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

16

16. Now reboot the PC and on power up choose “Windows XP Embedded” partition.

First Boot Agent (FBA) will execute and after 2 reboots, the system will come up in XP Embeddedmode. Note that you have to select “Microsoft Windows XP Embedded” choice after each reboot.

Page 17: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

17

Exercise 2: Exercising the EWFMGR command line interface tomonitor and control HORM

1. Once the XP Embedded OS is up, open a command window

Page 18: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

18

2. At the prompt, type “ewfmgr”. This command displays the state the EWF including the state ofHORM support.

Page 19: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

19

3. Hibernate the system, by clicking on “Start”-> “Turn Off Computer” and then select “Hibernate”.

Page 20: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

20

4. After hibernation, the system will shut off. Turn it back on again and verify that you get to thestate just before first hibernation.

5. Verify that restarting the system will result is restoring from hibernation over and over again.

Page 21: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

21

6. De-activate HORM by typing “ewfmgr c: -deactivatehorm”

7. Verify that restarting the system will not result in restoring from hibernation.

Page 22: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

22

Exercise 3: Exercising the EWF API interface to monitor andcontrol HORM

This exercise relies on an application written to interface with EWF API. In this lab we only run theapplication and we do compile/link the source code. The source code for this application is asfollows:

// EWFTestAPI.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <windows.h>#include <windef.h>#include <winbase.h>#include <winioctl.h>#include <stdio.h>#include <stdlib.h>#include <string.h>

#define EWFIMP#include "ewfapi.h"#include "ewfapip.h"

// main bodyint _tmain(int argc, _TCHAR* argv[]){

HANDLE hSrcDevice = INVALID_HANDLE_VALUE;char * psz;int i;BOOL ret_status;PEWF_VOLUME_NAME_ENTRY pVolumeNameList = NULL;

pVolumeNameList = EwfMgrGetProtectedVolumeList();if (!pVolumeNameList){

printf("Unable to find any protected volumes.\n");goto done;

}hSrcDevice = EwfMgrOpenProtected(pVolumeNameList->Name);if (hSrcDevice == INVALID_HANDLE_VALUE){

printf(("Failed opening the protected volume %s with error %ld\n"),pVolumeNameList->Name, GetLastError());

goto done;}

Page 23: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

23

for (i = 1; i < argc; i++){

psz = (char *)argv[i];if (*psz == '?'){

goto usage;}else if (*psz == 'A'){

printf("Activating...");ret_status = EwfMgrActivateHORM(hSrcDevice);if (ret_status)

printf("PASSED\n");else

printf ("FAILED\n");}

else if (*psz == 'D'){

printf("Deactivating...");ret_status = EwfMgrDeactivateHORM(hSrcDevice);if (ret_status)

printf("PASSED\n");else

printf ("FAILED\n");}else if (*psz == 'G'){

printf("Geting the state...");ret_status = EwfMgIsHORMActivated(hSrcDevice);if (ret_status)

printf("Activated\n");else

printf ("Deactivated\n");}

elsegoto usage;

}goto done;

usage:printf ("USAGE: EWFTestAPI A: Activates HORM \n");printf (" EWFTestAPI D: Deactivates HORM\n");printf (" EWFTestAPI G: Returns the state of HORM (Activated, or

Deactivated)\n");

done:if (hSrcDevice != INVALID_HANDLE_VALUE)

EwfMgrClose(hSrcDevice); // we're done with the handleif (pVolumeNameList)

EwfMgrVolumeNameListDelete(pVolumeNameList);return 0;

Page 24: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

24

}

Page 25: Hands-On Lab: HORM - synnex download/HORM_2007071… · Hands-On Lab: HORM Using Microsoft Device Emulator In-Depth in Your Application Development Experience 25 1. Copy EWFTestAPI.exe

Hands-On Lab: HORM

Using Microsoft Device Emulator In-Depth in Your Application Development Experience

25

1. Copy EWFTestAPI.exe application to the D:\ from C:\.2. Boot into the XP Embedded partition.3. Type EWFTestAPI ? to get the usage.4. Type EWFTestAPI G to get the state of HORM support.5. Type EWFTestAPI A to activate HORM. Verify activation as you did in Exercise 2.6. Type EWFTestAPI D to deactivate HORM. Verify deactivation as you did in Exercise 2.