⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adaptgeom.cpp

📁 对ima、imz压缩文件修改
💻 CPP
字号:
/* sample written by Nathan Moinvaziri [nmoinvaziri@yahoo.com] */

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <memory.h>
#include <string.h>

#include <windows.h>

#include "wimadll.h"

DWORD WINAPI EventNotif (DWORD dwEvent,
                                            DWORD dwEventParam,DWORD dwWin32Err,
                                            LPVOID lpParam,LPVOID lpUsrParam)
{
    if (dwEvent == DWEV_PROGRESSPERCENT)
        printf("\x08\x08\x08\x08%02u %%",dwEventParam);
    return 0;
}

int main(int argc,char *argv[])
{
    int iRet=0;
    HIMA hIma;

    printf("AdaptGeom WinImage SDK sample\n");
    if (argc<3)
    {
        printf("AdaptGeom\n" \
            "Usage : AdaptGeom <imagefile> <drive> [ALL]\n");
    }
    else
    {
      hIma = OpenLargeImageFile(NULL,argv[1],0,0,TRUE);
      if (hIma==NULL)
      {
          printf("Unable to open %s\n",argv[1]);
          iRet=2;
      }
      else
      {
          char cDrive=*(argv[2]);
          DWORD dwTotalLow=0;
          DWORD dwTotalHigh=0;
          BOOL fGeomIncompatible=FALSE;
          CHOICEAPP caWrite=USED;//ALL;

          if ((cDrive>='A') && (cDrive<='Z'))
              cDrive -= 0;
          if ((cDrive>='a') && (cDrive<='z'))
              cDrive -= ('a'-'A');
          printf("try write to %c:",cDrive);
          if (argc>=4)
          {
              if (lstrcmpi(argv[3],"ALL")==0)
              {
                  caWrite=ALL;
                  printf(" ALL selected (erase end of partition");
              }
          }
          printf("\n");


          printf("....");
          BOOL fRes=WimLargeWriteLargeImaCBEx(hIma,NULL,EventNotif,NULL,cDrive,&dwTotalLow,&dwTotalHigh, caWrite,FALSE,TRUE,&fGeomIncompatible);
          printf("\nResult : %s, dwTotal=0x%08x%08x bytes, GeomIncompatible=%s\n",
              fRes ? "true":"false",dwTotalHigh,dwTotalLow,fGeomIncompatible? "true":"false");
          if (!fRes)
              iRet=1;

          DeleteIma(hIma);
      }
    }
	
	return iRet;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -