# TARGTYPE "Win32 (x86) External Target" 0x0106
-CFG=make_explorer - Win32 bjam
+CFG=make_explorer - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
-!MESSAGE NMAKE /f "make_explorer.mak" CFG="make_explorer - Win32 bjam"
+!MESSAGE NMAKE /f "make_explorer.mak" CFG="make_explorer - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "URelease"
# PROP Intermediate_Dir "URelease"
-# PROP Cmd_Line "msdevfilt -gcc -pipe "perl d:\tools\gSTLFilt.pl" make -f Makefile.MinGW UNICODE=1"
+# PROP Cmd_Line "make -f Makefile.MinGW UNICODE=1"
# PROP Rebuild_Opt "clean all"
# PROP Target_File "explorer.exe"
# PROP Bsc_Name ""
#include "winfs.h"
-int ScanNTFSStreams(Entry* entry, HANDLE hFile)
-{
- PVOID ctx = 0;
- DWORD read, seek_high;
- Entry** pnext = &entry->_down;
- int cnt = 0;
-
- for(;;) {
- struct NTFS_StreamHdr : public WIN32_STREAM_ID {
- WCHAR name_padding[_MAX_FNAME]; // room for reading stream name
- } hdr;
-
- if (!BackupRead(hFile, (LPBYTE)&hdr, (LPBYTE)&hdr.cStreamName-(LPBYTE)&hdr, &read, FALSE, FALSE, &ctx) ||
- (long)read!=(LPBYTE)&hdr.cStreamName-(LPBYTE)&hdr)
- break;
-
- if (hdr.dwStreamId == BACKUP_ALTERNATE_DATA) {
- if (hdr.dwStreamNameSize &&
- BackupRead(hFile, (LPBYTE)hdr.cStreamName, hdr.dwStreamNameSize, &read, FALSE, FALSE, &ctx) &&
- read==hdr.dwStreamNameSize)
- {
- ++cnt;
-
- int l = hdr.dwStreamNameSize / sizeof(WCHAR);
- LPCWSTR p = hdr.cStreamName;
- LPCWSTR e = hdr.cStreamName + l;
-
- if (l>0 && *p==':') {
- ++p, --l;
-
- e = p;
-
- while(l>0 && *e!=':')
- ++e, --l;
-
- l = e - p;
- }
-
- Entry* stream_entry = new WinEntry(entry);
-
- memcpy(&stream_entry->_data, &entry->_data, sizeof(WIN32_FIND_DATA));
- lstrcpy(stream_entry->_data.cFileName, String(p, l));
-
- stream_entry->_down = NULL;
- stream_entry->_expanded = false;
- stream_entry->_scanned = false;
- stream_entry->_level = entry->_level + 1;
-
- *pnext = stream_entry;
- pnext = &stream_entry->_next;
- }
- }
-
- // jump to the next stream header
- if (!BackupSeek(hFile, ~0, ~0, &read, &seek_high, &ctx)) {
- DWORD error = GetLastError();
-
- if (error != ERROR_SEEK) {
- BackupRead(hFile, 0, 0, &read, TRUE, FALSE, &ctx); // terminate BackupRead() loop
- THROW_EXCEPTION(error);
- //break;
- }
-
- hdr.Size.QuadPart -= read;
- hdr.Size.HighPart -= seek_high;
-
- BYTE buffer[4096];
-
- while(hdr.Size.QuadPart > 0) {
- if (!BackupRead(hFile, buffer, sizeof(buffer), &read, FALSE, FALSE, &ctx) || read!=sizeof(buffer))
- break;
-
- hdr.Size.QuadPart -= read;
- }
- }
- }
-
- if (ctx)
- if (!BackupRead(hFile, 0, 0, &read, TRUE, FALSE, &ctx)) // terminate BackupRead() loop
- THROW_EXCEPTION(GetLastError());
-
- return cnt;
-}
-
-
void WinDirectory::read_directory(int scan_flags)
{
CONTEXT("WinDirectory::read_directory()");
if (GetFileInformationByHandle(hFile, &entry->_bhfi))
entry->_bhfi_valid = true;
- if (ScanNTFSStreams(entry, hFile))
- entry->_scanned = true; // There exist named NTFS sub-streams in this file.
-
CloseHandle(hFile);
}
}
memcpy(path+1, name, l*sizeof(TCHAR));
len += l+1;
- if (entry->_up && !(entry->_up->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) // a NTFS stream?
- path[0] = TEXT(':');
- else
- path[0] = TEXT('\\');
+ path[0] = TEXT('\\');
}
entry = entry->_up;