Skip to content

Commit

Permalink
修改导出子项目时,项目大小的判定规则
Browse files Browse the repository at this point in the history
  • Loading branch information
csersoft committed Apr 21, 2019
1 parent ad7c21c commit 201ea20
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
30 changes: 11 additions & 19 deletions HWFW_GUI/DlgAdvDatFmt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ typedef struct _HuaWeiSubItemObject {
} HWSUBITEM_OBJ, *PHWSUBITEM_OBJ;


static LPCVOID lpItemData = NULL;
static uint32_t u32DataSize = 0;
static uint32_t u32ItemIdx;
static HWND hDlgFmt = NULL;
static PHWSUBITEM_OBJ lpSubItem = NULL;
static PHWSUBITEM_OBJ lpCurrentItem = NULL;
static uint32_t nSubItem = 0;
static LPCVOID lpItemData = NULL;
static uint32_t u32DataSize = 0;
static uint32_t u32ItemIdx;
static HWND hDlgFmt = NULL;
static PHWSUBITEM_OBJ lpSubItem = NULL;
static PHWSUBITEM_OBJ lpCurrentItem = NULL;
static uint32_t nSubItem = 0;

static void Release()
{
Expand Down Expand Up @@ -207,14 +207,6 @@ static BOOL UpdateDataView()
return TRUE;
}

static void UpdateCurrent() {
if (lpCurrentItem == NULL) return;

if (lpCurrentItem->bIsInit && lpCurrentItem->lpRawData) {

}
}

static int ImportData_WHWH() {
LPVOID lpData = NULL;
DWORD dwDataSize = 0;
Expand Down Expand Up @@ -389,7 +381,7 @@ static int ImportData_UIMG() {
}
}

static int MakeSubItem(LPVOID lpData, uint32_t maxSize, PHWSUBITEM_OBJ lpSubItem, BOOL align) {
static int MakeSubItem(LPVOID lpData, uint32_t maxSize, PHWSUBITEM_OBJ lpSubItem, BOOL align, BOOL notImage = FALSE) {
if (lpData == NULL) return -1;
if (maxSize == 0) return -2;
if (lpSubItem == NULL) return -3;
Expand All @@ -411,7 +403,7 @@ static int MakeSubItem(LPVOID lpData, uint32_t maxSize, PHWSUBITEM_OBJ lpSubItem
memcpy_s(MakePointer32(lpItem, offset), lpSubItem->u32TotalSize - offset, &(lpSubItem->hdrHuaWei), sizeof(HW_HDR));
offset += sizeof(HW_HDR);

if (lpSubItem->bIsImage) {
if (lpSubItem->bIsImage && notImage == FALSE) {
memcpy_s(MakePointer32(lpItem, offset), lpSubItem->u32TotalSize - offset, &(lpSubItem->hdrImage), sizeof(UIMG_HDR));
offset += sizeof(UIMG_HDR);

Expand Down Expand Up @@ -1080,9 +1072,9 @@ INT_PTR CALLBACK DlgProc_AdvDatFmt(HWND hDlg, UINT message, WPARAM wParam, LPARA
//导出选中子项目
case IDC_BTN_EXP_HW_ITEM:
{
//size_t stOut;
int ret;
WCHAR szFile[MAX_PATH] = { 0 };
//size_t stOut;
//WCHAR szTemp[MAX_PATH];

if (lpCurrentItem == NULL || lpCurrentItem->bIsInit == FALSE) break;
Expand All @@ -1095,7 +1087,7 @@ INT_PTR CALLBACK DlgProc_AdvDatFmt(HWND hDlg, UINT message, WPARAM wParam, LPARA
LPVOID lpData = malloc(lpCurrentItem->u32TotalSize);

__try {
ret = MakeSubItem(lpData, lpCurrentItem->u32TotalSize, lpCurrentItem, FALSE);
ret = MakeSubItem(lpData, lpCurrentItem->u32TotalSize, lpCurrentItem, FALSE, TRUE);

if (ret < 0) {
SetTooltip(GetDlgItem(hDlg, IDC_LBL_ADF_STATUS), L"构造子对象失败: [%d]!", ret);
Expand Down
2 changes: 1 addition & 1 deletion HWFW_GUI/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define APP_NAME L"HWFW_GUI"
#define APP_VER1 L"1.0.8"
#define APP_VER2 L"Beta"
#define APP_BUILD_VER L"004"
#define APP_BUILD_VER L"005"


#if defined _M_IX86
Expand Down

0 comments on commit 201ea20

Please sign in to comment.