| [36] | 1 |  | 
|---|
|  | 2 | /*********************************************************************** | 
|---|
|  | 3 |  | 
|---|
|  | 4 | $Id: info.c 689 2007-06-15 06:33:24Z stevenhl $ | 
|---|
|  | 5 |  | 
|---|
| [576] | 6 | Info windows | 
|---|
| [36] | 7 |  | 
|---|
|  | 8 | Copyright (c) 1993-98 M. Kimes | 
|---|
| [336] | 9 | Copyright (c) 2001, 2006 Steven H. Levine | 
|---|
| [36] | 10 |  | 
|---|
| [131] | 11 | 16 Oct 02 SHL Handle large partitions | 
|---|
|  | 12 | 12 Feb 03 SHL FileInfoProc: standardize EA math | 
|---|
|  | 13 | 01 Aug 04 SHL Rework lstrip/rstrip usage | 
|---|
| [130] | 14 | 23 May 05 SHL Use QWL_USER | 
|---|
| [162] | 15 | 25 May 05 SHL Use ULONGLONG and CommaFmtULL | 
|---|
| [186] | 16 | 05 Jun 05 SHL Use QWL_USER | 
|---|
| [336] | 17 | 14 Jul 06 SHL Use Runtime_Error | 
|---|
| [575] | 18 | 24 Mar 07 SHL Correct FileInfoProc binary file detect | 
|---|
|  | 19 | 24 Mar 07 SHL Correct FileInfoProc/IconProc race crash | 
|---|
| [618] | 20 | 19 Apr 07 SHL Sync with AcceptOneDrop GetOneDrop mods | 
|---|
| [36] | 21 |  | 
|---|
|  | 22 | ***********************************************************************/ | 
|---|
|  | 23 |  | 
|---|
| [2] | 24 | #define INCL_DOS | 
|---|
|  | 25 | #define INCL_WIN | 
|---|
|  | 26 | #define INCL_GPI | 
|---|
| [162] | 27 | #define INCL_LONGLONG | 
|---|
|  | 28 | #include <os2.h> | 
|---|
| [2] | 29 |  | 
|---|
|  | 30 | #include <stdio.h> | 
|---|
|  | 31 | #include <stdlib.h> | 
|---|
|  | 32 | #include <string.h> | 
|---|
|  | 33 | #include <ctype.h> | 
|---|
|  | 34 | #include <share.h> | 
|---|
| [162] | 35 |  | 
|---|
| [2] | 36 | #include "fm3dll.h" | 
|---|
|  | 37 | #include "fm3dlg.h" | 
|---|
|  | 38 | #include "fm3str.h" | 
|---|
|  | 39 |  | 
|---|
|  | 40 | #pragma data_seg(DATA1) | 
|---|
| [336] | 41 |  | 
|---|
|  | 42 | static PSZ pszSrcFile = __FILE__; | 
|---|
|  | 43 |  | 
|---|
| [2] | 44 | #pragma alloc_text(FMINFO,FileInfoProc,IconProc) | 
|---|
|  | 45 | #pragma alloc_text(FMINFO2,SetDrvProc,DrvInfoProc) | 
|---|
|  | 46 |  | 
|---|
| [551] | 47 | CHAR *FlagMsg(CHAR drive, CHAR * buffer) | 
|---|
| [336] | 48 | { | 
|---|
| [551] | 49 | ULONG x; | 
|---|
|  | 50 | BOOL once = FALSE; | 
|---|
|  | 51 | register CHAR *p; | 
|---|
| [2] | 52 |  | 
|---|
| [551] | 53 | if (buffer) { | 
|---|
| [2] | 54 | *buffer = 0; | 
|---|
|  | 55 | p = buffer; | 
|---|
| [551] | 56 | if (isalpha(drive)) { | 
|---|
|  | 57 | if (driveflags[toupper(drive) - 'A']) { | 
|---|
| [552] | 58 | for (x = IDS_FLREMOVABLETEXT; x < IDS_FLRAMDISKTEXT + 1; x++) { | 
|---|
| [551] | 59 | if (driveflags[toupper(drive) - 'A'] & | 
|---|
|  | 60 | (1 << (x - IDS_FLREMOVABLETEXT))) { | 
|---|
|  | 61 | if (once) { | 
|---|
|  | 62 | *p = ' '; | 
|---|
|  | 63 | p++; | 
|---|
|  | 64 | } | 
|---|
|  | 65 | else | 
|---|
|  | 66 | once = TRUE; | 
|---|
|  | 67 | *p = '['; | 
|---|
|  | 68 | p++; | 
|---|
|  | 69 | strcpy(p, GetPString(x)); | 
|---|
|  | 70 | p += strlen(p); | 
|---|
|  | 71 | *p = ']'; | 
|---|
|  | 72 | p++; | 
|---|
|  | 73 | *p = 0; | 
|---|
|  | 74 | } | 
|---|
|  | 75 | } | 
|---|
| [2] | 76 | } | 
|---|
|  | 77 | else | 
|---|
| [551] | 78 | strcpy(buffer, "[None]"); | 
|---|
| [2] | 79 | } | 
|---|
|  | 80 | } | 
|---|
|  | 81 | return buffer; | 
|---|
|  | 82 | } | 
|---|
|  | 83 |  | 
|---|
| [551] | 84 | MRESULT EXPENTRY DrvInfoProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) | 
|---|
| [162] | 85 | { | 
|---|
|  | 86 | CHAR *pszFileName; | 
|---|
| [551] | 87 | CHAR szMB[20]; | 
|---|
|  | 88 | CHAR szKB[20]; | 
|---|
|  | 89 | CHAR szUnits[20]; | 
|---|
| [336] | 90 | APIRET rc; | 
|---|
| [2] | 91 |  | 
|---|
| [551] | 92 | switch (msg) { | 
|---|
|  | 93 | case WM_INITDLG: | 
|---|
|  | 94 | if (mp2) { | 
|---|
| [2] | 95 |  | 
|---|
| [551] | 96 | CHAR s[CCHMAXPATH * 2]; | 
|---|
|  | 97 | ULONG type; | 
|---|
| [2] | 98 |  | 
|---|
| [551] | 99 | pszFileName = (CHAR *) mp2; | 
|---|
|  | 100 | WinSetWindowPtr(hwnd, QWL_USER, (PVOID) pszFileName); | 
|---|
|  | 101 | WinSendDlgItemMsg(hwnd, | 
|---|
|  | 102 | INFO_LABEL, | 
|---|
|  | 103 | EM_SETTEXTLIMIT, | 
|---|
|  | 104 | MPFROM2SHORT(CCHMAXPATHCOMP, 0), MPVOID); | 
|---|
| [552] | 105 | if (!(driveflags[toupper(*pszFileName) - 'A'] & DRIVE_NOSTATS)){ | 
|---|
| [551] | 106 | WinSendDlgItemMsg(hwnd, | 
|---|
|  | 107 | INFO_FREE, | 
|---|
|  | 108 | SLM_SETSLIDERINFO, | 
|---|
|  | 109 | MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS, 0), | 
|---|
|  | 110 | MPFROM2SHORT(0, 0)); | 
|---|
|  | 111 | WinSendDlgItemMsg(hwnd, | 
|---|
|  | 112 | INFO_USED, | 
|---|
|  | 113 | SLM_SETSLIDERINFO, | 
|---|
|  | 114 | MPFROM2SHORT(SMA_SLIDERARMDIMENSIONS, 0), | 
|---|
|  | 115 | MPFROM2SHORT(0, 0)); | 
|---|
| [552] | 116 | } | 
|---|
| [551] | 117 | if (driveflags[toupper(*pszFileName) - 'A'] & DRIVE_NOTWRITEABLE) { | 
|---|
|  | 118 | WinSendDlgItemMsg(hwnd, | 
|---|
|  | 119 | INFO_LABEL, | 
|---|
|  | 120 | EM_SETREADONLY, MPFROM2SHORT(TRUE, 0), MPVOID); | 
|---|
|  | 121 | WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, DID_OK)); | 
|---|
|  | 122 | } | 
|---|
|  | 123 | if (IsFullName(pszFileName)) { | 
|---|
| [2] | 124 |  | 
|---|
| [551] | 125 | CHAR FileSystem[CCHMAXPATH * 2]; | 
|---|
| [2] | 126 |  | 
|---|
| [551] | 127 | sprintf(FileSystem, | 
|---|
|  | 128 | GetPString(IDS_DRIVEINFOTITLETEXT), toupper(*pszFileName)); | 
|---|
|  | 129 | WinSetWindowText(hwnd, FileSystem); | 
|---|
| [575] | 130 | if (CheckDrive(toupper(*pszFileName), FileSystem, &type) != -1){ | 
|---|
| [2] | 131 |  | 
|---|
| [551] | 132 | FSALLOCATE fsa; | 
|---|
| [2] | 133 |  | 
|---|
| [552] | 134 | if (type & (DRIVE_REMOTE | DRIVE_ZIPSTREAM | DRIVE_VIRTUAL)) { | 
|---|
| [2] | 135 |  | 
|---|
| [551] | 136 | CHAR Path[3], *pfsn, *pfsd; | 
|---|
|  | 137 | ULONG Size; | 
|---|
|  | 138 | APIRET rc; | 
|---|
|  | 139 | PFSQBUFFER2 pfsq; | 
|---|
| [2] | 140 |  | 
|---|
| [551] | 141 | Path[0] = toupper(*pszFileName); | 
|---|
|  | 142 | Path[1] = ':'; | 
|---|
|  | 143 | Path[2] = 0; | 
|---|
|  | 144 | Size = sizeof(s); | 
|---|
|  | 145 | DosError(FERR_DISABLEHARDERR); | 
|---|
|  | 146 | rc = DosQueryFSAttach(Path, | 
|---|
|  | 147 | 0, FSAIL_QUERYNAME, (PFSQBUFFER2) s, &Size); | 
|---|
|  | 148 | if (!rc) { | 
|---|
|  | 149 | pfsq = (PFSQBUFFER2) s; | 
|---|
| [689] | 150 | pfsn = (PCHAR)(pfsq->szName) + pfsq->cbName + 1; | 
|---|
| [551] | 151 | pfsd = pfsn + pfsq->cbFSDName + 1; | 
|---|
|  | 152 | if (pfsq->cbFSAData && pfsd && *pfsd) { | 
|---|
|  | 153 | sprintf(s, " (%s)", pfsd); | 
|---|
|  | 154 | WinSetDlgItemText(hwnd, INFO_REALPATH, s); | 
|---|
|  | 155 | } | 
|---|
|  | 156 | } | 
|---|
|  | 157 | } | 
|---|
| [2] | 158 |  | 
|---|
| [551] | 159 | DosError(FERR_DISABLEHARDERR); | 
|---|
|  | 160 | if (!DosQueryFSInfo(toupper(*pszFileName) - '@', | 
|---|
|  | 161 | FSIL_ALLOC, &fsa, sizeof(FSALLOCATE))) { | 
|---|
| [2] | 162 |  | 
|---|
| [551] | 163 | struct | 
|---|
|  | 164 | { | 
|---|
|  | 165 | ULONG serial; | 
|---|
|  | 166 | CHAR volumelength; | 
|---|
|  | 167 | CHAR volumelabel[CCHMAXPATH]; | 
|---|
|  | 168 | } | 
|---|
|  | 169 | volser; | 
|---|
|  | 170 | USHORT percentfree, percentused; | 
|---|
| [2] | 171 |  | 
|---|
| [551] | 172 | memset(&volser, 0, sizeof(volser)); | 
|---|
|  | 173 | DosError(FERR_DISABLEHARDERR); | 
|---|
|  | 174 | if (!DosQueryFSInfo(toupper(*pszFileName) - '@', | 
|---|
|  | 175 | FSIL_VOLSER, | 
|---|
|  | 176 | &volser, (ULONG) sizeof(volser))) { | 
|---|
|  | 177 | WinSetDlgItemText(hwnd, INFO_FS, FileSystem); | 
|---|
|  | 178 | WinSetDlgItemText(hwnd, INFO_LABEL, volser.volumelabel); | 
|---|
|  | 179 | sprintf(s, "%lx", volser.serial); | 
|---|
| [575] | 180 | WinSetDlgItemText(hwnd, INFO_SERIAL, s); | 
|---|
|  | 181 | FlagMsg(*pszFileName, s); | 
|---|
| [552] | 182 | WinSetDlgItemText(hwnd, INFO_FLAGS, s); | 
|---|
| [575] | 183 | if (!(driveflags[toupper(*pszFileName) - 'A'] & DRIVE_NOSTATS)){ | 
|---|
| [551] | 184 | CommaFmtULL(szMB, sizeof(szMB), | 
|---|
|  | 185 | (ULONGLONG) fsa.cUnit * | 
|---|
|  | 186 | (fsa.cSectorUnit * fsa.cbSector), 'M'); | 
|---|
|  | 187 | CommaFmtULL(szKB, sizeof(szKB), | 
|---|
|  | 188 | (ULONGLONG) fsa.cUnit * | 
|---|
|  | 189 | (fsa.cSectorUnit * fsa.cbSector), 'K'); | 
|---|
|  | 190 | CommaFmtULL(szUnits, sizeof(szUnits), | 
|---|
|  | 191 | (ULONGLONG) fsa.cUnit, ' '); | 
|---|
|  | 192 | sprintf(s, "%s, %s, %s %s%s", szMB, szKB, szUnits, GetPString(IDS_UNITTEXT), &"s"[fsa.cUnit == 1L]);      // hack cough | 
|---|
|  | 193 | WinSetDlgItemText(hwnd, INFO_TOTAL, s); | 
|---|
| [162] | 194 |  | 
|---|
| [551] | 195 | CommaFmtULL(szMB, sizeof(szMB), | 
|---|
|  | 196 | (ULONGLONG) fsa.cUnitAvail * | 
|---|
|  | 197 | (fsa.cSectorUnit * fsa.cbSector), 'M'); | 
|---|
|  | 198 | CommaFmtULL(szKB, sizeof(szKB), | 
|---|
|  | 199 | (ULONGLONG) fsa.cUnitAvail * | 
|---|
|  | 200 | (fsa.cSectorUnit * fsa.cbSector), 'K'); | 
|---|
|  | 201 | CommaFmtULL(szUnits, sizeof(szUnits), | 
|---|
|  | 202 | (ULONGLONG) fsa.cUnitAvail, ' '); | 
|---|
|  | 203 | sprintf(s, | 
|---|
|  | 204 | "%s, %s, %s %s%s", | 
|---|
|  | 205 | szMB, szKB, szUnits, | 
|---|
|  | 206 | GetPString(IDS_UNITTEXT), &"s"[fsa.cUnitAvail == 1L]); | 
|---|
|  | 207 | WinSetDlgItemText(hwnd, INFO_AVAILABLE, s); | 
|---|
|  | 208 | sprintf(s, | 
|---|
|  | 209 | GetPString(IDS_SECTORSTEXT), | 
|---|
|  | 210 | fsa.cbSector, | 
|---|
|  | 211 | fsa.cSectorUnit, &"s"[fsa.cSectorUnit == 1L]); | 
|---|
|  | 212 | WinSetDlgItemText(hwnd, INFO_ALLOCUNITS, s); | 
|---|
| [552] | 213 |  | 
|---|
| [551] | 214 | percentfree = (fsa.cUnitAvail && fsa.cUnit) ? | 
|---|
|  | 215 | (fsa.cUnitAvail * 100) / fsa.cUnit : 0; | 
|---|
|  | 216 | if (!percentfree && fsa.cUnitAvail) | 
|---|
|  | 217 | percentfree = 1; | 
|---|
|  | 218 | percentused = 100 - percentfree; | 
|---|
|  | 219 | WinSendDlgItemMsg(hwnd, | 
|---|
|  | 220 | INFO_USED, | 
|---|
|  | 221 | SLM_SETSLIDERINFO, | 
|---|
|  | 222 | MPFROM2SHORT(SMA_SLIDERARMPOSITION, | 
|---|
|  | 223 | SMA_INCREMENTVALUE), | 
|---|
|  | 224 | MPFROMSHORT(percentused)); | 
|---|
|  | 225 | WinSendDlgItemMsg(hwnd, | 
|---|
|  | 226 | INFO_FREE, | 
|---|
|  | 227 | SLM_SETSLIDERINFO, | 
|---|
|  | 228 | MPFROM2SHORT(SMA_SLIDERARMPOSITION, | 
|---|
|  | 229 | SMA_INCREMENTVALUE), | 
|---|
|  | 230 | MPFROMSHORT(percentfree)); | 
|---|
|  | 231 | sprintf(s, "%u%%", percentused); | 
|---|
|  | 232 | WinSetDlgItemText(hwnd, INFO_USEDPERCENT, s); | 
|---|
|  | 233 | sprintf(s, "%u%%", percentfree); | 
|---|
| [575] | 234 | WinSetDlgItemText(hwnd, INFO_FREEPERCENT, s); | 
|---|
|  | 235 | } | 
|---|
|  | 236 | else | 
|---|
|  | 237 | WinSetDlgItemText(hwnd, INFO_AVAILABLE, GetPString(IDS_STATSMEANINGLESSTEXT)); | 
|---|
| [551] | 238 | } | 
|---|
|  | 239 | else { | 
|---|
|  | 240 | sprintf(FileSystem, | 
|---|
|  | 241 | GetPString(IDS_CANTQUERYVOLTEXT), | 
|---|
|  | 242 | toupper(*pszFileName)); | 
|---|
|  | 243 | Notify(FileSystem); | 
|---|
|  | 244 | WinDismissDlg(hwnd, 0); | 
|---|
|  | 245 | } | 
|---|
|  | 246 | } | 
|---|
|  | 247 | else { | 
|---|
|  | 248 | sprintf(FileSystem, | 
|---|
|  | 249 | GetPString(IDS_CANTQUERYALLOCTEXT), | 
|---|
|  | 250 | toupper(*pszFileName)); | 
|---|
|  | 251 | Notify(FileSystem); | 
|---|
|  | 252 | WinDismissDlg(hwnd, 0); | 
|---|
|  | 253 | } | 
|---|
|  | 254 | } | 
|---|
|  | 255 | else { | 
|---|
|  | 256 | FlagMsg(*pszFileName, s); | 
|---|
|  | 257 | sprintf(FileSystem, | 
|---|
|  | 258 | GetPString(IDS_DRIVEINACCESSIBLETEXT), | 
|---|
|  | 259 | toupper(*pszFileName), s); | 
|---|
|  | 260 | Notify(FileSystem); | 
|---|
|  | 261 | WinDismissDlg(hwnd, 0); | 
|---|
|  | 262 | } | 
|---|
| [2] | 263 | } | 
|---|
| [551] | 264 | else { | 
|---|
|  | 265 | WinDismissDlg(hwnd, 0); | 
|---|
|  | 266 | } | 
|---|
|  | 267 | } | 
|---|
|  | 268 | else | 
|---|
|  | 269 | WinDismissDlg(hwnd, 0); | 
|---|
|  | 270 | break; | 
|---|
| [2] | 271 |  | 
|---|
| [551] | 272 | case WM_CONTROL: | 
|---|
|  | 273 | return 0; | 
|---|
| [2] | 274 |  | 
|---|
| [551] | 275 | case WM_COMMAND: | 
|---|
|  | 276 | switch (SHORT1FROMMP(mp1)) { | 
|---|
|  | 277 | case DID_CANCEL: | 
|---|
|  | 278 | WinDismissDlg(hwnd, 0); | 
|---|
|  | 279 | break; | 
|---|
| [2] | 280 |  | 
|---|
| [551] | 281 | case IDM_HELP: | 
|---|
|  | 282 | if (hwndHelp) | 
|---|
|  | 283 | WinSendMsg(hwndHelp, | 
|---|
|  | 284 | HM_DISPLAY_HELP, | 
|---|
|  | 285 | MPFROM2SHORT(HELP_DRVINFO, 0), MPFROMSHORT(HM_RESOURCEID)); | 
|---|
|  | 286 | break; | 
|---|
| [2] | 287 |  | 
|---|
| [551] | 288 | case DID_OK: | 
|---|
|  | 289 | pszFileName = INSTDATA(hwnd); | 
|---|
|  | 290 | if (!(driveflags[toupper(*pszFileName) - 'A'] & DRIVE_NOTWRITEABLE)) { | 
|---|
| [2] | 291 |  | 
|---|
| [551] | 292 | CHAR s[CCHMAXPATHCOMP + 3]; | 
|---|
| [2] | 293 |  | 
|---|
| [551] | 294 | *s = 0; | 
|---|
|  | 295 | WinQueryDlgItemText(hwnd, INFO_LABEL, CCHMAXPATHCOMP, s); | 
|---|
|  | 296 | bstrip(s); | 
|---|
|  | 297 | if (*s) { | 
|---|
|  | 298 | struct | 
|---|
|  | 299 | { | 
|---|
|  | 300 | ULONG serial; | 
|---|
|  | 301 | CHAR volumelength; | 
|---|
|  | 302 | CHAR volumelabel[CCHMAXPATH]; | 
|---|
|  | 303 | } | 
|---|
|  | 304 | volser; | 
|---|
| [2] | 305 |  | 
|---|
| [551] | 306 | memset(&volser, 0, sizeof(volser)); | 
|---|
|  | 307 | DosError(FERR_DISABLEHARDERR); | 
|---|
|  | 308 | if (!DosQueryFSInfo(toupper(*pszFileName) - '@', | 
|---|
|  | 309 | FSIL_VOLSER, | 
|---|
|  | 310 | &volser, | 
|---|
|  | 311 | (ULONG) sizeof(volser)) && | 
|---|
|  | 312 | stricmp(s, volser.volumelabel)) { | 
|---|
|  | 313 | memmove(s + 1, s, strlen(s) + 1); | 
|---|
|  | 314 | *s = strlen(s + 1); | 
|---|
|  | 315 | DosError(FERR_DISABLEHARDERR); | 
|---|
|  | 316 | rc = DosSetFSInfo(toupper(*pszFileName) - '@', | 
|---|
|  | 317 | 2L, (PVOID) s, (ULONG) sizeof(s)); | 
|---|
|  | 318 | if (rc) { | 
|---|
|  | 319 | Dos_Error(MB_CANCEL, rc, hwnd, __FILE__, __LINE__, | 
|---|
|  | 320 | "DosSetFSInfo failed"); | 
|---|
|  | 321 | } | 
|---|
|  | 322 | } | 
|---|
|  | 323 | } | 
|---|
| [2] | 324 | } | 
|---|
| [551] | 325 | WinDismissDlg(hwnd, 1); | 
|---|
|  | 326 | break; | 
|---|
|  | 327 | } | 
|---|
|  | 328 | return 0; | 
|---|
| [2] | 329 | } | 
|---|
| [551] | 330 | return WinDefDlgProc(hwnd, msg, mp1, mp2); | 
|---|
| [2] | 331 | } | 
|---|
|  | 332 |  | 
|---|
| [575] | 333 | typedef struct { | 
|---|
| [2] | 334 | USHORT size; | 
|---|
| [551] | 335 | CHAR szFileName[CCHMAXPATH]; | 
|---|
| [2] | 336 | CHAR **list; | 
|---|
| [551] | 337 | BOOL madechanges; | 
|---|
| [575] | 338 | } FILESTUF; | 
|---|
| [2] | 339 |  | 
|---|
| [575] | 340 | typedef struct { | 
|---|
|  | 341 | USHORT size; | 
|---|
|  | 342 | PFNWP oldproc; | 
|---|
|  | 343 | FILESTUF *pfs; | 
|---|
|  | 344 | HWND lasthwndMenu; | 
|---|
|  | 345 | } ICONSTUF; | 
|---|
|  | 346 |  | 
|---|
| [2] | 347 | /* | 
|---|
|  | 348 | * subclass routine to allow changing a program's icon | 
|---|
|  | 349 | */ | 
|---|
|  | 350 |  | 
|---|
| [551] | 351 | MRESULT EXPENTRY IconProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) | 
|---|
| [162] | 352 | { | 
|---|
| [575] | 353 | ICONSTUF *pis = (ICONSTUF *)WinQueryWindowPtr(hwnd, QWL_USER); | 
|---|
|  | 354 | MRESULT mr; | 
|---|
|  | 355 | CHAR *p; | 
|---|
|  | 356 |  | 
|---|
| [2] | 357 | static BOOL emphasized = FALSE; | 
|---|
|  | 358 |  | 
|---|
| [575] | 359 | if (!pis) { | 
|---|
|  | 360 | Runtime_Error(pszSrcFile, __LINE__, "no data"); | 
|---|
|  | 361 | if (msg != WM_DESTROY) | 
|---|
|  | 362 | return WinDefWindowProc(hwnd, msg, mp1, mp2); | 
|---|
|  | 363 | } | 
|---|
| [2] | 364 |  | 
|---|
| [551] | 365 | switch (msg) { | 
|---|
|  | 366 | case DM_DRAGOVER: | 
|---|
|  | 367 | if (!emphasized) { | 
|---|
|  | 368 | emphasized = TRUE; | 
|---|
|  | 369 | DrawTargetEmphasis(hwnd, emphasized); | 
|---|
|  | 370 | } | 
|---|
| [618] | 371 | if (AcceptOneDrop(hwnd, mp1, mp2)) | 
|---|
| [551] | 372 | return MRFROM2SHORT(DOR_DROP, DO_MOVE); | 
|---|
|  | 373 | return MRFROM2SHORT(DOR_NEVERDROP, 0); | 
|---|
| [2] | 374 |  | 
|---|
| [551] | 375 | case DM_DRAGLEAVE: | 
|---|
|  | 376 | emphasized = FALSE; | 
|---|
|  | 377 | DrawTargetEmphasis(hwnd, emphasized); | 
|---|
|  | 378 | break; | 
|---|
| [2] | 379 |  | 
|---|
| [551] | 380 | case DM_DROPHELP: | 
|---|
|  | 381 | DropHelp(mp1, mp2, hwnd, GetPString(IDS_DROPCHGICONHELPTEXT)); | 
|---|
|  | 382 | return 0; | 
|---|
| [2] | 383 |  | 
|---|
| [551] | 384 | case DM_DROP: | 
|---|
|  | 385 | { | 
|---|
|  | 386 | HPOINTER hptr; | 
|---|
|  | 387 | CHAR szFrom[CCHMAXPATH + 2]; | 
|---|
|  | 388 | ICONINFO ici; | 
|---|
| [2] | 389 |  | 
|---|
| [551] | 390 | emphasized = FALSE; | 
|---|
|  | 391 | DrawTargetEmphasis(hwnd, emphasized); | 
|---|
| [618] | 392 | if (GetOneDrop(hwnd, mp1, mp2, szFrom, sizeof(szFrom))) { | 
|---|
| [551] | 393 | memset(&ici, 0, sizeof(ICONINFO)); | 
|---|
|  | 394 | ici.cb = sizeof(ICONINFO); | 
|---|
|  | 395 | ici.fFormat = ICON_FILE; | 
|---|
|  | 396 | ici.pszFileName = szFrom; | 
|---|
| [575] | 397 | if (!WinSetFileIcon((PSZ) pis->pfs->szFileName, (PICONINFO) & ici)) { | 
|---|
| [551] | 398 | ici.fFormat = ICON_CLEAR; | 
|---|
| [575] | 399 | WinSetFileIcon((PSZ) pis->pfs->szFileName, (PICONINFO) & ici); | 
|---|
| [551] | 400 | } | 
|---|
| [575] | 401 | hptr = WinLoadFileIcon(pis->pfs->szFileName, FALSE); | 
|---|
| [551] | 402 | if (!hptr) | 
|---|
| [575] | 403 | hptr = (!IsFile(pis->pfs->szFileName)) ? hptrDir : hptrFile; | 
|---|
|  | 404 | if (pis && pis->oldproc) { | 
|---|
| [551] | 405 | WinShowWindow(hwnd, FALSE); | 
|---|
| [575] | 406 | pis->oldproc(hwnd, SM_SETHANDLE, MPFROMLONG(hptr), MPVOID); | 
|---|
| [551] | 407 | WinShowWindow(hwnd, TRUE); | 
|---|
|  | 408 | WinInvalidateRect(WinQueryWindow(hwnd, QW_PARENT), NULL, TRUE); | 
|---|
|  | 409 | } | 
|---|
| [2] | 410 | } | 
|---|
| [551] | 411 | } | 
|---|
|  | 412 | return 0; | 
|---|
| [2] | 413 |  | 
|---|
| [551] | 414 | case WM_PAINT: | 
|---|
| [575] | 415 | mr = pis->oldproc(hwnd, msg, mp1, mp2); | 
|---|
|  | 416 | PaintRecessedWindow(hwnd, (HPS) 0, FALSE, FALSE); | 
|---|
|  | 417 | return mr; | 
|---|
| [551] | 418 | break; | 
|---|
| [2] | 419 |  | 
|---|
| [551] | 420 | case WM_MENUEND: | 
|---|
| [575] | 421 | if (pis->lasthwndMenu == (HWND)mp2) | 
|---|
|  | 422 | WinDestroyWindow(pis->lasthwndMenu); | 
|---|
|  | 423 | pis->lasthwndMenu = (HWND) 0; | 
|---|
| [551] | 424 | break; | 
|---|
| [2] | 425 |  | 
|---|
| [551] | 426 | case WM_CONTEXTMENU: | 
|---|
| [575] | 427 | if (pis->lasthwndMenu) | 
|---|
|  | 428 | WinDestroyWindow(pis->lasthwndMenu); | 
|---|
|  | 429 | pis->lasthwndMenu = WinLoadMenu(hwnd, FM3ModHandle, FLE_FRAME); | 
|---|
|  | 430 | if (pis->lasthwndMenu) { | 
|---|
|  | 431 | p = strrchr(pis->pfs->szFileName, '.'); | 
|---|
|  | 432 | if (!p || (stricmp(p, ".ICO") && stricmp(p, ".PTR"))) | 
|---|
|  | 433 | WinSendMsg(pis->lasthwndMenu, | 
|---|
|  | 434 | MM_DELETEITEM, | 
|---|
|  | 435 | MPFROM2SHORT(IDM_SELECTALL, TRUE), MPVOID); | 
|---|
|  | 436 | PopupMenu(hwnd, hwnd, pis->lasthwndMenu); | 
|---|
| [551] | 437 | } | 
|---|
|  | 438 | break; | 
|---|
|  | 439 |  | 
|---|
|  | 440 | case WM_COMMAND: | 
|---|
|  | 441 | switch (SHORT1FROMMP(mp1)) { | 
|---|
|  | 442 | case IDM_SELECTALL: | 
|---|
|  | 443 | case IDM_DESELECTALL: | 
|---|
|  | 444 | WinDlgBox(HWND_DESKTOP, | 
|---|
|  | 445 | hwnd, | 
|---|
|  | 446 | SetIconDlgProc, | 
|---|
|  | 447 | FM3ModHandle, | 
|---|
|  | 448 | SETICON_FRAME, | 
|---|
|  | 449 | (PVOID) ((SHORT1FROMMP(mp1) == IDM_SELECTALL) ? | 
|---|
| [575] | 450 | pis->pfs->szFileName : NULL)); | 
|---|
| [2] | 451 | break; | 
|---|
| [551] | 452 | } | 
|---|
|  | 453 | return 0; | 
|---|
| [2] | 454 |  | 
|---|
| [551] | 455 | case WM_DESTROY: | 
|---|
|  | 456 | emphasized = FALSE; | 
|---|
| [575] | 457 | if (!pis) | 
|---|
|  | 458 | return WinDefWindowProc(hwnd, msg, mp1, mp2); | 
|---|
| [576] | 459 | else { | 
|---|
|  | 460 | if (pis->lasthwndMenu) | 
|---|
|  | 461 | WinDestroyWindow(pis->lasthwndMenu); | 
|---|
|  | 462 | free(pis); | 
|---|
|  | 463 | } | 
|---|
| [551] | 464 | break; | 
|---|
| [2] | 465 | } | 
|---|
|  | 466 |  | 
|---|
| [575] | 467 | return pis->oldproc(hwnd, msg, mp1, mp2); | 
|---|
| [2] | 468 | } | 
|---|
|  | 469 |  | 
|---|
| [551] | 470 | MRESULT EXPENTRY FileInfoProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) | 
|---|
| [336] | 471 | { | 
|---|
| [575] | 472 | FILESTUF *pfs; | 
|---|
|  | 473 | ICONSTUF *pis; | 
|---|
| [2] | 474 |  | 
|---|
| [551] | 475 | switch (msg) { | 
|---|
|  | 476 | case WM_INITDLG: | 
|---|
|  | 477 | if (!mp2) { | 
|---|
|  | 478 | WinDismissDlg(hwnd, 1); | 
|---|
|  | 479 | break; | 
|---|
|  | 480 | } | 
|---|
| [575] | 481 | pfs = xmallocz(sizeof(FILESTUF), pszSrcFile, __LINE__); | 
|---|
|  | 482 | if (!pfs) { | 
|---|
| [551] | 483 | WinDismissDlg(hwnd, 1); | 
|---|
|  | 484 | break; | 
|---|
|  | 485 | } | 
|---|
| [575] | 486 | pfs->list = (CHAR **) mp2; | 
|---|
|  | 487 | pfs->size = sizeof(FILESTUF); | 
|---|
|  | 488 | WinSetWindowPtr(hwnd, QWL_USER, pfs); | 
|---|
| [551] | 489 | { | 
|---|
|  | 490 | USHORT ids[] = { FLE_SIZES, FLE_SLACK, FLE_LASTWRITE, FLE_CREATE, | 
|---|
|  | 491 | FLE_LASTACCESS, 0 | 
|---|
|  | 492 | }; | 
|---|
|  | 493 | INT x; | 
|---|
|  | 494 | CHAR s[CCHMAXPATH]; | 
|---|
|  | 495 |  | 
|---|
| [575] | 496 | for (x = 0; pfs->list[x]; x++) { | 
|---|
|  | 497 | if (DosQueryPathInfo(pfs->list[x], FIL_QUERYFULLNAME, s, sizeof(s))) | 
|---|
|  | 498 | strcpy(s, pfs->list[x]); | 
|---|
| [551] | 499 | WinSendDlgItemMsg(hwnd, | 
|---|
|  | 500 | FLE_NAME, | 
|---|
|  | 501 | LM_INSERTITEM, | 
|---|
|  | 502 | MPFROM2SHORT(LIT_SORTASCENDING, 0), MPFROMP(s)); | 
|---|
| [2] | 503 | } | 
|---|
| [551] | 504 | if (!x) { | 
|---|
|  | 505 | WinDismissDlg(hwnd, 1); | 
|---|
|  | 506 | break; | 
|---|
| [2] | 507 | } | 
|---|
| [551] | 508 | WinSendDlgItemMsg(hwnd, | 
|---|
|  | 509 | FLE_NAME, | 
|---|
|  | 510 | LM_SELECTITEM, MPFROM2SHORT(0, 0), MPFROMSHORT(TRUE)); | 
|---|
|  | 511 | for (x = 0; ids[x]; x++) | 
|---|
|  | 512 | SetPresParams(WinWindowFromID(hwnd, ids[x]), | 
|---|
|  | 513 | &RGBGREY, &RGBBLACK, &RGBBLACK, NULL); | 
|---|
|  | 514 | } | 
|---|
| [575] | 515 | pis = xmallocz(sizeof(ICONSTUF), pszSrcFile, __LINE__); | 
|---|
|  | 516 | if (!pis) { | 
|---|
|  | 517 | WinDismissDlg(hwnd, 1); | 
|---|
|  | 518 | break; | 
|---|
|  | 519 | } | 
|---|
|  | 520 | WinSetWindowPtr(WinWindowFromID(hwnd, FLE_ICON), QWL_USER, (PVOID) pis); | 
|---|
|  | 521 | pis->size = sizeof(ICONSTUF); | 
|---|
|  | 522 | pis->pfs = pfs; | 
|---|
|  | 523 | pis->oldproc = WinSubclassWindow(WinWindowFromID(hwnd, FLE_ICON), | 
|---|
| [551] | 524 | IconProc); | 
|---|
|  | 525 | break; | 
|---|
| [2] | 526 |  | 
|---|
| [551] | 527 | case WM_CONTROL: | 
|---|
|  | 528 | switch (SHORT1FROMMP(mp1)) { | 
|---|
|  | 529 | case FLE_READONLY: | 
|---|
|  | 530 | case FLE_ARCHIVED: | 
|---|
|  | 531 | case FLE_SYSTEM: | 
|---|
|  | 532 | case FLE_HIDDEN: | 
|---|
|  | 533 | switch (SHORT2FROMMP(mp1)) { | 
|---|
|  | 534 | case BN_CLICKED: | 
|---|
| [575] | 535 | pfs = WinQueryWindowPtr(hwnd, QWL_USER); | 
|---|
|  | 536 | if (pfs && *pfs->szFileName) { | 
|---|
| [551] | 537 |  | 
|---|
|  | 538 | LISTINFO li; | 
|---|
|  | 539 | INT numfiles = 0, numalloc = 0; | 
|---|
|  | 540 |  | 
|---|
|  | 541 | memset(&li, 0, sizeof(LISTINFO)); | 
|---|
| [575] | 542 | if (!AddToList(pfs->szFileName, &li.list, &numfiles, &numalloc)) { | 
|---|
| [551] | 543 | if (WinDlgBox(HWND_DESKTOP, | 
|---|
|  | 544 | hwnd, | 
|---|
|  | 545 | AttrListDlgProc, | 
|---|
|  | 546 | FM3ModHandle, | 
|---|
|  | 547 | ATR_FRAME, MPFROMP(&li)) && li.list && li.list[0]) { | 
|---|
| [575] | 548 | pfs->madechanges = TRUE; | 
|---|
| [551] | 549 | WinSendMsg(hwnd, UM_SETDIR, MPVOID, MPVOID); | 
|---|
|  | 550 | } | 
|---|
|  | 551 | FreeList(li.list); | 
|---|
|  | 552 | } | 
|---|
|  | 553 | } | 
|---|
|  | 554 | break; | 
|---|
| [2] | 555 | } | 
|---|
|  | 556 | break; | 
|---|
| [551] | 557 | case FLE_NAME: | 
|---|
|  | 558 | switch (SHORT2FROMMP(mp1)) { | 
|---|
|  | 559 | case LN_ENTER: | 
|---|
|  | 560 | case LN_SELECT: | 
|---|
| [575] | 561 | pfs = WinQueryWindowPtr(hwnd, QWL_USER); | 
|---|
|  | 562 | if (!pfs) { | 
|---|
| [551] | 563 | Runtime_Error(pszSrcFile, __LINE__, "no data"); | 
|---|
|  | 564 | WinDismissDlg(hwnd, 1); | 
|---|
|  | 565 | } | 
|---|
|  | 566 | else { | 
|---|
| [2] | 567 |  | 
|---|
| [551] | 568 | SHORT sSelect; | 
|---|
| [2] | 569 |  | 
|---|
| [551] | 570 | sSelect = (SHORT) WinSendDlgItemMsg(hwnd, | 
|---|
|  | 571 | FLE_NAME, | 
|---|
|  | 572 | LM_QUERYSELECTION, | 
|---|
|  | 573 | MPFROMSHORT(LIT_FIRST), MPVOID); | 
|---|
|  | 574 | if (sSelect >= 0) { | 
|---|
| [575] | 575 | *pfs->szFileName = 0; | 
|---|
| [551] | 576 | WinSendDlgItemMsg(hwnd, | 
|---|
|  | 577 | FLE_NAME, | 
|---|
|  | 578 | LM_QUERYITEMTEXT, | 
|---|
|  | 579 | MPFROM2SHORT(sSelect, CCHMAXPATH), | 
|---|
| [575] | 580 | MPFROMP(pfs->szFileName)); | 
|---|
|  | 581 | if (*pfs->szFileName) { | 
|---|
| [551] | 582 | if (SHORT2FROMMP(mp1) == LN_SELECT) | 
|---|
|  | 583 | WinSendMsg(hwnd, UM_SETDIR, MPVOID, MPVOID); | 
|---|
|  | 584 | else | 
|---|
|  | 585 | DefaultView(hwnd, | 
|---|
| [575] | 586 | (HWND) 0, (HWND) 0, NULL, 32, pfs->szFileName); | 
|---|
| [551] | 587 | } | 
|---|
|  | 588 | } | 
|---|
|  | 589 | } | 
|---|
|  | 590 | break; | 
|---|
|  | 591 | } | 
|---|
|  | 592 | break; | 
|---|
|  | 593 | } | 
|---|
|  | 594 | return 0; | 
|---|
| [2] | 595 |  | 
|---|
| [551] | 596 | case UM_SETDIR: | 
|---|
|  | 597 | WinCheckButton(hwnd, FLE_READONLY, FALSE); | 
|---|
|  | 598 | WinCheckButton(hwnd, FLE_ARCHIVED, FALSE); | 
|---|
|  | 599 | WinCheckButton(hwnd, FLE_SYSTEM, FALSE); | 
|---|
|  | 600 | WinCheckButton(hwnd, FLE_HIDDEN, FALSE); | 
|---|
|  | 601 | WinCheckButton(hwnd, FLE_DIRECTORY, FALSE); | 
|---|
|  | 602 | WinCheckButton(hwnd, FLE_READABLE, FALSE); | 
|---|
|  | 603 | WinCheckButton(hwnd, FLE_WRITEABLE, FALSE); | 
|---|
|  | 604 | WinCheckButton(hwnd, FLE_OPEN, FALSE); | 
|---|
|  | 605 | WinCheckButton(hwnd, FLE_BINARY, FALSE); | 
|---|
|  | 606 | WinCheckButton(hwnd, FLE_ISARCHIVE, FALSE); | 
|---|
|  | 607 | WinSetDlgItemText(hwnd, FLE_ARCNAME, NullStr); | 
|---|
|  | 608 | WinCheckButton(hwnd, FLE_OS2FS, FALSE); | 
|---|
|  | 609 | WinCheckButton(hwnd, FLE_OS2WIN, FALSE); | 
|---|
|  | 610 | WinCheckButton(hwnd, FLE_OS2PM, FALSE); | 
|---|
|  | 611 | WinCheckButton(hwnd, FLE_DOS, FALSE); | 
|---|
|  | 612 | WinCheckButton(hwnd, FLE_32BIT, FALSE); | 
|---|
|  | 613 | WinCheckButton(hwnd, FLE_WINREAL, FALSE); | 
|---|
|  | 614 | WinCheckButton(hwnd, FLE_WINPROT, FALSE); | 
|---|
|  | 615 | WinCheckButton(hwnd, FLE_WINENH, FALSE); | 
|---|
|  | 616 | WinCheckButton(hwnd, FLE_DLL, FALSE); | 
|---|
|  | 617 | WinCheckButton(hwnd, FLE_PHYSDRV, FALSE); | 
|---|
|  | 618 | WinCheckButton(hwnd, FLE_VIRTDRV, FALSE); | 
|---|
|  | 619 | WinCheckButton(hwnd, FLE_PROTDLL, FALSE); | 
|---|
| [575] | 620 | pfs = WinQueryWindowPtr(hwnd, QWL_USER); | 
|---|
|  | 621 | if (pfs && *pfs->szFileName) { | 
|---|
| [551] | 622 | CHAR s[97]; | 
|---|
|  | 623 | FILEFINDBUF4 fs; | 
|---|
|  | 624 | HDIR hdir = HDIR_CREATE; | 
|---|
|  | 625 | ULONG apptype = 1L; | 
|---|
|  | 626 | FILE *fp; | 
|---|
|  | 627 | HPOINTER hptr; | 
|---|
|  | 628 | ARC_TYPE *info; | 
|---|
| [2] | 629 |  | 
|---|
| [551] | 630 | DosError(FERR_DISABLEHARDERR); | 
|---|
| [575] | 631 | if (DosFindFirst(pfs->szFileName, | 
|---|
| [551] | 632 | &hdir, | 
|---|
|  | 633 | FILE_NORMAL | FILE_ARCHIVED | | 
|---|
|  | 634 | FILE_DIRECTORY | FILE_READONLY | FILE_HIDDEN | | 
|---|
|  | 635 | FILE_SYSTEM, | 
|---|
|  | 636 | &fs, sizeof(fs), &apptype, FIL_QUERYEASIZE)) { | 
|---|
|  | 637 | // Not found | 
|---|
|  | 638 | SHORT sSelect, numitems; | 
|---|
| [2] | 639 |  | 
|---|
| [551] | 640 | DosBeep(250, 100);              // Wake up user | 
|---|
|  | 641 | sSelect = (SHORT) WinSendDlgItemMsg(hwnd, | 
|---|
|  | 642 | FLE_NAME, | 
|---|
|  | 643 | LM_QUERYSELECTION, | 
|---|
|  | 644 | MPFROMSHORT(LIT_FIRST), MPVOID); | 
|---|
|  | 645 | if (sSelect >= 0) { | 
|---|
|  | 646 | WinSendDlgItemMsg(hwnd, | 
|---|
|  | 647 | FLE_NAME, | 
|---|
|  | 648 | LM_DELETEITEM, MPFROMSHORT(sSelect), MPVOID); | 
|---|
|  | 649 | numitems = (SHORT) WinSendDlgItemMsg(hwnd, | 
|---|
|  | 650 | FLE_NAME, | 
|---|
|  | 651 | LM_QUERYITEMCOUNT, | 
|---|
|  | 652 | MPVOID, MPVOID); | 
|---|
|  | 653 | if (numitems) | 
|---|
|  | 654 | PostMsg(WinWindowFromID(hwnd, FLE_NAME), | 
|---|
|  | 655 | LM_SELECTITEM, | 
|---|
|  | 656 | MPFROMSHORT(((sSelect) ? sSelect - 1 : 0)), | 
|---|
|  | 657 | MPFROMSHORT(TRUE)); | 
|---|
|  | 658 | } | 
|---|
| [2] | 659 | } | 
|---|
| [551] | 660 | else { | 
|---|
|  | 661 | DosFindClose(hdir); | 
|---|
|  | 662 | sprintf(s, | 
|---|
|  | 663 | "%04u/%02u/%02u  %02u:%02u:%02u", | 
|---|
|  | 664 | 1980 + fs.fdateLastWrite.year, | 
|---|
|  | 665 | fs.fdateLastWrite.month, | 
|---|
|  | 666 | fs.fdateLastWrite.day, | 
|---|
|  | 667 | fs.ftimeLastWrite.hours, | 
|---|
|  | 668 | fs.ftimeLastWrite.minutes, fs.ftimeLastWrite.twosecs * 2); | 
|---|
|  | 669 | WinSetDlgItemText(hwnd, FLE_LASTWRITE, s); | 
|---|
|  | 670 | if (fs.fdateCreation.year && | 
|---|
|  | 671 | fs.fdateCreation.month && fs.fdateCreation.day) { | 
|---|
|  | 672 | sprintf(s, | 
|---|
|  | 673 | "%04u/%02u/%02u  %02u:%02u:%02u", | 
|---|
|  | 674 | 1980 + fs.fdateCreation.year, | 
|---|
|  | 675 | fs.fdateCreation.month, | 
|---|
|  | 676 | fs.fdateCreation.day, | 
|---|
|  | 677 | fs.ftimeCreation.hours, | 
|---|
|  | 678 | fs.ftimeCreation.minutes, fs.ftimeCreation.twosecs * 2); | 
|---|
|  | 679 | WinSetDlgItemText(hwnd, FLE_CREATE, s); | 
|---|
|  | 680 | } | 
|---|
|  | 681 | if (fs.fdateLastAccess.year && | 
|---|
|  | 682 | fs.fdateLastAccess.month && fs.fdateLastAccess.day) { | 
|---|
|  | 683 | sprintf(s, | 
|---|
|  | 684 | "%04u/%02u/%02u  %02u:%02u:%02u", | 
|---|
|  | 685 | 1980 + fs.fdateLastAccess.year, | 
|---|
|  | 686 | fs.fdateLastAccess.month, | 
|---|
|  | 687 | fs.fdateLastAccess.day, | 
|---|
|  | 688 | fs.ftimeLastAccess.hours, | 
|---|
|  | 689 | fs.ftimeLastAccess.minutes, fs.ftimeLastAccess.twosecs * 2); | 
|---|
|  | 690 | WinSetDlgItemText(hwnd, FLE_LASTACCESS, s); | 
|---|
|  | 691 | } | 
|---|
|  | 692 | sprintf(s, | 
|---|
|  | 693 | GetPString(IDS_SIZEINCLEASTEXT), | 
|---|
|  | 694 | fs.cbFile, | 
|---|
|  | 695 | CBLIST_TO_EASIZE(fs.cbList), | 
|---|
|  | 696 | fs.cbFile + CBLIST_TO_EASIZE(fs.cbList), | 
|---|
|  | 697 | (fs.cbFile + CBLIST_TO_EASIZE(fs.cbList)) / 1024); | 
|---|
|  | 698 | WinSetDlgItemText(hwnd, FLE_SIZES, s); | 
|---|
|  | 699 | sprintf(s, "%lub", fs.cbFileAlloc - fs.cbFile); | 
|---|
|  | 700 | WinSetDlgItemText(hwnd, FLE_SLACK, s); | 
|---|
|  | 701 | WinCheckButton(hwnd, | 
|---|
|  | 702 | FLE_READONLY, ((fs.attrFile & FILE_READONLY) != 0)); | 
|---|
|  | 703 | WinCheckButton(hwnd, | 
|---|
|  | 704 | FLE_ARCHIVED, ((fs.attrFile & FILE_ARCHIVED) != 0)); | 
|---|
|  | 705 | WinCheckButton(hwnd, | 
|---|
|  | 706 | FLE_DIRECTORY, ((fs.attrFile & FILE_DIRECTORY) != 0)); | 
|---|
|  | 707 | WinCheckButton(hwnd, FLE_HIDDEN, ((fs.attrFile & FILE_HIDDEN) != 0)); | 
|---|
|  | 708 | WinCheckButton(hwnd, FLE_SYSTEM, ((fs.attrFile & FILE_SYSTEM) != 0)); | 
|---|
|  | 709 | DosError(FERR_DISABLEHARDERR); | 
|---|
| [575] | 710 | if (!DosQueryAppType(pfs->szFileName, &apptype)) { | 
|---|
| [551] | 711 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2FS), TRUE); | 
|---|
|  | 712 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2WIN), TRUE); | 
|---|
|  | 713 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2PM), TRUE); | 
|---|
|  | 714 | WinEnableWindow(WinWindowFromID(hwnd, FLE_BOUND), TRUE); | 
|---|
|  | 715 | WinEnableWindow(WinWindowFromID(hwnd, FLE_32BIT), TRUE); | 
|---|
|  | 716 | WinEnableWindow(WinWindowFromID(hwnd, FLE_DOS), TRUE); | 
|---|
|  | 717 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINPROT), TRUE); | 
|---|
|  | 718 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINREAL), TRUE); | 
|---|
|  | 719 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINENH), TRUE); | 
|---|
|  | 720 | WinEnableWindow(WinWindowFromID(hwnd, FLE_DLL), TRUE); | 
|---|
|  | 721 | WinEnableWindow(WinWindowFromID(hwnd, FLE_PHYSDRV), TRUE); | 
|---|
|  | 722 | WinEnableWindow(WinWindowFromID(hwnd, FLE_VIRTDRV), TRUE); | 
|---|
|  | 723 | WinEnableWindow(WinWindowFromID(hwnd, FLE_PROTDLL), TRUE); | 
|---|
|  | 724 | WinCheckButton(hwnd, FLE_OS2FS, | 
|---|
|  | 725 | ((apptype & FAPPTYP_NOTWINDOWCOMPAT) && | 
|---|
|  | 726 | !(apptype & FAPPTYP_WINDOWCOMPAT))); | 
|---|
|  | 727 | WinCheckButton(hwnd, FLE_OS2WIN, | 
|---|
|  | 728 | ((apptype & FAPPTYP_WINDOWCOMPAT) && | 
|---|
|  | 729 | !(apptype & FAPPTYP_NOTWINDOWCOMPAT))); | 
|---|
|  | 730 | WinCheckButton(hwnd, FLE_OS2PM, | 
|---|
|  | 731 | ((apptype & FAPPTYP_WINDOWAPI) == | 
|---|
|  | 732 | FAPPTYP_WINDOWAPI)); | 
|---|
|  | 733 | WinCheckButton(hwnd, FLE_BOUND, ((apptype & FAPPTYP_BOUND) != 0)); | 
|---|
|  | 734 | WinCheckButton(hwnd, FLE_DLL, ((apptype & FAPPTYP_DLL) != 0)); | 
|---|
|  | 735 | WinCheckButton(hwnd, FLE_DOS, ((apptype & FAPPTYP_DOS) != 0)); | 
|---|
|  | 736 | WinCheckButton(hwnd, FLE_PHYSDRV, | 
|---|
|  | 737 | ((apptype & FAPPTYP_PHYSDRV) != 0)); | 
|---|
|  | 738 | WinCheckButton(hwnd, FLE_VIRTDRV, | 
|---|
|  | 739 | ((apptype & FAPPTYP_VIRTDRV) != 0)); | 
|---|
|  | 740 | WinCheckButton(hwnd, FLE_PROTDLL, | 
|---|
|  | 741 | ((apptype & FAPPTYP_PROTDLL) != 0)); | 
|---|
|  | 742 | WinCheckButton(hwnd, FLE_WINREAL, | 
|---|
|  | 743 | ((apptype & FAPPTYP_WINDOWSREAL) != 0)); | 
|---|
|  | 744 | WinCheckButton(hwnd, FLE_WINPROT, | 
|---|
|  | 745 | ((apptype & FAPPTYP_WINDOWSPROT) != 0)); | 
|---|
|  | 746 | WinCheckButton(hwnd, FLE_32BIT, ((apptype & FAPPTYP_32BIT) != 0)); | 
|---|
|  | 747 | WinCheckButton(hwnd, FLE_WINENH, ((apptype & 0x1000) != 0)); | 
|---|
|  | 748 | } | 
|---|
|  | 749 | else { | 
|---|
|  | 750 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2FS), FALSE); | 
|---|
|  | 751 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2WIN), FALSE); | 
|---|
|  | 752 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OS2PM), FALSE); | 
|---|
|  | 753 | WinEnableWindow(WinWindowFromID(hwnd, FLE_BOUND), FALSE); | 
|---|
|  | 754 | WinEnableWindow(WinWindowFromID(hwnd, FLE_32BIT), FALSE); | 
|---|
|  | 755 | WinEnableWindow(WinWindowFromID(hwnd, FLE_DOS), FALSE); | 
|---|
|  | 756 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINPROT), FALSE); | 
|---|
|  | 757 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINREAL), FALSE); | 
|---|
|  | 758 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WINENH), FALSE); | 
|---|
|  | 759 | WinEnableWindow(WinWindowFromID(hwnd, FLE_DLL), FALSE); | 
|---|
|  | 760 | WinEnableWindow(WinWindowFromID(hwnd, FLE_PHYSDRV), FALSE); | 
|---|
|  | 761 | WinEnableWindow(WinWindowFromID(hwnd, FLE_VIRTDRV), FALSE); | 
|---|
|  | 762 | WinEnableWindow(WinWindowFromID(hwnd, FLE_PROTDLL), FALSE); | 
|---|
|  | 763 | } | 
|---|
| [575] | 764 | hptr = WinLoadFileIcon(pfs->szFileName, FALSE); | 
|---|
| [551] | 765 | WinShowWindow(WinWindowFromID(hwnd, FLE_ICON), FALSE); | 
|---|
|  | 766 | if (hptr) { | 
|---|
|  | 767 | WinSendDlgItemMsg(hwnd, | 
|---|
|  | 768 | FLE_ICON, SM_SETHANDLE, MPFROMLONG(hptr), MPVOID); | 
|---|
|  | 769 | WinShowWindow(WinWindowFromID(hwnd, FLE_ICON), TRUE); | 
|---|
|  | 770 | } | 
|---|
|  | 771 | WinShowWindow(WinWindowFromID(hwnd, FLE_EAS), fs.cbList > 4); | 
|---|
|  | 772 | if (!(fs.attrFile & FILE_DIRECTORY)) { | 
|---|
|  | 773 | WinEnableWindow(WinWindowFromID(hwnd, FLE_READABLE), TRUE); | 
|---|
|  | 774 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WRITEABLE), TRUE); | 
|---|
|  | 775 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OPEN), TRUE); | 
|---|
|  | 776 | WinEnableWindow(WinWindowFromID(hwnd, FLE_ISARCHIVE), TRUE); | 
|---|
|  | 777 | WinEnableWindow(WinWindowFromID(hwnd, FLE_BINARY), TRUE); | 
|---|
| [575] | 778 | fp = _fsopen(pfs->szFileName, "rb", SH_DENYNO); | 
|---|
| [551] | 779 | if (fp) { | 
|---|
|  | 780 | char buff[512]; | 
|---|
|  | 781 | ULONG len; | 
|---|
|  | 782 | APIRET rc; | 
|---|
| [2] | 783 |  | 
|---|
| [551] | 784 | len = 512; | 
|---|
|  | 785 | rc = DosRead(fileno(fp), buff, len, &len); | 
|---|
|  | 786 | fclose(fp); | 
|---|
|  | 787 | WinCheckButton(hwnd, | 
|---|
|  | 788 | FLE_BINARY, | 
|---|
|  | 789 | ((len && rc) ? IsBinary(buff, len) : 2)); | 
|---|
|  | 790 | WinCheckButton(hwnd, FLE_READABLE, TRUE); | 
|---|
| [575] | 791 | info = find_type(pfs->szFileName, NULL); | 
|---|
| [551] | 792 | if (info) { | 
|---|
|  | 793 | WinCheckButton(hwnd, FLE_ISARCHIVE, 1); | 
|---|
|  | 794 | if (info->id) | 
|---|
|  | 795 | WinSetDlgItemText(hwnd, FLE_ARCNAME, info->id); | 
|---|
|  | 796 | } | 
|---|
|  | 797 | } | 
|---|
|  | 798 | else { | 
|---|
|  | 799 | WinCheckButton(hwnd, FLE_ISARCHIVE, 2); | 
|---|
|  | 800 | WinCheckButton(hwnd, FLE_BINARY, 2); | 
|---|
|  | 801 | } | 
|---|
| [575] | 802 | fp = _fsopen(pfs->szFileName, "ab", SH_DENYNO); | 
|---|
| [551] | 803 | if (fp) { | 
|---|
|  | 804 | WinCheckButton(hwnd, FLE_WRITEABLE, TRUE); | 
|---|
|  | 805 | fclose(fp); | 
|---|
|  | 806 | } | 
|---|
| [575] | 807 | fp = _fsopen(pfs->szFileName, "rb", SH_DENYRW); | 
|---|
| [551] | 808 | if (!fp) | 
|---|
|  | 809 | WinCheckButton(hwnd, FLE_OPEN, TRUE); | 
|---|
|  | 810 | else | 
|---|
|  | 811 | fclose(fp); | 
|---|
|  | 812 | } | 
|---|
|  | 813 | else { | 
|---|
|  | 814 | WinEnableWindow(WinWindowFromID(hwnd, FLE_READABLE), FALSE); | 
|---|
|  | 815 | WinEnableWindow(WinWindowFromID(hwnd, FLE_WRITEABLE), FALSE); | 
|---|
|  | 816 | WinEnableWindow(WinWindowFromID(hwnd, FLE_OPEN), FALSE); | 
|---|
|  | 817 | WinEnableWindow(WinWindowFromID(hwnd, FLE_ISARCHIVE), FALSE); | 
|---|
|  | 818 | WinEnableWindow(WinWindowFromID(hwnd, FLE_BINARY), FALSE); | 
|---|
|  | 819 | } | 
|---|
| [2] | 820 | } | 
|---|
| [551] | 821 | } | 
|---|
|  | 822 | return 0; | 
|---|
| [2] | 823 |  | 
|---|
| [551] | 824 | case WM_COMMAND: | 
|---|
|  | 825 | switch (SHORT1FROMMP(mp1)) { | 
|---|
|  | 826 | case DID_OK: | 
|---|
| [575] | 827 | pfs = WinQueryWindowPtr(hwnd, QWL_USER); | 
|---|
|  | 828 | WinDismissDlg(hwnd, (pfs && pfs->madechanges) ? 2 : 1); | 
|---|
| [551] | 829 | break; | 
|---|
|  | 830 | case IDM_HELP: | 
|---|
|  | 831 | if (hwndHelp) | 
|---|
|  | 832 | WinSendMsg(hwndHelp, | 
|---|
|  | 833 | HM_DISPLAY_HELP, | 
|---|
|  | 834 | MPFROM2SHORT(HELP_INFO, 0), MPFROMSHORT(HM_RESOURCEID)); | 
|---|
|  | 835 | break; | 
|---|
|  | 836 | case FLE_SETTINGS: | 
|---|
| [575] | 837 | pfs = WinQueryWindowPtr(hwnd, QWL_USER); | 
|---|
|  | 838 | if (pfs && *pfs->szFileName) | 
|---|
|  | 839 | OpenObject(pfs->szFileName, Settings, hwnd); | 
|---|
| [551] | 840 | break; | 
|---|
|  | 841 | case FLE_EAS: | 
|---|
| [575] | 842 | pfs = WinQueryWindowPtr(hwnd, QWL_USER); | 
|---|
|  | 843 | if (pfs && *pfs->szFileName) { | 
|---|
| [2] | 844 |  | 
|---|
| [551] | 845 | CHAR *list[2]; | 
|---|
| [2] | 846 |  | 
|---|
| [575] | 847 | list[0] = pfs->szFileName; | 
|---|
| [551] | 848 | list[1] = NULL; | 
|---|
|  | 849 | WinDlgBox(HWND_DESKTOP, | 
|---|
|  | 850 | hwnd, DisplayEAsProc, FM3ModHandle, EA_FRAME, (PVOID) list); | 
|---|
| [2] | 851 | } | 
|---|
| [551] | 852 | break; | 
|---|
|  | 853 | case DID_CANCEL: | 
|---|
| [575] | 854 | pfs = WinQueryWindowPtr(hwnd, QWL_USER); | 
|---|
|  | 855 | WinDismissDlg(hwnd, (pfs && pfs->madechanges) ? 2 : 0); | 
|---|
| [551] | 856 | break; | 
|---|
|  | 857 | } | 
|---|
|  | 858 | return 0; | 
|---|
| [2] | 859 |  | 
|---|
| [551] | 860 | case WM_DESTROY: | 
|---|
| [575] | 861 | pfs = WinQueryWindowPtr(hwnd, QWL_USER); | 
|---|
|  | 862 | if (pfs) | 
|---|
|  | 863 | free(pfs); | 
|---|
| [551] | 864 | break; | 
|---|
| [2] | 865 | } | 
|---|
| [551] | 866 | return WinDefDlgProc(hwnd, msg, mp1, mp2); | 
|---|
| [2] | 867 | } | 
|---|
|  | 868 |  | 
|---|
| [551] | 869 | MRESULT EXPENTRY SetDrvProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) | 
|---|
| [336] | 870 | { | 
|---|
| [551] | 871 | switch (msg) { | 
|---|
|  | 872 | case WM_INITDLG: | 
|---|
|  | 873 | if (!mp2 || !isalpha(*(CHAR *) mp2)) | 
|---|
|  | 874 | WinDismissDlg(hwnd, 0); | 
|---|
|  | 875 | else { | 
|---|
| [2] | 876 |  | 
|---|
| [551] | 877 | CHAR s[80]; | 
|---|
| [2] | 878 |  | 
|---|
| [551] | 879 | WinSetWindowULong(hwnd, QWL_USER, (toupper(*(CHAR *) mp2) - 'A')); | 
|---|
|  | 880 | sprintf(s, GetPString(IDS_DRIVEFLAGSTITLETEXT), toupper(*(CHAR *) mp2)); | 
|---|
|  | 881 | WinSetWindowText(hwnd, s); | 
|---|
| [2] | 882 | /* | 
|---|
| [575] | 883 | WinEnableWindow(WinWindowFromID(hwnd,DVS_REMOVABLE),FALSE); | 
|---|
|  | 884 | WinEnableWindow(WinWindowFromID(hwnd,DVS_NOTWRITEABLE),FALSE); | 
|---|
|  | 885 | WinEnableWindow(WinWindowFromID(hwnd,DVS_IGNORE),FALSE); | 
|---|
|  | 886 | WinEnableWindow(WinWindowFromID(hwnd,DVS_CDROM),FALSE); | 
|---|
|  | 887 | WinEnableWindow(WinWindowFromID(hwnd,DVS_NOLONGNAMES),FALSE); | 
|---|
|  | 888 | WinEnableWindow(WinWindowFromID(hwnd,DVS_REMOTE),FALSE); | 
|---|
|  | 889 | WinEnableWindow(WinWindowFromID(hwnd,DVS_VIRTUAL),FALSE); | 
|---|
|  | 890 | WinEnableWindow(WinWindowFromID(hwnd,DVS_RAMDISK),FALSE); | 
|---|
|  | 891 | WinEnableWindow(WinWindowFromID(hwnd,DVS_BOOT),FALSE); | 
|---|
|  | 892 | WinEnableWindow(WinWindowFromID(hwnd,DVS_INVALID),FALSE); | 
|---|
|  | 893 | WinEnableWindow(WinWindowFromID(hwnd,DVS_ZIPSTREAM),FALSE); | 
|---|
|  | 894 | WinEnableWindow(WinWindowFromID(hwnd,DVS_NOSTATS),FALSE); | 
|---|
| [2] | 895 | */ | 
|---|
| [551] | 896 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); | 
|---|
|  | 897 | } | 
|---|
|  | 898 | break; | 
|---|
| [2] | 899 |  | 
|---|
| [551] | 900 | case UM_UNDO: | 
|---|
|  | 901 | { | 
|---|
|  | 902 | ULONG drive = WinQueryWindowULong(hwnd, QWL_USER); | 
|---|
| [2] | 903 |  | 
|---|
| [551] | 904 | WinCheckButton(hwnd, DVS_REMOVABLE, | 
|---|
|  | 905 | ((driveflags[drive] & DRIVE_REMOVABLE) != 0)); | 
|---|
|  | 906 | WinCheckButton(hwnd, DVS_NOTWRITEABLE, | 
|---|
|  | 907 | ((driveflags[drive] & DRIVE_NOTWRITEABLE) != 0)); | 
|---|
|  | 908 | WinCheckButton(hwnd, DVS_IGNORE, | 
|---|
|  | 909 | ((driveflags[drive] & DRIVE_IGNORE) != 0)); | 
|---|
|  | 910 | WinCheckButton(hwnd, DVS_CDROM, | 
|---|
|  | 911 | ((driveflags[drive] & DRIVE_CDROM) != 0)); | 
|---|
|  | 912 | WinCheckButton(hwnd, DVS_NOLONGNAMES, | 
|---|
|  | 913 | ((driveflags[drive] & DRIVE_NOLONGNAMES) != 0)); | 
|---|
|  | 914 | WinCheckButton(hwnd, DVS_REMOTE, | 
|---|
|  | 915 | ((driveflags[drive] & DRIVE_REMOTE) != 0)); | 
|---|
| [552] | 916 | WinCheckButton(hwnd,DVS_VIRTUAL, | 
|---|
| [575] | 917 | ((driveflags[drive] & DRIVE_VIRTUAL) != 0)); | 
|---|
| [552] | 918 | WinCheckButton(hwnd,DVS_RAMDISK, | 
|---|
| [575] | 919 | ((driveflags[drive] & DRIVE_RAMDISK) != 0)); | 
|---|
| [552] | 920 | WinCheckButton(hwnd, DVS_BOOT, | 
|---|
| [575] | 921 | ((driveflags[drive] & DRIVE_BOOT) != 0)); | 
|---|
| [551] | 922 | WinCheckButton(hwnd, DVS_INVALID, | 
|---|
|  | 923 | ((driveflags[drive] & DRIVE_INVALID) != 0)); | 
|---|
|  | 924 | WinCheckButton(hwnd, DVS_NOPRESCAN, | 
|---|
|  | 925 | ((driveflags[drive] & DRIVE_NOPRESCAN) != 0)); | 
|---|
|  | 926 | WinCheckButton(hwnd, DVS_ZIPSTREAM, | 
|---|
|  | 927 | ((driveflags[drive] & DRIVE_ZIPSTREAM) != 0)); | 
|---|
|  | 928 | WinCheckButton(hwnd, DVS_NOLOADICONS, | 
|---|
|  | 929 | ((driveflags[drive] & DRIVE_NOLOADICONS) != 0)); | 
|---|
|  | 930 | WinCheckButton(hwnd, DVS_NOLOADSUBJS, | 
|---|
|  | 931 | ((driveflags[drive] & DRIVE_NOLOADSUBJS) != 0)); | 
|---|
|  | 932 | WinCheckButton(hwnd, DVS_NOLOADLONGS, | 
|---|
|  | 933 | ((driveflags[drive] & DRIVE_NOLOADLONGS) != 0)); | 
|---|
|  | 934 | WinCheckButton(hwnd, DVS_SLOW, ((driveflags[drive] & DRIVE_SLOW) != 0)); | 
|---|
|  | 935 | WinCheckButton(hwnd, DVS_INCLUDEFILES, | 
|---|
|  | 936 | ((driveflags[drive] & DRIVE_INCLUDEFILES) != 0)); | 
|---|
| [552] | 937 | WinCheckButton(hwnd,DVS_NOSTATS, | 
|---|
| [575] | 938 | ((driveflags[drive] & DRIVE_NOSTATS) != 0)); | 
|---|
| [551] | 939 | } | 
|---|
|  | 940 | return 0; | 
|---|
| [2] | 941 |  | 
|---|
| [551] | 942 | case WM_CONTROL: | 
|---|
|  | 943 | return 0; | 
|---|
| [2] | 944 |  | 
|---|
| [551] | 945 | case WM_COMMAND: | 
|---|
|  | 946 | switch (SHORT1FROMMP(mp1)) { | 
|---|
|  | 947 | case DID_OK: | 
|---|
|  | 948 | { | 
|---|
|  | 949 | ULONG drive = WinQueryWindowULong(hwnd, QWL_USER); | 
|---|
| [2] | 950 |  | 
|---|
| [551] | 951 | if (WinQueryButtonCheckstate(hwnd, DVS_NOPRESCAN)) | 
|---|
|  | 952 | driveflags[drive] |= DRIVE_NOPRESCAN; | 
|---|
|  | 953 | else | 
|---|
|  | 954 | driveflags[drive] &= (~DRIVE_NOPRESCAN); | 
|---|
|  | 955 | if (WinQueryButtonCheckstate(hwnd, DVS_NOLOADICONS)) | 
|---|
|  | 956 | driveflags[drive] |= DRIVE_NOLOADICONS; | 
|---|
|  | 957 | else | 
|---|
|  | 958 | driveflags[drive] &= (~DRIVE_NOLOADICONS); | 
|---|
|  | 959 | if (WinQueryButtonCheckstate(hwnd, DVS_NOLOADSUBJS)) | 
|---|
|  | 960 | driveflags[drive] |= DRIVE_NOLOADSUBJS; | 
|---|
|  | 961 | else | 
|---|
|  | 962 | driveflags[drive] &= (~DRIVE_NOLOADSUBJS); | 
|---|
|  | 963 | if (WinQueryButtonCheckstate(hwnd, DVS_NOLOADLONGS)) | 
|---|
|  | 964 | driveflags[drive] |= DRIVE_NOLOADLONGS; | 
|---|
|  | 965 | else | 
|---|
|  | 966 | driveflags[drive] &= (~DRIVE_NOLOADLONGS); | 
|---|
|  | 967 | if (WinQueryButtonCheckstate(hwnd, DVS_SLOW)) | 
|---|
|  | 968 | driveflags[drive] |= DRIVE_SLOW; | 
|---|
|  | 969 | else | 
|---|
|  | 970 | driveflags[drive] &= (~DRIVE_SLOW); | 
|---|
|  | 971 | if (WinQueryButtonCheckstate(hwnd, DVS_INCLUDEFILES)) | 
|---|
|  | 972 | driveflags[drive] |= DRIVE_INCLUDEFILES; | 
|---|
|  | 973 | else | 
|---|
|  | 974 | driveflags[drive] &= (~DRIVE_INCLUDEFILES); | 
|---|
| [575] | 975 | if (WinQueryButtonCheckstate(hwnd,DVS_NOSTATS)) | 
|---|
|  | 976 | driveflags[drive] |= DRIVE_NOSTATS; | 
|---|
|  | 977 | else | 
|---|
|  | 978 | driveflags[drive] &= (~DRIVE_NOSTATS); | 
|---|
| [551] | 979 | { | 
|---|
|  | 980 | ULONG flags; | 
|---|
|  | 981 | CHAR s[80]; | 
|---|
| [2] | 982 |  | 
|---|
| [551] | 983 | sprintf(s, "%c.DriveFlags", (CHAR) (drive + 'A')); | 
|---|
|  | 984 | flags = driveflags[drive]; | 
|---|
|  | 985 | flags &= (~(DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE | | 
|---|
|  | 986 | DRIVE_IGNORE | DRIVE_CDROM | | 
|---|
|  | 987 | DRIVE_NOLONGNAMES | DRIVE_REMOTE | | 
|---|
| [575] | 988 | DRIVE_BOOT | DRIVE_INVALID | DRIVE_ZIPSTREAM | | 
|---|
|  | 989 | DRIVE_VIRTUAL  | DRIVE_RAMDISK)); | 
|---|
| [551] | 990 | PrfWriteProfileData(fmprof, appname, s, &flags, sizeof(ULONG)); | 
|---|
|  | 991 | } | 
|---|
|  | 992 | } | 
|---|
|  | 993 | WinDismissDlg(hwnd, 1); | 
|---|
|  | 994 | break; | 
|---|
| [2] | 995 |  | 
|---|
| [551] | 996 | case DID_CANCEL: | 
|---|
|  | 997 | WinDismissDlg(hwnd, 0); | 
|---|
|  | 998 | break; | 
|---|
| [2] | 999 |  | 
|---|
| [551] | 1000 | case IDM_UNDO: | 
|---|
|  | 1001 | PostMsg(hwnd, UM_UNDO, MPVOID, MPVOID); | 
|---|
|  | 1002 | break; | 
|---|
| [2] | 1003 |  | 
|---|
| [551] | 1004 | case IDM_HELP: | 
|---|
|  | 1005 | if (hwndHelp) | 
|---|
|  | 1006 | WinSendMsg(hwndHelp, | 
|---|
|  | 1007 | HM_DISPLAY_HELP, | 
|---|
|  | 1008 | MPFROM2SHORT(HELP_FLAGS, 0), MPFROMSHORT(HM_RESOURCEID)); | 
|---|
|  | 1009 | break; | 
|---|
|  | 1010 | } | 
|---|
|  | 1011 | return 0; | 
|---|
| [2] | 1012 | } | 
|---|
| [551] | 1013 | return WinDefDlgProc(hwnd, msg, mp1, mp2); | 
|---|
| [2] | 1014 | } | 
|---|