[145] | 1 |
|
---|
| 2 | /***********************************************************************
|
---|
| 3 |
|
---|
| 4 | $Id: flesh.c 1876 2015-10-10 23:42:28Z gyoung $
|
---|
| 5 |
|
---|
[1856] | 6 | Drive tree container management
|
---|
[145] | 7 |
|
---|
| 8 | Copyright (c) 1993-98 M. Kimes
|
---|
[1858] | 9 | Copyright (c) 2005, 2015 Steven H. Levine
|
---|
[145] | 10 |
|
---|
| 11 | 24 May 05 SHL Rework Win_Error usage
|
---|
[166] | 12 | 25 May 05 SHL Rework for ProcessDirectory
|
---|
[284] | 13 | 28 May 05 SHL Clean while reading code
|
---|
| 14 | 24 Oct 05 SHL Delete obsolete code
|
---|
[340] | 15 | 22 Jul 06 SHL Check more run time errors
|
---|
[515] | 16 | 19 Oct 06 SHL Stubby - correct . and .. detect
|
---|
[574] | 17 | 22 Mar 07 GKY Use QWL_USER
|
---|
[751] | 18 | 01 Aug 07 SHL Sync with CNRITEM mods
|
---|
[775] | 19 | 06 Aug 07 GKY Reduce DosSleep times (ticket 148)
|
---|
[793] | 20 | 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat
|
---|
[985] | 21 | 29 Feb 08 GKY Use xfree where appropriate
|
---|
[1299] | 22 | 24 Nov 08 GKY remove redundant code and minor speed up of Stubby
|
---|
[1358] | 23 | 25 Dec 08 GKY Add ProcessDirectoryThread to allow optional recursive drive scan at startup.
|
---|
| 24 | 25 Dec 08 GKY Add DRIVE_RSCANNED flag to monitor for the first recursive drive scan per session
|
---|
[1471] | 25 | to prevent duplicate directory names in tree following a copy before initial scan.
|
---|
[1400] | 26 | 08 Mar 09 GKY Additional strings move to PCSZs in init.c
|
---|
[1482] | 27 | 13 Dec 09 GKY Fixed separate paramenters. Please note that appname should be used in
|
---|
[1856] | 28 | profile calls for user settings that work and are setable in more than one
|
---|
| 29 | miniapp; FM3Str should be used for setting only relavent to FM/2 or that
|
---|
| 30 | aren't user settable; realappname should be used for setting applicable to
|
---|
| 31 | one or more miniapp but not to FM/2
|
---|
[1662] | 32 | 17 Jan 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *.
|
---|
| 33 | 04 Aug 12 GKY Fix trap on close during drive scan
|
---|
[1837] | 34 | 02 Aug 15 GKY Fix trap in Stubby
|
---|
[1856] | 35 | 03 Aug 15 SHL Document Stubby a bit better
|
---|
| 36 | 07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh
|
---|
[1858] | 37 | 19 Aug 15 SHL Allow WaitFleshWorkListEmpty to wait for dependent items
|
---|
[1864] | 38 | 23 Aug 15 GKY Fixed code to notify on drive with no subdirectories in first 64 entries
|
---|
[1871] | 39 | 20 Sep 15 GKY Add code for Flesh to skip the directory entry added by Stubby (eliminate
|
---|
| 40 | use of NULL/Nullstr pszFileNames by Stubby). Add code in Stubby to insert a
|
---|
| 41 | complete container item. Add a flag to indicate when a directory needed to be
|
---|
| 42 | Fleshed
|
---|
[1873] | 43 | 26 Sep 15 GKY Changes to speed up ExpandAll
|
---|
| 44 | 26 Sep 15 GKY WaitFleshWorkListEmpty now gives error message and returns if semaphore request
|
---|
| 45 | fails more than 5 consecutive times.
|
---|
[1874] | 46 | 27 Sep 15 GKY DosSleep times in WaitFleshWorkListEmpty set by caller
|
---|
[1876] | 47 | 10 Oct 15 GKY Don't use Flesh thread for floppy drive scans fix them getting mistakenly identified
|
---|
| 48 | as directories and add nonexistent subdirectories.
|
---|
[145] | 49 |
|
---|
| 50 | ***********************************************************************/
|
---|
| 51 |
|
---|
[907] | 52 | #include <stdlib.h>
|
---|
| 53 | #include <string.h>
|
---|
| 54 | #include <ctype.h>
|
---|
[1831] | 55 | //#include <malloc.h>
|
---|
[907] | 56 |
|
---|
[2] | 57 | #define INCL_DOS
|
---|
| 58 | #define INCL_DOSERRORS
|
---|
| 59 | #define INCL_WIN
|
---|
[907] | 60 | #define INCL_LONGLONG // dircnrs.h
|
---|
[2] | 61 |
|
---|
[1177] | 62 | #include "fm3dll.h"
|
---|
[1207] | 63 | #include "draglist.h" // Data declaration(s)
|
---|
| 64 | #include "notebook.h" // Data declaration(s)
|
---|
| 65 | #include "info.h" // Data declaration(s)
|
---|
| 66 | #include "init.h" // Data declaration(s)
|
---|
| 67 | #include "mainwnd.h" // Data declaration(s)
|
---|
[907] | 68 | #include "fm3str.h"
|
---|
| 69 | #include "filldir.h" // FileAttrToString...
|
---|
| 70 | #include "errutil.h" // Dos_Error...
|
---|
| 71 | #include "strutil.h" // GetPString
|
---|
[1155] | 72 | #include "flesh.h"
|
---|
| 73 | #include "valid.h" // IsValidDir
|
---|
[1856] | 74 | #include "misc.h" // LoadLibPath GetTidForThread
|
---|
[1177] | 75 | #include "findrec.h" // FindCnrRecord
|
---|
| 76 | #include "notify.h" // Notify
|
---|
| 77 | #include "wrappers.h" // xfree
|
---|
[1354] | 78 | #include "excputil.h" // xbeginthread
|
---|
[1856] | 79 | #include "listutil.h" // List...
|
---|
| 80 | #include "common.h" // IncrThreadUsage DecrThreadUsage
|
---|
[1871] | 81 | #include "pathutil.h"
|
---|
[1873] | 82 | #include "treecnr.h" // fExpandAll
|
---|
[1831] | 83 | #if 0
|
---|
| 84 | #define __PMPRINTF__
|
---|
| 85 | #include "PMPRINTF.H"
|
---|
| 86 | #endif
|
---|
[2] | 87 |
|
---|
[1207] | 88 | // Data definitions
|
---|
[2] | 89 | #pragma data_seg(DATA1)
|
---|
[340] | 90 |
|
---|
| 91 | static PSZ pszSrcFile = __FILE__;
|
---|
| 92 |
|
---|
[1856] | 93 |
|
---|
| 94 | static INT tidFleshWorkListThread = -1; // 2015-08-08 SHL
|
---|
| 95 |
|
---|
[1860] | 96 | static PCSZ pszFleshFocusPath; // 2015-08-20 SHL
|
---|
[1871] | 97 | #if 0
|
---|
[1856] | 98 | BOOL fNoFleshDbgMsg; // 2015-08-09 SHL FIXME to be gone
|
---|
[1871] | 99 | #endif
|
---|
[1207] | 100 | #pragma data_seg(GLOBAL1)
|
---|
| 101 | ULONG NoBrokenNotify;
|
---|
| 102 | BOOL fFilesInTree;
|
---|
| 103 |
|
---|
[1876] | 104 | //BOOL Flesh(HWND hwndCnr, PCNRITEM pciParent);
|
---|
[1856] | 105 |
|
---|
| 106 | BOOL Stubby(HWND hwndCnr, PCNRITEM pciParent);
|
---|
| 107 | BOOL FleshEnv(HWND hwndCnr, PCNRITEM pciParent);
|
---|
[1876] | 108 | //VOID UnFlesh(HWND hwndCnr, PCNRITEM pciParent);
|
---|
[1856] | 109 |
|
---|
| 110 | /**
|
---|
| 111 | * Insert CNRITEMs for members of PATH-like environment variable
|
---|
| 112 | * @param hwndCnr is the container to be populated
|
---|
| 113 | * @param pciParent is CNRITEM defining PATH-like environment variable
|
---|
| 114 | * @return TRUE if OK, FALSE is error detected
|
---|
| 115 | */
|
---|
| 116 |
|
---|
[551] | 117 | BOOL FleshEnv(HWND hwndCnr, PCNRITEM pciParent)
|
---|
[175] | 118 | {
|
---|
[551] | 119 | PCNRITEM pciL;
|
---|
[2] | 120 | DIRCNRDATA *dcd;
|
---|
[551] | 121 | CHAR path[CCHMAXPATH + 12],
|
---|
| 122 | fullpath[CCHMAXPATH + 12], *env, *p, *pp, *var = NULL;
|
---|
[2] | 123 |
|
---|
[1858] | 124 | if (!pciParent || (INT)pciParent == -1 || !hwndCnr)
|
---|
[2] | 125 | return FALSE;
|
---|
[1856] | 126 |
|
---|
[574] | 127 | dcd = (DIRCNRDATA *) WinQueryWindowPtr(hwndCnr, QWL_USER);
|
---|
[551] | 128 | if (!dcd)
|
---|
[2] | 129 | return FALSE;
|
---|
| 130 |
|
---|
[730] | 131 | strcpy(path, pciParent->pszFileName + 1);
|
---|
[551] | 132 | if (stricmp(path, GetPString(IDS_ENVVARSTEXT) + 1))
|
---|
| 133 | UnFlesh(hwndCnr, pciParent);
|
---|
| 134 | if (*path) {
|
---|
[2] | 135 | path[strlen(path) - 1] = 0;
|
---|
[1400] | 136 | if (!stricmp(path, PCSZ_LIBPATH)) {
|
---|
[551] | 137 | var = xmalloc(65536, pszSrcFile, __LINE__);
|
---|
| 138 | if (var)
|
---|
| 139 | LoadLibPath(var, 65536);
|
---|
[2] | 140 | env = var;
|
---|
| 141 | }
|
---|
| 142 | else
|
---|
| 143 | env = getenv(path);
|
---|
[551] | 144 | if (env && *env) {
|
---|
[2] | 145 | p = env;
|
---|
[551] | 146 | while (*p) {
|
---|
| 147 | pp = path;
|
---|
| 148 | while (*p == ';')
|
---|
| 149 | p++;
|
---|
| 150 | while (*p && *p != ';') {
|
---|
| 151 | *pp = *p;
|
---|
| 152 | p++;
|
---|
| 153 | pp++;
|
---|
| 154 | }
|
---|
| 155 | *pp = 0;
|
---|
| 156 | if (*path &&
|
---|
| 157 | strcmp(path, ".") &&
|
---|
| 158 | strcmp(path, ".\\") &&
|
---|
| 159 | strcmp(path, "..") &&
|
---|
| 160 | strcmp(path, "..\\") &&
|
---|
| 161 | strncmp(path, ".\\", 2) && strncmp(path, "..\\", 3)) {
|
---|
| 162 | if (!DosQueryPathInfo(path,
|
---|
| 163 | FIL_QUERYFULLNAME,
|
---|
| 164 | fullpath,
|
---|
| 165 | sizeof(fullpath)) && IsValidDir(fullpath)) {
|
---|
| 166 | pciL = FindCnrRecord(hwndCnr,
|
---|
| 167 | fullpath, pciParent, FALSE, FALSE, FALSE);
|
---|
| 168 | if (pciL) {
|
---|
[1858] | 169 | while (pciL && pciL != (PCNRITEM)-1 && pciL != pciParent)
|
---|
[551] | 170 | pciL = WinSendMsg(hwndCnr,
|
---|
| 171 | CM_QUERYRECORD,
|
---|
| 172 | MPFROMP(pciL),
|
---|
| 173 | MPFROM2SHORT(CMA_PARENT, CMA_ITEMORDER));
|
---|
| 174 | }
|
---|
| 175 | if (!pciL) {
|
---|
[2] | 176 |
|
---|
[551] | 177 | RECORDINSERT ri;
|
---|
[2] | 178 |
|
---|
[551] | 179 | pciL = WinSendMsg(hwndCnr,
|
---|
| 180 | CM_ALLOCRECORD,
|
---|
[751] | 181 | MPFROMLONG(EXTRA_RECORD_BYTES),
|
---|
[551] | 182 | MPFROMLONG(1));
|
---|
| 183 | if (pciL) {
|
---|
[730] | 184 | pciL->pszFileName = xstrdup(fullpath, pszSrcFile, __LINE__);
|
---|
[751] | 185 | pciL->rc.pszIcon = pciL->pszFileName;
|
---|
[551] | 186 | if (!fNoIconsDirs &&
|
---|
| 187 | (!isalpha(*fullpath) ||
|
---|
| 188 | !(driveflags[toupper(*fullpath) - 'A'] &
|
---|
| 189 | DRIVE_NOLOADICONS)))
|
---|
| 190 | pciL->rc.hptrIcon = WinLoadFileIcon(fullpath, FALSE);
|
---|
| 191 | if (!pciL->rc.hptrIcon)
|
---|
| 192 | pciL->rc.hptrIcon = hptrDir;
|
---|
| 193 | pciL->attrFile = FILE_DIRECTORY;
|
---|
[751] | 194 | pciL->pszDispAttr = FileAttrToString(pciL->attrFile);
|
---|
[551] | 195 | memset(&ri, 0, sizeof(ri));
|
---|
| 196 | ri.cb = sizeof(ri);
|
---|
[1858] | 197 | ri.pRecordOrder = (PRECORDCORE)CMA_END;
|
---|
| 198 | ri.pRecordParent = (PRECORDCORE)pciParent;
|
---|
| 199 | ri.zOrder = (ULONG)CMA_TOP;
|
---|
[551] | 200 | ri.cRecordsInsert = 1;
|
---|
| 201 | ri.fInvalidateRecord = FALSE;
|
---|
[1871] | 202 | #if 0 // 2015-08-03 SHL FIXME debug
|
---|
[1858] | 203 | if (pciL->pszFileName == NullStr)
|
---|
| 204 | DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD pci %p pszFileName \"%s\"", pciL, pciL->pszFileName); // 2015-08-03 SHL FIXME debug
|
---|
[1871] | 205 | #endif
|
---|
| 206 | if (!WinSendMsg(hwndCnr,
|
---|
[551] | 207 | CM_INSERTRECORD, MPFROMP(pciL), MPFROMP(&ri)))
|
---|
[751] | 208 | FreeCnrItem(hwndCnr, pciL);
|
---|
[551] | 209 | }
|
---|
| 210 | }
|
---|
| 211 | }
|
---|
| 212 | }
|
---|
[2] | 213 | }
|
---|
| 214 | }
|
---|
[1009] | 215 | xfree(var, pszSrcFile, __LINE__);
|
---|
[1858] | 216 | pciL = (PCNRITEM)WinSendMsg(hwndCnr,
|
---|
| 217 | CM_QUERYRECORD,
|
---|
| 218 | MPFROMP(pciParent),
|
---|
| 219 | MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
|
---|
| 220 | while (pciL && (INT)pciL != -1) {
|
---|
[2] | 221 | pciL->flags |= (RECFLAGS_NODRAG | RECFLAGS_UNDERENV);
|
---|
| 222 | WinSendMsg(hwndCnr,
|
---|
[551] | 223 | CM_INVALIDATERECORD, MPFROMP(&pciL), MPFROM2SHORT(1, 0));
|
---|
[2] | 224 | pciL = WinSendMsg(hwndCnr,
|
---|
[551] | 225 | CM_QUERYRECORD,
|
---|
| 226 | MPFROMP(pciL), MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));
|
---|
[2] | 227 | }
|
---|
| 228 | }
|
---|
| 229 | return TRUE;
|
---|
| 230 | }
|
---|
| 231 |
|
---|
[1856] | 232 | /**
|
---|
| 233 | * Insert CNRITEMs for all children of pciParent
|
---|
| 234 | * @param hwnCnr is container to receive CNRITEMs
|
---|
| 235 | * @param pciParent is CNRITEM to have children inserted
|
---|
| 236 | * @return TRUE if OK, FALSE is error detected
|
---|
| 237 | */
|
---|
| 238 |
|
---|
[551] | 239 | BOOL Flesh(HWND hwndCnr, PCNRITEM pciParent)
|
---|
[166] | 240 | {
|
---|
[551] | 241 | PCNRITEM pciL;
|
---|
[2] | 242 | DIRCNRDATA *dcd;
|
---|
[1856] | 243 | BOOL includefiles;
|
---|
[2] | 244 |
|
---|
[1856] | 245 | if (!pciParent || (INT)pciParent == -1 || !hwndCnr)
|
---|
[2] | 246 | return FALSE;
|
---|
[1856] | 247 |
|
---|
[1858] | 248 | // 2015-08-13 SHL
|
---|
| 249 | if (fAmQuitting)
|
---|
| 250 | return FALSE;
|
---|
[1856] | 251 |
|
---|
[1871] | 252 | #if 0 // 2015-08-03 SHL FIXME debug
|
---|
[1856] | 253 | if (!fNoFleshDbgMsg) {
|
---|
| 254 | DbgMsg(pszSrcFile, __LINE__, "Flesh %s pciParent %p pszFileName %p",
|
---|
| 255 | pciParent && (INT)pciParent != -1 && pciParent->pszFileName ?
|
---|
| 256 | pciParent->pszFileName : "(null)",
|
---|
| 257 | pciParent,
|
---|
| 258 | pciParent && (INT)pciParent != -1 ? pciParent->pszFileName : (PVOID)-1); // 2015-08-03 SHL FIXME debug
|
---|
| 259 | }
|
---|
[1871] | 260 | #endif
|
---|
[1856] | 261 | // 2015-08-06 SHL allow pciL -1
|
---|
[1858] | 262 | // 2015-08-06 SHL FIXME to not need pszFileName check
|
---|
[1871] | 263 | if (!pciParent->fleshed) {
|
---|
| 264 | pciL = (PCNRITEM)WinSendMsg(hwndCnr,
|
---|
| 265 | CM_QUERYRECORD,
|
---|
| 266 | MPFROMP(pciParent),
|
---|
| 267 | MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
|
---|
[1874] | 268 | // Added by Stubby to create plus sign run Stubby on it here and skip it in ProcessDirectory
|
---|
[1856] | 269 | if (pciL && (INT)pciL != -1) {
|
---|
[1871] | 270 | AddFleshWorkRequest(hwndCnr, pciL, eStubby);
|
---|
[1874] | 271 | // 2015-08-06 SHL FIXME to ensure this can not happen
|
---|
[1871] | 272 | if (!*pciL->pszFileName || !strcmp(pciL->pszFileName, NullStr))
|
---|
| 273 | Runtime_Error(pszSrcFile, __LINE__, "Flesh called with pci %p pszFileName (null)", pciL);
|
---|
| 274 | #if 0
|
---|
[1856] | 275 | if (!fNoFleshDbgMsg)
|
---|
[1858] | 276 | DbgMsg(pszSrcFile, __LINE__, "Flesh RemoveCnrItems() pciL %p \"%s\"",
|
---|
| 277 | pciL,
|
---|
| 278 | pciL->pszFileName ? pciL->pszFileName : "(null)"); // 2015-08-04 SHL FIXME debug
|
---|
| 279 | // Assume refernces to pciL already removed from work list
|
---|
[1871] | 280 | #endif
|
---|
[1856] | 281 | }
|
---|
[1651] | 282 | dcd = INSTDATA(hwndCnr);
|
---|
| 283 | if (dcd && dcd->size != sizeof(DIRCNRDATA))
|
---|
| 284 | dcd = NULL;
|
---|
[1856] | 285 |
|
---|
| 286 | includefiles =
|
---|
| 287 | driveflags[toupper(*pciParent->pszFileName) - 'A'] & DRIVE_INCLUDEFILES ?
|
---|
| 288 | TRUE : fFilesInTree;
|
---|
| 289 |
|
---|
[1662] | 290 | ProcessDirectory(hwndCnr,
|
---|
[1856] | 291 | pciParent,
|
---|
| 292 | pciParent->pszFileName,
|
---|
| 293 | includefiles, // filestoo
|
---|
| 294 | TRUE, // recurse
|
---|
| 295 | TRUE, // partial
|
---|
| 296 | NULL, // stop flag
|
---|
| 297 | dcd,
|
---|
| 298 | NULL, // total files
|
---|
[1871] | 299 | NULL, // total bytes
|
---|
| 300 | (pciL && (INT)pciL != -1) ? pciL->pszDisplayName : 0);
|
---|
| 301 | pciParent->fleshed = TRUE;
|
---|
[1655] | 302 | return TRUE;
|
---|
[1651] | 303 | }
|
---|
[1856] | 304 |
|
---|
[1655] | 305 | return FALSE;
|
---|
[2] | 306 | }
|
---|
| 307 |
|
---|
[1858] | 308 | /**
|
---|
| 309 | * Remove children from container
|
---|
[1865] | 310 | * @param pciParent is parent of children to be removed
|
---|
[1858] | 311 | */
|
---|
[1856] | 312 |
|
---|
[1858] | 313 | VOID UnFlesh(HWND hwndCnr, PCNRITEM pciParent)
|
---|
[175] | 314 | {
|
---|
[1856] | 315 | BOOL removed = FALSE;
|
---|
[2] | 316 | PCNRITEM pciL;
|
---|
| 317 |
|
---|
[175] | 318 | if (!pciParent || !hwndCnr)
|
---|
[1858] | 319 | return;
|
---|
[1871] | 320 | #if 0
|
---|
[1856] | 321 | if (!fNoFleshDbgMsg)
|
---|
[1865] | 322 | DbgMsg(pszSrcFile, __LINE__, "UnFlesh pciParent %p pszFileName \"%s\"", pciParent, pciParent->pszFileName ? pciParent->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug
|
---|
[1871] | 323 | #endif
|
---|
[551] | 324 | for (;;) {
|
---|
[1858] | 325 | pciL = (PCNRITEM)WinSendMsg(hwndCnr,
|
---|
| 326 | CM_QUERYRECORD,
|
---|
| 327 | MPFROMP(pciParent),
|
---|
| 328 | MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
|
---|
[1856] | 329 | if (!pciL || (INT)pciL == -1)
|
---|
| 330 | break; // Done
|
---|
[1871] | 331 | #if 0
|
---|
[1856] | 332 | if (!fNoFleshDbgMsg)
|
---|
[1865] | 333 | DbgMsg(pszSrcFile, __LINE__, "UnFlesh RemoveCnrItems() pciL %p \"%s\"", pciL, pciL->pszFileName ? pciL->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug
|
---|
[1871] | 334 | #endif
|
---|
[1856] | 335 | RemoveCnrItems(hwndCnr, pciL, 1, CMA_FREE);
|
---|
| 336 | removed = TRUE;
|
---|
| 337 | } // for
|
---|
| 338 |
|
---|
| 339 | if (removed) {
|
---|
[2] | 340 | WinSendMsg(hwndCnr,
|
---|
[551] | 341 | CM_INVALIDATERECORD,
|
---|
| 342 | MPFROMP(&pciParent),
|
---|
[1871] | 343 | MPFROM2SHORT(1, CMA_ERASE | CMA_REPOSITION));
|
---|
| 344 | pciParent->fleshed = FALSE;
|
---|
| 345 | DosSleep(1); // Let container items go away
|
---|
[175] | 346 | }
|
---|
[1858] | 347 | return;
|
---|
[2] | 348 | }
|
---|
| 349 |
|
---|
[1482] | 350 | #define DDEPTH 64
|
---|
[2] | 351 |
|
---|
[1471] | 352 | /**
|
---|
[1856] | 353 | * Insert CNRITEM for 1st subdirectory [or file] of pciParent
|
---|
| 354 | * @param hwdCnr is container to be filled
|
---|
| 355 | * @param pciParent is CNRITEM to receive child record
|
---|
| 356 | * @return TRUE if record inserted, else FALSE
|
---|
| 357 | * Ensures that expand/collapse button displays if directory has children
|
---|
| 358 | * Secondary purpose is to detect broken LANs and inaccesible mapped drives
|
---|
[1471] | 359 | */
|
---|
| 360 |
|
---|
[551] | 361 | BOOL Stubby(HWND hwndCnr, PCNRITEM pciParent)
|
---|
[175] | 362 | {
|
---|
[1409] | 363 | /**
|
---|
[2] | 364 | * this code is full of workarounds for screwed up LANs.
|
---|
| 365 | * let's hope all the current LAN programmers fall into
|
---|
| 366 | * a black hole and make way for people who can get it right...
|
---|
| 367 | */
|
---|
| 368 |
|
---|
[1471] | 369 | BOOL ok = FALSE;
|
---|
[847] | 370 | FILEFINDBUF3 ffb[DDEPTH];
|
---|
| 371 | PFILEFINDBUF3 pffb;
|
---|
[551] | 372 | HDIR hDir = HDIR_CREATE;
|
---|
[1856] | 373 | ULONG nm, ulM = 1, total = 0, fl;
|
---|
[1858] | 374 | CHAR wildcard[CCHMAXPATH];
|
---|
[551] | 375 | register INT len;
|
---|
| 376 | APIRET rc, prc;
|
---|
[1858] | 377 | BOOL isadir = FALSE;
|
---|
| 378 | BOOL isremote;
|
---|
| 379 | BOOL includefiles;
|
---|
[1482] | 380 | ULONG ddepth = DDEPTH;
|
---|
[1299] | 381 | ULONG drvNum;
|
---|
| 382 | ULONG flags;
|
---|
[551] | 383 | static BOOL brokenlan = FALSE, isbroken = FALSE;
|
---|
[2] | 384 |
|
---|
[1871] | 385 | //DbgMsg(pszSrcFile, __LINE__,"Stubby pciParent %p", pciParent);
|
---|
[1858] | 386 | if (!pciParent || (INT)pciParent == -1 || !*pciParent->pszFileName
|
---|
[1832] | 387 | || pciParent->pszFileName == NullStr || !hwndCnr)
|
---|
[2] | 388 | return FALSE;
|
---|
[1871] | 389 | #if 0
|
---|
[1856] | 390 | if (!fNoFleshDbgMsg)
|
---|
| 391 | DbgMsg(pszSrcFile, __LINE__, "Stubby pciParent %p pszFileName %s", pciParent, pciParent->pszFileName); // 2015-08-03 SHL FIXME debug
|
---|
[1871] | 392 | #endif
|
---|
[1856] | 393 | // Build wildcard
|
---|
[730] | 394 | len = strlen(pciParent->pszFileName);
|
---|
[1858] | 395 | memcpy(wildcard, pciParent->pszFileName, len + 1);
|
---|
| 396 | if (wildcard[len - 1] != '\\')
|
---|
| 397 | wildcard[len++] = '\\';
|
---|
| 398 | wildcard[len++] = '*';
|
---|
| 399 | wildcard[len] = 0;
|
---|
[2] | 400 |
|
---|
[1858] | 401 | // 2015-08-19 SHL FIXME to know how this can happen
|
---|
| 402 | if (!isalpha(*wildcard) || wildcard[1] != ':' || wildcard[2] != '\\') {
|
---|
| 403 | MakeFullName(wildcard);
|
---|
[1871] | 404 | //DbgMsg(pszSrcFile, __LINE__, "Stubby MakeFullName returned %s", wildcard); // 2015-08-19 SHL FIXME debug
|
---|
[1858] | 405 | }
|
---|
[1299] | 406 | drvNum = toupper(*pciParent->pszFileName) - 'A';
|
---|
| 407 | flags = driveflags[drvNum];
|
---|
[1858] | 408 | if (!isalpha(*wildcard) ||
|
---|
| 409 | wildcard[1] != ':' ||
|
---|
| 410 | wildcard[2] != '\\' || ((flags & DRIVE_IGNORE)))
|
---|
[1856] | 411 | return FALSE; // Not a directory or ignore requested
|
---|
[2] | 412 |
|
---|
[1856] | 413 | includefiles = flags & DRIVE_INCLUDEFILES ? TRUE : fFilesInTree;
|
---|
[2] | 414 |
|
---|
[1856] | 415 | isremote = flags & DRIVE_REMOTE ? TRUE : FALSE;
|
---|
[2] | 416 |
|
---|
[551] | 417 | if (isremote) {
|
---|
| 418 | if (fRemoteBug) {
|
---|
| 419 | if (brokenlan) {
|
---|
[1858] | 420 | ddepth = (ULONG)-1;
|
---|
[551] | 421 | ddepth--;
|
---|
[2] | 422 | }
|
---|
[761] | 423 | ulM = 1;
|
---|
[2] | 424 | }
|
---|
| 425 | }
|
---|
[551] | 426 | else if (isbroken)
|
---|
[2] | 427 | ddepth = 14;
|
---|
| 428 |
|
---|
[1482] | 429 | if (!fRemoteBug)
|
---|
[1856] | 430 | ulM = ddepth <= DDEPTH ? ddepth : 1;
|
---|
[2] | 431 |
|
---|
| 432 | nm = ulM;
|
---|
| 433 |
|
---|
| 434 | DosError(FERR_DISABLEHARDERR);
|
---|
[1856] | 435 |
|
---|
| 436 | fl = includefiles ? FILE_DIRECTORY : MUST_HAVE_DIRECTORY;
|
---|
| 437 |
|
---|
[1871] | 438 | //DbgMsg(pszSrcFile, __LINE__, "Stubby DosFindFirst(%s)", wildcard); // 2015-08-19 SHL FIXME debug
|
---|
[1858] | 439 |
|
---|
| 440 | rc = DosFindFirst(wildcard,
|
---|
[847] | 441 | &hDir,
|
---|
| 442 | FILE_NORMAL | fl |
|
---|
| 443 | FILE_READONLY | FILE_ARCHIVED |
|
---|
| 444 | FILE_SYSTEM | FILE_HIDDEN,
|
---|
| 445 | &ffb, ulM * sizeof(FILEFINDBUF3), &nm, FIL_STANDARD);
|
---|
[761] | 446 | if (ulM == 1 && !rc) {
|
---|
[1856] | 447 | // Loop looking for 1st directory (or file)
|
---|
[2] | 448 | do {
|
---|
| 449 | pffb = &ffb[0];
|
---|
[551] | 450 | if (!includefiles && !(pffb->attrFile & FILE_DIRECTORY) && !brokenlan) {
|
---|
[1856] | 451 | // Find returned file when only directories requested
|
---|
[551] | 452 | brokenlan = TRUE;
|
---|
[1858] | 453 | ddepth = (ULONG)-1;
|
---|
[551] | 454 | ddepth--;
|
---|
| 455 | if (!NoBrokenNotify) {
|
---|
| 456 | prc = saymsg(MB_YESNO | MB_ICONEXCLAMATION,
|
---|
| 457 | HWND_DESKTOP,
|
---|
| 458 | GetPString(IDS_LANERRORTITLETEXT),
|
---|
| 459 | GetPString(IDS_LANERRORTEXT));
|
---|
| 460 | if (prc == MBID_NO) {
|
---|
| 461 | saymsg(MB_ENTER,
|
---|
| 462 | HWND_DESKTOP,
|
---|
| 463 | GetPString(IDS_LANERROR2TITLETEXT),
|
---|
| 464 | GetPString(IDS_LANERROR2TEXT));
|
---|
[847] | 465 | NoBrokenNotify = 255;
|
---|
[1505] | 466 | PrfWriteProfileData(fmprof, FM3Str, "NoBrokenNotify",
|
---|
[551] | 467 | &NoBrokenNotify, sizeof(ULONG));
|
---|
| 468 | }
|
---|
| 469 | }
|
---|
| 470 | else {
|
---|
| 471 | NoBrokenNotify--;
|
---|
[1505] | 472 | PrfWriteProfileData(fmprof, FM3Str, "NoBrokenNotify",
|
---|
[551] | 473 | &NoBrokenNotify, sizeof(ULONG));
|
---|
| 474 | }
|
---|
[2] | 475 | }
|
---|
[1856] | 476 |
|
---|
[515] | 477 | if (*pffb->achName &&
|
---|
[551] | 478 | (includefiles || (pffb->attrFile & FILE_DIRECTORY)) &&
|
---|
| 479 | (pffb->achName[0] != '.' ||
|
---|
[515] | 480 | (pffb->achName[1] &&
|
---|
[551] | 481 | (pffb->achName[1] != '.' || pffb->achName[2])))) {
|
---|
[1856] | 482 | // Got directory other than . or .. (or a file)
|
---|
[551] | 483 | DosFindClose(hDir);
|
---|
| 484 | isadir = TRUE;
|
---|
| 485 | goto Interruptus;
|
---|
[2] | 486 | }
|
---|
[761] | 487 | nm = 1;
|
---|
[2] | 488 | DosError(FERR_DISABLEHARDERR);
|
---|
[1856] | 489 | } while (++total < ddepth && !(rc = (DosFindNext(hDir,
|
---|
| 490 | &ffb,
|
---|
| 491 | sizeof(FILEFINDBUF3),
|
---|
| 492 | &nm))));
|
---|
| 493 | DosFindClose(hDir);
|
---|
| 494 |
|
---|
[730] | 495 | if (toupper(*pciParent->pszFileName) > 'B' &&
|
---|
[751] | 496 | (*(pciParent->pszFileName + 1)) == ':' &&
|
---|
[730] | 497 | (*(pciParent->pszFileName + 2)) == '\\' && !(*(pciParent->pszFileName + 3))) {
|
---|
[2] | 498 |
|
---|
[1856] | 499 | // Searching root of hard or remote drive and find reported error
|
---|
[2] | 500 | CHAR s[132];
|
---|
| 501 | sprintf(s,
|
---|
[551] | 502 | GetPString(IDS_NOSUBDIRSTEXT),
|
---|
[730] | 503 | total, toupper(*pciParent->pszFileName));
|
---|
[551] | 504 | if (rc && rc != ERROR_NO_MORE_FILES)
|
---|
[1858] | 505 | sprintf(&s[strlen(s)], GetPString(IDS_SEARCHERRORTEXT), rc, wildcard);
|
---|
[847] | 506 | else if (ddepth < 16)
|
---|
[551] | 507 | brokenlan = TRUE;
|
---|
[2] | 508 | Notify(s);
|
---|
| 509 | }
|
---|
[1856] | 510 | goto None; // Done
|
---|
[2] | 511 | }
|
---|
[551] | 512 | if (!rc) {
|
---|
[2] | 513 | DosFindClose(hDir);
|
---|
[551] | 514 | if (nm) {
|
---|
[1353] | 515 | PBYTE fb = (PBYTE)&ffb[0];
|
---|
[551] | 516 | for (len = 0; len < nm; len++) {
|
---|
[847] | 517 | pffb = (PFILEFINDBUF3) fb;
|
---|
[551] | 518 | if (!includefiles && !(pffb->attrFile & FILE_DIRECTORY)) {
|
---|
[1856] | 519 | // Got file(s), but did not ask for files
|
---|
[551] | 520 | if (!isbroken) {
|
---|
| 521 | isbroken = TRUE;
|
---|
| 522 | if (!NoBrokenNotify) {
|
---|
| 523 | prc = saymsg(MB_YESNO | MB_ICONEXCLAMATION,
|
---|
| 524 | HWND_DESKTOP,
|
---|
| 525 | GetPString(IDS_FSDERRORTITLETEXT),
|
---|
| 526 | GetPString(IDS_FSDERRORTEXT),
|
---|
[1471] | 527 | isremote ? GetPString(IDS_REMOTETEXT) :
|
---|
| 528 | GetPString(IDS_LOCALTEXT),
|
---|
[1858] | 529 | *wildcard);
|
---|
[551] | 530 | if (prc == MBID_NO) {
|
---|
| 531 | saymsg(MB_ENTER,
|
---|
| 532 | HWND_DESKTOP,
|
---|
| 533 | GetPString(IDS_FSDERROR2TITLETEXT),
|
---|
| 534 | GetPString(IDS_FSDERROR2TEXT));
|
---|
[847] | 535 | NoBrokenNotify = 255;
|
---|
[1505] | 536 | PrfWriteProfileData(fmprof, FM3Str, "NoBrokenNotify",
|
---|
[551] | 537 | &NoBrokenNotify, sizeof(ULONG));
|
---|
| 538 | }
|
---|
| 539 | }
|
---|
| 540 | else {
|
---|
| 541 | NoBrokenNotify--;
|
---|
[1505] | 542 | PrfWriteProfileData(fmprof, FM3Str, "NoBrokenNotify",
|
---|
[551] | 543 | &NoBrokenNotify, sizeof(ULONG));
|
---|
| 544 | }
|
---|
[1856] | 545 | } // if !broken
|
---|
| 546 | } // if !directory
|
---|
| 547 |
|
---|
[551] | 548 | if (*pffb->achName &&
|
---|
| 549 | (includefiles || (pffb->attrFile & FILE_DIRECTORY)) &&
|
---|
[1856] | 550 | ((pffb->achName[0] && pffb->achName[0] != '.') ||
|
---|
| 551 | (pffb->achName[1] &&
|
---|
| 552 | (pffb->achName[1] != '.' || pffb->achName[2]))))
|
---|
| 553 | {
|
---|
[1871] | 554 | // Got directory other than . or .. (or a file)
|
---|
[551] | 555 | isadir = TRUE;
|
---|
| 556 | break;
|
---|
| 557 | }
|
---|
| 558 | fb += pffb->oNextEntryOffset;
|
---|
[1353] | 559 | } // for
|
---|
[2] | 560 |
|
---|
[551] | 561 | Interruptus:
|
---|
[2] | 562 |
|
---|
[551] | 563 | if (isadir) {
|
---|
[2] | 564 |
|
---|
[1856] | 565 | // Insert CNRITEM for selected directory (or file)
|
---|
[1471] | 566 | PCNRITEM pci;
|
---|
[2] | 567 |
|
---|
[1471] | 568 | if (WinIsWindow((HAB)0, hwndCnr)) {
|
---|
| 569 | pci = WinSendMsg(hwndCnr,
|
---|
| 570 | CM_ALLOCRECORD,
|
---|
| 571 | MPFROMLONG(EXTRA_RECORD_BYTES), MPFROMLONG(1));
|
---|
| 572 | if (!pci) {
|
---|
| 573 | Win_Error(hwndCnr, HWND_DESKTOP, __FILE__, __LINE__,
|
---|
| 574 | GetPString(IDS_RECORDALLOCFAILEDTEXT));
|
---|
| 575 | }
|
---|
| 576 | else {
|
---|
[1871] | 577 | RECORDINSERT ri;
|
---|
| 578 | CHAR szBuffer[CCHMAXPATH + 14];
|
---|
| 579 | CHAR *p;
|
---|
| 580 | HPOINTER hptr;
|
---|
| 581 |
|
---|
| 582 | p = strchr(wildcard, '*');
|
---|
| 583 | *p = 0;;
|
---|
| 584 | BldFullPathName(szBuffer, wildcard, pffb->achName);
|
---|
| 585 | pci->pszFileName = xstrdup(szBuffer, pszSrcFile, __LINE__); //NullStr; // 2015-08-19 SHL FIXME to doc why
|
---|
| 586 | p = strrchr(pci->pszFileName, '\\');
|
---|
| 587 | p++;
|
---|
| 588 | pci->pszDisplayName = p; //NullStr;
|
---|
| 589 | pci->rc.pszIcon = pci->pszDisplayName;
|
---|
| 590 | if (fForceUpper)
|
---|
| 591 | strupr(pci->pszFileName);
|
---|
| 592 | else if (fForceLower)
|
---|
| 593 | strlwr(pci->pszFileName);
|
---|
| 594 |
|
---|
| 595 | flags = driveflags[toupper(*pci->pszFileName) - 'A'];
|
---|
| 596 |
|
---|
| 597 | // get an icon to use with it
|
---|
| 598 | if (pffb->attrFile & FILE_DIRECTORY) {
|
---|
| 599 | // is directory
|
---|
| 600 | if (fNoIconsDirs ||
|
---|
| 601 | (flags & DRIVE_NOLOADICONS) ||
|
---|
| 602 | !isalpha(*pci->pszFileName)) {
|
---|
| 603 | hptr = (HPOINTER) 0;
|
---|
| 604 | }
|
---|
| 605 | else
|
---|
| 606 | hptr = WinLoadFileIcon(pci->pszFileName, FALSE);
|
---|
| 607 | }
|
---|
| 608 | else {
|
---|
| 609 | // is file
|
---|
| 610 | if (fNoIconsFiles ||
|
---|
| 611 | (flags & DRIVE_NOLOADICONS) ||
|
---|
| 612 | !isalpha(*pci->pszFileName)) {
|
---|
| 613 | hptr = (HPOINTER) 0;
|
---|
| 614 | }
|
---|
| 615 | else
|
---|
| 616 | hptr = WinLoadFileIcon(pci->pszFileName, FALSE);
|
---|
| 617 |
|
---|
| 618 | if (!hptr || IsDefaultIcon(hptr))
|
---|
| 619 | hptr = IDFile(pci->pszFileName);
|
---|
| 620 | }
|
---|
| 621 |
|
---|
| 622 | if (!hptr) {
|
---|
| 623 | hptr = pffb->attrFile & FILE_DIRECTORY ?
|
---|
| 624 | hptrDir : pffb->attrFile & FILE_SYSTEM ?
|
---|
| 625 | hptrSystem : pffb->attrFile & FILE_HIDDEN ?
|
---|
| 626 | hptrHidden : pffb->attrFile & FILE_READONLY ?
|
---|
| 627 | hptrReadonly : hptrFile;
|
---|
| 628 | }
|
---|
| 629 | pci->rc.hptrIcon = hptr;
|
---|
[1471] | 630 | memset(&ri, 0, sizeof(RECORDINSERT));
|
---|
| 631 | ri.cb = sizeof(RECORDINSERT);
|
---|
[1858] | 632 | ri.pRecordOrder = (PRECORDCORE)CMA_END;
|
---|
| 633 | ri.pRecordParent = (PRECORDCORE)pciParent;
|
---|
| 634 | ri.zOrder = (ULONG)CMA_TOP;
|
---|
[1471] | 635 | ri.cRecordsInsert = 1;
|
---|
[1856] | 636 | ri.fInvalidateRecord = TRUE;
|
---|
[1871] | 637 | #if 0 // 2015-08-03 SHL FIXME debug
|
---|
[1858] | 638 | if (pci->pszFileName == NullStr)
|
---|
| 639 | DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD %p \"%s\" %.255s", pci, pci->pszFileName, pffb->achName);
|
---|
[1871] | 640 | #endif
|
---|
| 641 | if (!WinSendMsg(hwndCnr,
|
---|
[1471] | 642 | CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) {
|
---|
[1856] | 643 | // Assume busy and try again
|
---|
[1471] | 644 | DosSleep(50); //05 Aug 07 GKY 100
|
---|
[1856] | 645 | WinSetFocus(HWND_DESKTOP, hwndCnr);
|
---|
[1871] | 646 | if (WinIsWindow((HAB)0, hwndCnr)) {
|
---|
| 647 | #if 0
|
---|
[1858] | 648 | if (!fNoFleshDbgMsg) {
|
---|
[1871] | 649 | // 2015-08-03 SHL FIXME debug
|
---|
| 650 | //if (pci->pszFileName == NullStr)
|
---|
| 651 | // DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD pci %p pszFileName \"%s\"", pci, pci->pszFileName); // 2015-08-03 SHL FIXME debug
|
---|
| 652 | }
|
---|
| 653 | #endif
|
---|
[1471] | 654 | if (!WinSendMsg(hwndCnr,
|
---|
| 655 | CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) {
|
---|
| 656 | Win_Error(hwndCnr, HWND_DESKTOP, __FILE__, __LINE__,
|
---|
| 657 | GetPString(IDS_RECORDINSERTFAILEDTEXT));
|
---|
| 658 | FreeCnrItem(hwndCnr, pci);
|
---|
| 659 | }
|
---|
[1871] | 660 | else
|
---|
[1876] | 661 | ok = TRUE;
|
---|
[1471] | 662 | }
|
---|
| 663 | }
|
---|
| 664 | else
|
---|
[1856] | 665 | ok = TRUE;
|
---|
[1471] | 666 | }
|
---|
| 667 | }
|
---|
[1856] | 668 | } // if isadir
|
---|
[2] | 669 | }
|
---|
[1864] | 670 | } // if !rc
|
---|
| 671 | else if (toupper(*wildcard) > 'B' && wildcard[1] == ':' && wildcard[2] == '\\' &&
|
---|
[1865] | 672 | wildcard[3] == '*' && !wildcard[4]) {
|
---|
[1864] | 673 | // Is root and no subdirectories
|
---|
| 674 | CHAR s[162];
|
---|
[1865] | 675 |
|
---|
[1864] | 676 | sprintf(s,
|
---|
[1865] | 677 | GetPString(IDS_NOSUBDIRS2TEXT),
|
---|
| 678 | nm,
|
---|
| 679 | toupper(*pciParent->pszFileName),
|
---|
| 680 | isremote ? GetPString(IDS_NOSUBDIRS3TEXT) : NullStr);
|
---|
[1864] | 681 | Notify(s);
|
---|
[2] | 682 | }
|
---|
[1858] | 683 | else if (toupper(*wildcard) > 'B' && rc != ERROR_NO_MORE_FILES) {
|
---|
[1856] | 684 | // Find for remote or hard drive failed with error
|
---|
[2] | 685 | CHAR s[CCHMAXPATH + 80];
|
---|
[1858] | 686 | sprintf(s, GetPString(IDS_SEARCHERRORTEXT), rc, wildcard);
|
---|
[2] | 687 | Notify(s);
|
---|
| 688 | }
|
---|
| 689 |
|
---|
| 690 | None:
|
---|
| 691 |
|
---|
| 692 | DosError(FERR_DISABLEHARDERR);
|
---|
[1471] | 693 | return ok;
|
---|
[1856] | 694 | } // Stubby
|
---|
| 695 |
|
---|
| 696 | // Stubby/Flesh/Unflesh work list item
|
---|
| 697 |
|
---|
| 698 | typedef struct {
|
---|
| 699 | LIST2 list;
|
---|
| 700 | HWND hwndCnr;
|
---|
| 701 | PCNRITEM pci;
|
---|
| 702 | FLESHWORKACTION action;
|
---|
| 703 | } FLESHWORKITEM;
|
---|
| 704 | typedef FLESHWORKITEM *PFLESHWORKITEM;
|
---|
| 705 |
|
---|
| 706 | // Stubby/Flesh/Unflesh work list
|
---|
| 707 | LIST2 FleshWorkList;
|
---|
| 708 |
|
---|
| 709 | HMTX hmtxFleshWork;
|
---|
| 710 | HEV hevFleshWorkListChanged;
|
---|
| 711 |
|
---|
| 712 | /**
|
---|
[1858] | 713 | * Check work list item pci matches passed pci
|
---|
[1856] | 714 | */
|
---|
| 715 |
|
---|
| 716 | BOOL WorkListItemMatches(PLIST2 item, PVOID data)
|
---|
| 717 | {
|
---|
| 718 | return ((PFLESHWORKITEM)data)->pci == ((PFLESHWORKITEM)item)->pci;
|
---|
[2] | 719 | }
|
---|
[793] | 720 |
|
---|
[1856] | 721 | /**
|
---|
| 722 | * Delete stale items from flesh queue
|
---|
| 723 | */
|
---|
| 724 |
|
---|
| 725 | VOID DeleteStaleFleshWorkListItems(PCNRITEM pci)
|
---|
| 726 | {
|
---|
| 727 | FLESHWORKITEM match;
|
---|
| 728 | PLIST2 item;
|
---|
| 729 |
|
---|
| 730 | match.pci = pci;
|
---|
| 731 |
|
---|
| 732 | for (;;) {
|
---|
| 733 | item = List2Search(&FleshWorkList, WorkListItemMatches, &match);
|
---|
| 734 | if (!item)
|
---|
| 735 | break;
|
---|
[1871] | 736 | //DbgMsg(pszSrcFile, __LINE__, "DeleteStaleFleshWorkListItems deleting %p %s", pci, pci->pszFileName ? pci->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug
|
---|
[1856] | 737 | List2Delete(&FleshWorkList, item);
|
---|
| 738 | xfree(item, pszSrcFile, __LINE__);
|
---|
| 739 | }
|
---|
| 740 | }
|
---|
| 741 |
|
---|
| 742 | /**
|
---|
| 743 | * Add item to flesh work list
|
---|
| 744 | * eUnFlesh requests get special handling
|
---|
| 745 | * eFlesh etc. items for the same CNRITEM are considered stale and are
|
---|
| 746 | * deleted because eUnFlesh will free the CNRITEM associated with the item
|
---|
| 747 | * before the work list item is processed
|
---|
| 748 | */
|
---|
| 749 |
|
---|
[1865] | 750 | #ifndef AddFleshWorkRequest // 2015-08-03 SHL FIXME debug
|
---|
[1856] | 751 | BOOL AddFleshWorkRequest(HWND hwndCnr, PCNRITEM pci, FLESHWORKACTION action)
|
---|
| 752 | #else
|
---|
| 753 | BOOL AddFleshWorkRequestDbg(HWND hwndCnr, PCNRITEM pci, FLESHWORKACTION action, PCSZ pszSrcFile_, UINT uSrcLineNo)
|
---|
| 754 | #endif
|
---|
| 755 | {
|
---|
| 756 | PFLESHWORKITEM item = xmallocz(sizeof(FLESHWORKITEM), pszSrcFile, __LINE__);
|
---|
| 757 | item->hwndCnr = hwndCnr;
|
---|
| 758 | item->pci = pci;
|
---|
| 759 | item->action= action;
|
---|
| 760 |
|
---|
[1858] | 761 | if (fAmQuitting)
|
---|
| 762 | return FALSE;
|
---|
[1856] | 763 |
|
---|
| 764 | // 2015-08-03 SHL FIXME debug
|
---|
[1858] | 765 | #if 0 // 2015-08-13 SHL FIXME to be gone
|
---|
[1856] | 766 | {
|
---|
| 767 | static PSZ itemNames[] = {
|
---|
| 768 | "eStubby", "eFlesh", "eFleshEnv", "eUnFlesh"
|
---|
| 769 | };
|
---|
| 770 |
|
---|
| 771 | # ifdef AddFleshWorkRequest
|
---|
| 772 | if (!pci || (INT)pci == -1) {
|
---|
| 773 | Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p by %s:%u",
|
---|
| 774 | itemNames[item->action],
|
---|
| 775 | pci,
|
---|
[1858] | 776 | pszSrcFile_, uSrcLineNo);
|
---|
[1856] | 777 | }
|
---|
| 778 | else if (!pci->pszFileName) {
|
---|
| 779 | Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest call with action %s pci %p pszFileName (null) by %s:%u",
|
---|
| 780 | itemNames[item->action],
|
---|
| 781 | pci,
|
---|
[1858] | 782 | pszSrcFile_, uSrcLineNo);
|
---|
[1856] | 783 | }
|
---|
| 784 | else if (!fNoFleshDbgMsg) {
|
---|
| 785 | DbgMsg(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p pszFileName %s by %s:%u",
|
---|
| 786 | itemNames[item->action],
|
---|
| 787 | pci,
|
---|
| 788 | pci->pszFileName,
|
---|
| 789 | pszSrcFile_, uSrcLineNo); // 2015-08-03 SHL FIXME debug
|
---|
| 790 | }
|
---|
| 791 | #else
|
---|
| 792 | if (!pci || (INT)pci == -1) {
|
---|
| 793 | Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest call with action %s pci %p",
|
---|
| 794 | itemNames[item->action],
|
---|
[1858] | 795 | pci);
|
---|
[1856] | 796 | }
|
---|
| 797 | else if (!pci->pszFileName) {
|
---|
| 798 | Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p pszFileName (null)",
|
---|
| 799 | itemNames[item->action],
|
---|
[1858] | 800 | pci);
|
---|
[1856] | 801 | }
|
---|
| 802 | else if (!fNoFleshDbgMsg) {
|
---|
| 803 | DbgMsg(pszSrcFile, __LINE__, "AddFleshWorkRequest action %s pci %p pszFileName %s",
|
---|
| 804 | itemNames[item->action],
|
---|
| 805 | pci,
|
---|
| 806 | pci->pszFileName); // 2015-08-03 SHL FIXME debug
|
---|
| 807 | }
|
---|
| 808 | #endif
|
---|
[1858] | 809 | }
|
---|
[1856] | 810 | #endif
|
---|
| 811 |
|
---|
[1860] | 812 | xDosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT);
|
---|
[1856] | 813 |
|
---|
| 814 | // Delete stale requests
|
---|
[1858] | 815 | if (item->action == eUnFlesh)
|
---|
[1856] | 816 | DeleteStaleFleshWorkListItems(pci);
|
---|
| 817 |
|
---|
| 818 | List2Append(&FleshWorkList, (PLIST2)item);
|
---|
| 819 |
|
---|
[1860] | 820 | xDosReleaseMutexSem(hmtxFleshWork);
|
---|
| 821 | xDosPostEventSem(hevFleshWorkListChanged);
|
---|
[1856] | 822 |
|
---|
| 823 | return TRUE;
|
---|
| 824 | }
|
---|
| 825 |
|
---|
| 826 | /**
|
---|
| 827 | * Return TRUE if work list empty
|
---|
| 828 | * Advisory only
|
---|
| 829 | */
|
---|
| 830 |
|
---|
| 831 | BOOL IsFleshWorkListEmpty()
|
---|
| 832 | {
|
---|
| 833 | return FleshWorkList.next == NULL;
|
---|
| 834 | }
|
---|
| 835 |
|
---|
| 836 | /**
|
---|
[1858] | 837 | * Check if pci pathname is parent of child path name
|
---|
| 838 | * @param data is child path name
|
---|
[1860] | 839 | * @return TRUE if is work item path is parent of given path
|
---|
[1858] | 840 | */
|
---|
| 841 |
|
---|
| 842 | BOOL IsParentOfChildPath(PLIST2 item, PVOID data)
|
---|
| 843 | {
|
---|
| 844 | UINT c;
|
---|
| 845 | if (!((PFLESHWORKITEM)item)->pci->pszFileName) {
|
---|
[1861] | 846 | Runtime_Error(pszSrcFile, __LINE__, "IsParentOfChildPath called with pci %p pszFileName (null)", ((PFLESHWORKITEM)item)->pci);
|
---|
[1858] | 847 | return FALSE;
|
---|
| 848 | }
|
---|
| 849 | c = strlen(((PFLESHWORKITEM)item)->pci->pszFileName);
|
---|
[1865] | 850 | // 2015-08-23 SHL FIXME to not trap for Gregg
|
---|
| 851 | return strncmp(((PFLESHWORKITEM)item)->pci->pszFileName, (PCSZ)data, c) == 0;
|
---|
[1858] | 852 | }
|
---|
| 853 |
|
---|
| 854 | /**
|
---|
| 855 | * Wait until work list empty or until dependent items removed from list
|
---|
[1856] | 856 | * Advisory only
|
---|
[1858] | 857 | * @parse pszFileName is dependent pathName
|
---|
[1856] | 858 | */
|
---|
| 859 |
|
---|
[1865] | 860 | #ifndef WaitFleshWorkListEmpty // 2015-08-03 SHL FIXME debug
|
---|
[1874] | 861 | VOID WaitFleshWorkListEmpty(PCSZ pszDirName, ULONG ulSleep)
|
---|
[1856] | 862 | #else
|
---|
[1874] | 863 | VOID WaitFleshWorkListEmptyDbg(PCSZ pszDirName, ULONG ulSleep, PCSZ pszSrcFile_, UINT uSrcLineNo_)
|
---|
[1856] | 864 | #endif
|
---|
| 865 | {
|
---|
[1858] | 866 | APIRET rc;
|
---|
| 867 | PFLESHWORKITEM item;
|
---|
[1856] | 868 | INT tid = GetTidForThread();
|
---|
[1860] | 869 | BOOL pathSaved = FALSE;
|
---|
[1867] | 870 | BOOL waited;
|
---|
[1860] | 871 | PCSZ pszSavedFleshFocusPath;
|
---|
[1873] | 872 | INT rcCount = 0;
|
---|
[1856] | 873 |
|
---|
| 874 | if (tid == 1 || tid == tidFleshWorkListThread) {
|
---|
| 875 | # ifdef WaitFleshWorkListEmpty
|
---|
| 876 | Runtime_Error(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with worklist %sempty by tid %u at %s:%u", IsFleshWorkListEmpty() ? "" : "not ", tid, pszSrcFile_, uSrcLineNo_);
|
---|
| 877 | # else
|
---|
| 878 | Runtime_Error(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called by tid %u", tid);
|
---|
| 879 | # endif
|
---|
| 880 | return; // Avoid hang
|
---|
| 881 | }
|
---|
[1871] | 882 | #if 0
|
---|
[1856] | 883 | else if (IsFleshWorkListEmpty()) {
|
---|
| 884 | # ifdef WaitFleshWorkListEmpty
|
---|
[1858] | 885 | DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with worklist empty at %s:%u", pszSrcFile_, uSrcLineNo_);
|
---|
[1856] | 886 | # else
|
---|
[1858] | 887 | DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list empty");
|
---|
[1856] | 888 | # endif
|
---|
| 889 | }
|
---|
[1871] | 890 | #endif
|
---|
[1856] | 891 |
|
---|
| 892 | // Can not wait if call from thread 1 or FleshWorkListThread
|
---|
[1867] | 893 | for (waited = FALSE; !IsFleshWorkListEmpty(); waited = TRUE) {
|
---|
[1858] | 894 |
|
---|
| 895 | #if 0 // 2015-08-19 SHL FIXME debug
|
---|
[1856] | 896 | # ifdef WaitFleshWorkListEmpty
|
---|
| 897 | if (!fNoFleshDbgMsg)
|
---|
[1858] | 898 | DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty by %s:%u", pszSrcFile_, uSrcLineNo_); // 2015-08-07 SHL FIXME debug
|
---|
[1856] | 899 | # else
|
---|
| 900 | if (!fNoFleshDbgMsg)
|
---|
[1858] | 901 | DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty"); // 2015-08-07 SHL FIXME debug
|
---|
[1856] | 902 | # endif
|
---|
[1858] | 903 | #endif // 2015-08-19 SHL FIXME debug
|
---|
| 904 |
|
---|
| 905 | // 2015-08-13 SHL
|
---|
| 906 | if (fAmQuitting)
|
---|
| 907 | return;
|
---|
| 908 |
|
---|
[1860] | 909 | // Just wait for dependents to be gone if path name given
|
---|
| 910 | if (pszDirName) {
|
---|
| 911 | rc = xDosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT);
|
---|
[1873] | 912 | if (rc) {
|
---|
| 913 | rcCount++;
|
---|
| 914 | if (rcCount < 6)
|
---|
| 915 | continue; // Maybe should return ???
|
---|
| 916 | else {
|
---|
| 917 | Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
|
---|
| 918 | PCSZ_DOSREQUESTMUTEXSEM);
|
---|
| 919 | return;
|
---|
| 920 | }
|
---|
[1860] | 921 |
|
---|
[1873] | 922 | }
|
---|
| 923 |
|
---|
[1860] | 924 | if (!pathSaved) {
|
---|
| 925 | // Give priority to work items for parents of this path
|
---|
| 926 | pathSaved = TRUE;
|
---|
| 927 | pszSavedFleshFocusPath = pszFleshFocusPath;
|
---|
| 928 | pszFleshFocusPath = pszDirName;
|
---|
[1858] | 929 | }
|
---|
| 930 |
|
---|
[1860] | 931 | item = (PFLESHWORKITEM)List2Search(&FleshWorkList, IsParentOfChildPath, (PVOID)pszDirName);
|
---|
[1858] | 932 |
|
---|
[1860] | 933 | xDosReleaseMutexSem(hmtxFleshWork);
|
---|
[1873] | 934 | rcCount = 0;
|
---|
[1858] | 935 |
|
---|
[1867] | 936 | if (!item) {
|
---|
| 937 | if (waited)
|
---|
[1874] | 938 | DosSleep(ulSleep); // Let PM do some work
|
---|
[1858] | 939 | break; // Dependents gone from work list
|
---|
[1867] | 940 | }
|
---|
[1860] | 941 | } // if pszDirName
|
---|
[1874] | 942 | DosSleep(ulSleep);
|
---|
[1867] | 943 | } // for
|
---|
[1858] | 944 |
|
---|
[1865] | 945 | if (pathSaved) {
|
---|
[1860] | 946 | xDosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT);
|
---|
| 947 | pszFleshFocusPath = pszSavedFleshFocusPath;
|
---|
| 948 | xDosReleaseMutexSem(hmtxFleshWork);
|
---|
| 949 | }
|
---|
[1858] | 950 |
|
---|
[1856] | 951 | }
|
---|
| 952 |
|
---|
| 953 | /**
|
---|
| 954 | * Set focus drive to optimize work list processing
|
---|
| 955 | * @param chDriveLetter is upper case drive letter (A-Z)
|
---|
| 956 | */
|
---|
| 957 |
|
---|
[1860] | 958 | VOID SetFleshFocusPath(PCSZ pszPath) {
|
---|
| 959 | PCSZ pszOld;
|
---|
| 960 | PCSZ pszNew = strdup(pszPath);
|
---|
| 961 | xDosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT);
|
---|
| 962 | pszOld = pszFleshFocusPath;
|
---|
| 963 | pszFleshFocusPath = pszNew;
|
---|
| 964 | xDosReleaseMutexSem(hmtxFleshWork);
|
---|
| 965 | if (pszOld)
|
---|
| 966 | xfree((PVOID)pszOld, pszSrcFile, __LINE__);
|
---|
[1871] | 967 | //DbgMsg(pszSrcFile, __LINE__, "SetFleshFocusPath focus path set to %s", pszFleshFocusPath); // 2015-08-03 SHL FIXME debug
|
---|
[1856] | 968 |
|
---|
| 969 | }
|
---|
| 970 |
|
---|
| 971 | /**
|
---|
| 972 | * Run Flesh, UnFlesh, FleshEnv, Stubby for directory for items in work list
|
---|
| 973 | */
|
---|
| 974 |
|
---|
| 975 | VOID FleshWorkThread(PVOID arg)
|
---|
| 976 | {
|
---|
| 977 | HAB thab;
|
---|
| 978 | HMQ hmq = (HMQ)0;
|
---|
| 979 |
|
---|
| 980 | // 2015-08-07 SHL FIXME to be gone
|
---|
| 981 | static INT ProcessDirCount = 0;
|
---|
| 982 |
|
---|
| 983 | DosError(FERR_DISABLEHARDERR);
|
---|
| 984 |
|
---|
| 985 | # ifdef FORTIFY
|
---|
| 986 | Fortify_EnterScope();
|
---|
| 987 | # endif
|
---|
| 988 |
|
---|
| 989 | thab = WinInitialize(0);
|
---|
| 990 | if (thab) {
|
---|
| 991 | hmq = WinCreateMsgQueue(thab, 0);
|
---|
| 992 | if (hmq) {
|
---|
| 993 | IncrThreadUsage();
|
---|
| 994 | priority_normal();
|
---|
| 995 |
|
---|
[1858] | 996 | // process list entries until time to die
|
---|
| 997 | for (;!fAmQuitting;) {
|
---|
[1856] | 998 |
|
---|
| 999 | PFLESHWORKITEM item;
|
---|
| 1000 |
|
---|
| 1001 | // 2015-08-07 SHL FIXME to use SMPSafe...
|
---|
[1860] | 1002 | xDosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT);
|
---|
[1856] | 1003 |
|
---|
| 1004 | // 2015-08-14 SHL
|
---|
| 1005 | // Get next work list item and remove from list
|
---|
[1860] | 1006 | // If focus path set, process parents of focus path first
|
---|
| 1007 | if (pszFleshFocusPath) {
|
---|
| 1008 | item = (PFLESHWORKITEM)List2Search(&FleshWorkList, IsParentOfChildPath, (PVOID)pszFleshFocusPath);
|
---|
| 1009 | if (!item) {
|
---|
| 1010 | xfree((PSZ)pszFleshFocusPath, pszSrcFile, __LINE__);
|
---|
| 1011 | pszFleshFocusPath = NULL; // Revert to normal
|
---|
| 1012 | }
|
---|
[1856] | 1013 | else
|
---|
| 1014 | List2Delete(&FleshWorkList, (PLIST2)item);
|
---|
| 1015 | }
|
---|
| 1016 | else
|
---|
| 1017 | item = NULL;
|
---|
| 1018 |
|
---|
| 1019 | if (!item)
|
---|
| 1020 | item = (PFLESHWORKITEM)List2DeleteFirst(&FleshWorkList);
|
---|
| 1021 |
|
---|
[1860] | 1022 | xDosReleaseMutexSem(hmtxFleshWork);
|
---|
[1856] | 1023 |
|
---|
[1858] | 1024 | // Wait for new items to be added to list
|
---|
[1856] | 1025 | if (!item) {
|
---|
[1871] | 1026 | ULONG ul;
|
---|
| 1027 | #if 0
|
---|
[1856] | 1028 | if (!fNoFleshDbgMsg)
|
---|
| 1029 | DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread work list empty - waiting"); // 2015-08-03 SHL FIXME debug
|
---|
[1871] | 1030 | #endif
|
---|
| 1031 | xDosWaitEventSem(hevFleshWorkListChanged, SEM_INDEFINITE_WAIT);
|
---|
| 1032 | xDosResetEventSem(hevFleshWorkListChanged, &ul);
|
---|
| 1033 | #if 0
|
---|
[1856] | 1034 | if (!fNoFleshDbgMsg)
|
---|
| 1035 | DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread work hev posted"); // 2015-08-03 SHL FIXME debug
|
---|
[1871] | 1036 | #endif
|
---|
| 1037 | continue;
|
---|
[1856] | 1038 | }
|
---|
| 1039 |
|
---|
[1871] | 1040 | if (WinIsWindow((HAB)0, item->hwndCnr)) {
|
---|
| 1041 | #if 0 // 2015-08-07 SHL FIXME debug
|
---|
[1856] | 1042 | {
|
---|
| 1043 | static PSZ itemNames[] = {
|
---|
| 1044 | "eStubby", "eFlesh", "eFleshEnv", "eUnFlesh"
|
---|
| 1045 | };
|
---|
| 1046 |
|
---|
| 1047 | PCNRITEM pci = item->pci;
|
---|
| 1048 | if (!fNoFleshDbgMsg) {
|
---|
| 1049 | DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread action %s pci %p pszFileName %s",
|
---|
| 1050 | itemNames[item->action],
|
---|
| 1051 | pci,
|
---|
| 1052 | pci && (INT)pci != -1 ?
|
---|
| 1053 | (pci->pszFileName ? pci->pszFileName : "(nullname)") :
|
---|
| 1054 | "(nullpci)"); // 2015-08-03 SHL FIXME debug
|
---|
| 1055 | }
|
---|
| 1056 | }
|
---|
| 1057 | #endif
|
---|
| 1058 |
|
---|
| 1059 | switch (item->action) {
|
---|
[1871] | 1060 | case eUnFlesh:
|
---|
| 1061 | UnFlesh(item->hwndCnr, item->pci);
|
---|
[1856] | 1062 | break;
|
---|
| 1063 | case eFleshEnv:
|
---|
| 1064 | FleshEnv(item->hwndCnr, item->pci);
|
---|
| 1065 | break;
|
---|
| 1066 | case eStubby:
|
---|
| 1067 | // DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread pci %p pszFileName %s", stubbyArgs->pci, stubbyArgs->pci->pszFileName); // 2015-08-03 SHL FIXME debug
|
---|
[1871] | 1068 | priority_bumped();
|
---|
| 1069 | Stubby(item->hwndCnr, item->pci);
|
---|
| 1070 | priority_normal();
|
---|
[1865] | 1071 | break;
|
---|
[1856] | 1072 | case eFlesh:
|
---|
| 1073 | if (Flesh(item->hwndCnr, item->pci)) {
|
---|
| 1074 | // 2015-08-06 SHL FIXME to report?
|
---|
| 1075 | }
|
---|
| 1076 | break;
|
---|
| 1077 | default:
|
---|
| 1078 | Runtime_Error(pszSrcFile, __LINE__, "item %u unexpected", item->action);
|
---|
| 1079 | } // switch
|
---|
| 1080 |
|
---|
| 1081 |
|
---|
| 1082 | } // if window
|
---|
| 1083 |
|
---|
| 1084 | xfree(item, pszSrcFile, __LINE__);
|
---|
| 1085 |
|
---|
| 1086 | } // for
|
---|
| 1087 |
|
---|
| 1088 | WinDestroyMsgQueue(hmq);
|
---|
| 1089 | }
|
---|
| 1090 | DecrThreadUsage();
|
---|
| 1091 | WinTerminate(thab);
|
---|
| 1092 | }
|
---|
| 1093 |
|
---|
| 1094 | ProcessDirCount++;
|
---|
| 1095 | // DbgMsg(pszSrcFile, __LINE__, "ProcessDirCount %i FixedVolume %i", ProcessDirCount, FixedVolume);
|
---|
| 1096 | if (ProcessDirCount >= FixedVolume) {
|
---|
| 1097 | ProcessDirCount = 0;
|
---|
| 1098 | FixedVolume = 0;
|
---|
| 1099 | }
|
---|
| 1100 |
|
---|
| 1101 | # ifdef FORTIFY
|
---|
| 1102 | Fortify_LeaveScope();
|
---|
| 1103 | # endif
|
---|
| 1104 |
|
---|
| 1105 | }
|
---|
| 1106 |
|
---|
| 1107 | /**
|
---|
| 1108 | * Allocate resources and start FleshWorkThread
|
---|
| 1109 | * @return TRUE if OK
|
---|
| 1110 | */
|
---|
| 1111 |
|
---|
| 1112 | BOOL StartFleshWorkThread()
|
---|
| 1113 | {
|
---|
| 1114 | APIRET rc = DosCreateMutexSem(NULL, &hmtxFleshWork, 0L /* Not shared */, FALSE /* Not owned */);
|
---|
| 1115 | if (rc) {
|
---|
| 1116 | Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
|
---|
| 1117 | PCSZ_DOSCREATEMUTEXSEM);
|
---|
| 1118 | return FALSE;
|
---|
| 1119 | }
|
---|
| 1120 |
|
---|
[1860] | 1121 | rc = xDosCreateEventSem(NULL, &hevFleshWorkListChanged, 0 /* Not shared */, FALSE /* Reset */);
|
---|
| 1122 | if (rc)
|
---|
| 1123 | return FALSE; // Give up
|
---|
[1871] | 1124 | #if 0
|
---|
| 1125 | /*DbgMsg is time consuming
|
---|
[1856] | 1126 | define FM2_NO_FLESH_DBGMSG to suppress
|
---|
| 1127 | 2015-08-09 SHL FIXME to be gone
|
---|
[1871] | 1128 | */
|
---|
[1856] | 1129 |
|
---|
| 1130 | fNoFleshDbgMsg = getenv("FM2_NO_FLESH_DBGMSG") != NULL;
|
---|
[1871] | 1131 | #endif
|
---|
[1856] | 1132 | tidFleshWorkListThread = xbeginthread(FleshWorkThread,
|
---|
| 1133 | 65536,
|
---|
| 1134 | NULL,
|
---|
| 1135 | pszSrcFile, __LINE__);
|
---|
| 1136 | return tidFleshWorkListThread != -1;
|
---|
| 1137 |
|
---|
| 1138 | }
|
---|
| 1139 |
|
---|
| 1140 | #pragma alloc_text(FLESH,Flesh,FleshEnv,UnFlesh,Stubby,FleshWorkThread,StartFleshWorkThread,AddFleshWorkRequest)
|
---|