rem: hList = (MEM_HANDLE)LOWORD ( ResHeaderPtr->PackageList[i].flags_and_data_loc); LockResourceHandleList (ResHeaderPtr, hList, i + 1, &ResourceHandleListPtr, &TypeEncodePtr, &DataPtr); printf ("Package %u has %u instances left\n", i + 1, ResourceHandleListPtr->num_valid_handles); UnlockResourceHandleList (hList); } } }
add: hList = (MEM_HANDLE)LOWORD ( ResHeaderPtr->PackageList[i].flags_and_data_loc); LockResourceHandleList (ResHeaderPtr, hList, i + 1, &ResourceHandleListPtr, &TypeEncodePtr, &DataPtr); fprintf (stderr, "Package %u has %u instances left\n", i + 1, ResourceHandleListPtr->num_valid_handles); UnlockResourceHandleList (hList); } } }
context: CloseResourceIndex (MEM_HANDLE hRH){	if (UnlockResourceHeader (hRH))	{		FILE *res_fp;		INDEX_HEADERPTR ResHeaderPtr;		ResHeaderPtr = LockResourceHeader (hRH);#ifdef DEBUG{COUNT i;for (i = 0; i < ResHeaderPtr->num_packages; ++i){	UWORD hi;	hi = HIWORD (ResHeaderPtr->PackageList[i].flags_and_data_loc);	if (HIBYTE (hi) == 0)	{		MEM_HANDLE hList;		RES_HANDLE_LISTPTR ResourceHandleListPtr;		ENCODEPTR TypeEncodePtr;		DATAPTR DataPtr;		hList = (MEM_HANDLE)LOWORD (				ResHeaderPtr->PackageList[i].flags_and_data_loc);		LockResourceHandleList (ResHeaderPtr, hList, i + 1,				&ResourceHandleListPtr, &TypeEncodePtr, &DataPtr);		printf ("Package %u has %u instances left\n",				i + 1, ResourceHandleListPtr->num_valid_handles);		UnlockResourceHandleList (hList);	}}}#endif /* DEBUG */		_sub_index_list (hRH);		res_fp = ResHeaderPtr->res_fp;		if (ResHeaderPtr == _get_current_index_header ())			SetResourceIndex (hIndexList);		UnlockResourceHeader (hRH);		FreeResourceHeader (hRH);		if (res_fp)		{			MEM_HANDLE hNextRH;			for (hRH = hIndexList; hRH && res_fp; hRH = hNextRH)			{				ResHeaderPtr = LockResourceHeader (hRH);				if (res_fp == ResHeaderPtr->res_fp)					res_fp = 0;				hNextRH = ResHeaderPtr->hSuccHeader;				UnlockResourceHeader (hRH);			}			if (res_fp)				CloseResFile (res_fp);		}		return (TRUE);	}	return (FALSE);}