资源简介
用于从微软补丁包.msp文件中,直接extract出文件

代码片段和文件信息
#include “msix.h“
#pragma comment(lib “msi.lib“)
// Entry point.
int _tmain(int argc _TCHAR* argv[])
{
DWORD dwError = NOERROR;
HRESULT hr = NOERROR;
ARGS args = { 0 };
IStorage* pRootStorage = NULL;
IEnumSTATSTG* pEnum = NULL;
LPCTSTR pszPersist = (LPTSTR)MSIDBOPEN_READONLY;
STATSTG stg = { 0 };
PMSIHANDLE hDatabase = NULL;
PMSIHANDLE hView = NULL;
PMSIHANDLE hRecord = NULL;
dwError = ParseArguments(argc argv &args);
if (ERROR_SUCCESS != dwError)
{
return dwError;
}
// Open the root storage file and extract storages first. Storages cannot
// be extracted using MSI APIs so we must use the compound file implementation
// for IStorage.
hr = StgOpenStorage(
CT2W(args.Path)
NULL
STGM_READ | STGM_SHARE_EXCLUSIVE
NULL
0
&pRootStorage);
if (SUCCEEDED(hr) && pRootStorage)
{
// Determine if the file path specifies an MSP file.
// This will be used later to open the database with MSI APIs.
if (IsPatch(pRootStorage))
{
pszPersist = MSIDBOPEN_READONLY + MSIDBOPEN_PATCHFILE;
}
hr = pRootStorage->EnumElements(0 NULL 0 &pEnum);
if (SUCCEEDED(hr))
{
while (S_OK == (hr = pEnum->Next(1 &stg NULL)))
{
if (STGTY_STORAGE == stg.type)
{
hr = SaveStorage(pRootStorage args.Directory stg.pwcsName
args.IncludeExtension ? TEXT(“.mst“) : NULL);
if (FAILED(hr))
{
break;
}
}
}
SAFE_RELEASE(pEnum);
}
}
SAFE_RELEASE(pRootStorage);
// Now open the database using MSI APIs. Patches cannot be opened simultaneously
// since exclusive access is required and no MSI APIs are exported that accept
// an IStorage pointer.
if (SUCCEEDED(hr))
{
dwError = MsiOpenDatabase(args.Path pszPersist &hDatabase);
if (ERROR_SUCCESS == dwError)
{
dwError = MsiDatabaseOpenView(hDatabase
TEXT(“SELECT ‘Name‘ ‘Data‘ FROM ‘_Streams‘“) &hView);
if (ERROR_SUCCESS == dwError)
{
dwError = MsiViewExecute(hView NULL);
if (ERROR_SUCCESS == dwError)
{
while (ERROR_SUCCESS == (dwError = MsiViewFetch(hView &hRecord)))
{
dwError = SaveStream(hRecord args.Directory args.IncludeExtension);
if (ERROR_SUCCESS != dwError)
{
break;
}
}
// If there are no more records indicate success.
if (ERROR_NO_MORE_ITEMS == dwError)
{
dwError = ERROR_SUCCESS;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5267 2006-04-06 17:47 MsiX.h
文件 2437 2006-04-06 17:57 MsiX.rc
文件 4219 2006-04-06 17:57 MsiX.vcproj
文件 398 2006-04-06 17:55 resource.h
文件 139264 2006-04-06 17:59 Release\MsiX.exe
文件 1412096 2006-04-06 17:59 Release\MsiX.pdb
目录 0 2006-04-06 18:00 Release\
文件 14665 2006-04-06 17:47 MsiX.cpp
- 上一篇:按键中断流水灯
- 下一篇:C51的数字时钟.rar
相关资源
- IAR for MSP430 v7.10.1 注册机
- 基于MSP430G2553的蓝牙控制小车
- 利用DS1302和msp430进行闹钟和万年历的
- msp430F149操作红外接收模块源码
- [免费]msp430f149控制PS2键盘并用1602显示
- MSP430f149读sd FAT txt
- 用8位spi实现16位spi
- 美松打印机SDK MsPrintSDK-Demo-DLL-CShare-
- 基于MSP430单片机的实时多任务操作系
- MSProject文件导入导出
- MSP430系列单片机例程(msp430f235)
- MSP430控制AD9850产生频率可调的方波及
- msp430f449程序
- 12位、1 MSPS、单电源、低功耗数据采集
- 基于MSP430的数控直流电压源
- MSP430F5438A Timer_B 操作实验
- MSP430F5438 UCS 时钟操作实验
- MSP430F5438A Timer_A 操作实验
- MSP430F5438 看门狗实验
- IAR EW430连接仿真器在线仿真
- 初识畅学系列MSP430F149单片机开发板
- 畅学多功能实验箱 MSP430F5438 RTC 操作实
- MSP430F5438A RAM操作实验
- msp430f5438a技术资料
- KMSpico v10.2.0 Portable
- MSP430 JTAGUSB的和并口的与目标板连接的
- MSP430教程:MSP430单片机ADC12模块
- WIA-PA网络技术在井下人员定位系统中
- 16位MSP430单片机的开关稳压电源设计
- 基于mps430f149的12864液晶显示模块编程
评论
共有 条评论