欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
ImageX and using window imaging from C++

To restore an example image ImageX can do this in 3min 25sec. However from my code I get a total restore time of 9min 50sec.

 

Ihave captured some time information from the WIM calls and the attachedprogram spend 3min 18sec in the WIMCreateFile and 6 min 41 sec inWIMApplyImage.

 

Does anyone know how imageX does the restore to achieve the times it gets?

 

Thanks

 

D

 

#include <stdio.h>#include <windows.h>#include <wimgapi.h>#define IN#define INOUT////Callback function://DWORD WINAPI ApplyCallback(DWORD dwMessageId, WPARAM wParam, LPARAM lParam, PVOID pvUserData) {switch ( dwMessageId ) {case WIM_MSG_SETRANGE:	// http://msdn.microsoft.com/en-us/library/7535a5c5-f72f-4c1e-90e9-d07a8d4132cdprintf ("File count to be restored %d\n", (DWORD) lParam);break;case WIM_MSG_SETPOS:	// http://msdn.microsoft.com/en-us/library/dd834954%28v=MSDN.10%29.aspxif ((DWORD) lParam == 0) {printf ("Starting apply\n");} else {printf ("Finished apply\n");}break;case WIM_MSG_PROGRESS:	// http://msdn.microsoft.com/en-us/library/f0c291f5-2a40-4805-8d00-82e8b852275cprintf ("\rPercentage %d", (UINT) wParam);if ((UINT) wParam == 100) {printf ("\n");}break;}return WIM_MSG_SUCCESS;}LPWSTR MultiCharToUniChar(char* multiByteString) {size_t len = strlen(multiByteString) + 1;wchar_t *wideCharString = new wchar_t[len];mbstowcs(wideCharString, multiByteString, len); // Convert multibyte string to wide-character stringreturn (LPWSTR)wideCharString;}int main(DWORD argc, char *argv[]){HANDLE WIMHandle = NULL;HANDLE ImageHandle = NULL;char wimSourceFile[] = "KDClient.WIM";char wimApplyDirectory[] = "C:\\";bool success = false;printf ("Restoring up %s to %s\n", wimSourceFile, wimApplyDirectory);char tempDirectory [MAX_PATH] = {0};GetTempPath(MAX_PATH, tempDirectory);printf ("Temp path being used is %s\n", tempDirectory);LPWSTR WIMTempDirectory = MultiCharToUniChar (tempDirectory);LPWSTR WIMSourceFile = MultiCharToUniChar (wimSourceFile);LPWSTR WIMApplyDirectory = MultiCharToUniChar (wimApplyDirectory);if (WIMRegisterMessageCallback( NULL, (FARPROC) ApplyCallback, NULL ) != INVALID_CALLBACK_VALUE) {DWORD created = 0;WIMHandle = WIMCreateFile (WIMSourceFile, WIM_GENERIC_READ, WIM_OPEN_EXISTING, WIM_FLAG_VERIFY, 0, &created );if (WIMHandle) {if (WIMSetTemporaryPath(WIMHandle, WIMTempDirectory)) {DWORD imgIndex = 1;ImageHandle = WIMLoadImage (WIMHandle, imgIndex);if (ImageHandle) {if (WIMApplyImage (ImageHandle, WIMApplyDirectory, WIM_FLAG_VERIFY)) {success = true;} else {printf ("Failed to apply image. Error code %d\n", GetLastError());}if (!WIMCloseHandle(ImageHandle)) {printf ("Failed to close image device correctly. Error code %d\n", GetLastError());if (success) success = false;}} else {printf ("Failed to load image. Error code %d\n", GetLastError());}} else {printf ("Unable to set temp direcotry\n");}if (!WIMCloseHandle(WIMHandle)) {printf ("Failed to WIM file correctly. Error code %d\n", GetLastError());if (success) success = false;}} else {printf ("Cannot open the WIM file. Error code %d\n", GetLastError());}} else {printf ("Unable to register capture callback.\n");}return 0;}


 

 

All Replies

Thursday, August 11, 2011 2:12 PM
 
0
Vote As Helpful

Have you tried to disable WIM_FLAG_VERIFY in both WIMCreateFile() and WIMApplyImage()?

I suppose that the verification may cost some CPU time in applyingthe image. In another way, you may use the imagex by enabling /VERIFYflag in the command line to have a compare.

What's the size of the volume are you applying?

 

Jimmy Zhu


Please remember to click “Mark asAnswer” on the post that helps you, and to click “Unmark as Answer” if amarked post does not actually answer your question. This can bebeneficial to other community members reading the thread.

本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
Win7下dll遠程注入
如何在Vista中不彈出UAC以本地系統賬戶(hù)啟動(dòng)程序
通過(guò)WinInet上傳文件
管理進(jìn)程的虛擬內存
受限token實(shí)現xp下沙箱設計的關(guān)鍵概念之DAC
Windows WIM文件的分割,合并
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久