Changeset 751 for trunk/dll/arccnrs.c
- Timestamp:
- Aug 3, 2007, 1:05:48 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/arccnrs.c
r740 r751 40 40 10 Jun 07 GKY Add CheckPmDrgLimit including IsFm2Window as part of work around PM drag limit 41 41 16 Jun 07 SHL Use DosQueryAppType not DosQAppType 42 02 Aug 07 SHL Sync with ARCITEM mods 42 43 43 44 ***********************************************************************/ … … 60 61 #include <limits.h> 61 62 #include <process.h> // _beginthread 63 #include <malloc.h> // _heapchk 62 64 63 65 #include "fm3dll.h" … … 307 309 } 308 310 311 /** 312 * Free storage associated with archive container item 313 * Caller is responsible for correcting pointers 314 */ 315 316 static VOID FreeArcItemData(PARCITEM pai) 317 { 318 // DbgMsg(pszSrcFile, __LINE__, "FreeArcItemData %p", pai); 319 320 if (pai->pszFileName && pai->pszFileName != NullStr) 321 xfree(pai->pszFileName); 322 } 323 324 /** 325 * Remove item from archive container and free associated storage if requested 326 */ 327 328 static VOID RemoveArcItems(HWND hwnd, PARCITEM pai, USHORT usCnt, USHORT usFlags) 329 { 330 if (usCnt == 0) { 331 if (pai != NULL) 332 Runtime_Error(pszSrcFile, __LINE__, "pai not NULL"); 333 else { 334 for (;;) { 335 pai = (PARCITEM)WinSendMsg(hwnd, CM_QUERYRECORD, MPVOID, 336 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 337 if (!pai) 338 break; 339 else if ((INT)pai == -1) { 340 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,"CM_QUERYRECORD"); 341 break; 342 } 343 else 344 RemoveArcItems(hwnd, pai, 1, usFlags); 345 } 346 } 347 } 348 else if (usCnt != 1) 349 Runtime_Error(pszSrcFile, __LINE__, "count not 1"); 350 else { 351 // DbgMsg(pszSrcFile, __LINE__, "RemoveArcItems %p %u %s", pai, usCnt, pai->pszFileName); 352 353 if (usFlags & CMA_FREE) 354 FreeArcItemData(pai); 355 356 if ((INT)WinSendMsg(hwnd, CM_REMOVERECORD, MPFROMP(&pai), MPFROM2SHORT(usCnt, usFlags)) == -1) { 357 // Win_Error2(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,IDS_CMREMOVEERRTEXT); 358 Win_Error(hwnd, HWND_DESKTOP, pszSrcFile, __LINE__,"CM_REMOVERECORD hwnd %x pai %p", hwnd, pai); 359 } 360 } 361 } 362 363 /** 364 * Empty all records from an archive container and free associated storage and 365 * Free up field infos 366 */ 367 368 static VOID EmptyArcCnr(HWND hwnd) 369 { 370 #if 1 // fixme to disable or to be configurable 371 { 372 int state = _heapchk(); 373 if (state != _HEAPOK) 374 Runtime_Error(pszSrcFile, __LINE__, "heap corrupted %d", state); 375 } 376 #endif 377 378 // Remove all ARCITEM records 379 RemoveArcItems(hwnd, NULL, 0, CMA_FREE); 380 381 // Use common code to remove rest 382 EmptyCnr(hwnd); 383 } 384 309 385 //== FillArcCnr() generate archive content list and fill container window == 310 386 … … 359 435 Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT); 360 436 else { 361 WinSendMsg(hwndCnr, 362 CM_REMOVERECORD, 363 MPVOID, 364 MPFROM2SHORT(0, CMA_FREE | CMA_INVALIDATE | CMA_ERASE)); 437 RemoveArcItems(hwndCnr, NULL, 0, CMA_FREE | CMA_INVALIDATE | CMA_ERASE); 365 438 *arcinfo = info; 366 439 highest = info->osizepos; … … 3215 3288 WinDestroyWindow(ArcCnrMenu); 3216 3289 ArcMenu = ArcCnrMenu = (HWND) 0; 3217 Empty Cnr(hwnd);3290 EmptyArcCnr(hwnd); 3218 3291 break; 3219 3292 }
Note:
See TracChangeset
for help on using the changeset viewer.