diff --git a/setter/.idea/codeStyles/Project.xml b/setter/.idea/codeStyles/Project.xml
index 30aa626..521ebb5 100644
--- a/setter/.idea/codeStyles/Project.xml
+++ b/setter/.idea/codeStyles/Project.xml
@@ -11,19 +11,9 @@
+
+
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/setter/.idea/codeStyles/codeStyleConfig.xml b/setter/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..a55e7a1
--- /dev/null
+++ b/setter/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/setter/.idea/encodings.xml b/setter/.idea/encodings.xml
new file mode 100644
index 0000000..15a15b2
--- /dev/null
+++ b/setter/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/setter/.idea/vcs.xml b/setter/.idea/vcs.xml
index b2bdec2..6c0b863 100644
--- a/setter/.idea/vcs.xml
+++ b/setter/.idea/vcs.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/setter/CMakeLists.txt b/setter/CMakeLists.txt
index 0e7d232..61fad76 100644
--- a/setter/CMakeLists.txt
+++ b/setter/CMakeLists.txt
@@ -3,4 +3,4 @@ project(setter C)
set(CMAKE_C_STANDARD 90)
-add_executable(setter consts.h defs.h main.h dosos2.h os2_16.h os2_32.h main.c dos.c os2_16.c os2_32.c win32.c unix.c macos.c macos.h)
\ No newline at end of file
+add_executable(setter consts.h defs.h main.h dosos2.h os2_16.h os2_32.h main.c dos.c os2_16.c os2_32.c win32.c win32.h unix.c macos.c macos.h)
\ No newline at end of file
diff --git a/setter/binaries/fssetter.win32.x86.exe b/setter/binaries/fssetter.win32.x86.exe
new file mode 100644
index 0000000..3c8e0ef
Binary files /dev/null and b/setter/binaries/fssetter.win32.x86.exe differ
diff --git a/setter/win32.c b/setter/win32.c
index ba7c019..b5baa2d 100644
--- a/setter/win32.c
+++ b/setter/win32.c
@@ -5,7 +5,7 @@ The Disc Image Chef
Filename : win32.c
Author(s) : Natalia Portillo
-Component : fstester.setter.os2
+Component : fstester.setter.win32
--[ Description ] -----------------------------------------------------------
@@ -32,22 +32,2216 @@ Copyright (C) 2011-2018 Natalia Portillo
#if defined(__WINDOWS__) || defined (__TOS_WIN__) || defined (__WIN32__) || defined (_WIN64) || defined (_WIN32) || defined (__NT__)
#include
+#include
+#include
+#include
#include "defs.h"
+#include "consts.h"
+#include "win32.h"
void GetOsInfo()
{
- // TODO: Implement
+ OSVERSIONINFO verInfo;
+ BOOL ret;
+ DWORD error;
+
+ verInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ ret = GetVersionEx(&verInfo);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d querying Windows version.\n", error);
+ return;
+ }
+
+ printf("OS information:\n");
+
+ if(verInfo.dwPlatformId == VER_PLATFORM_WIN32s)
+ {
+ printf("\tRunning under Windows %d.%d using Win32s.\n", verInfo.dwMajorVersion, verInfo.dwMinorVersion);
+ }
+ else if(verInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS)
+ {
+ if(verInfo.dwMinorVersion == 10)
+ {
+ if(verInfo.dwBuildNumber == 2222)
+ {
+ printf("\tRunning under Windows 98 SE");
+ }
+ else
+ {
+ printf("\tRunning under Windows 98");
+ }
+ }
+ else if(verInfo.dwMinorVersion == 90)
+ {
+ printf("\tRunning under Windows Me");
+ }
+ else if(verInfo.dwMinorVersion < 10)
+ {
+ printf("\tRunning under Windows 95");
+ }
+ else
+ {
+ printf("\tRunning under Windows");
+ }
+
+ if(verInfo.dwBuildNumber > 0)
+ {
+ if(strlen(verInfo.szCSDVersion) > 0)
+ {
+ printf(" version %d.%02d.%d %s.\n", verInfo.dwMajorVersion, verInfo.dwMinorVersion, verInfo.dwBuildNumber, verInfo.szCSDVersion);
+ }
+ else
+ {
+ printf(" version %d.%02d.%d.\n", verInfo.dwMajorVersion, verInfo.dwMinorVersion, verInfo.dwBuildNumber);
+ }
+ }
+ else
+ {
+ if(strlen(verInfo.szCSDVersion) > 0)
+ {
+ printf(" version %d.%02d %s.\n", verInfo.dwMajorVersion, verInfo.dwMinorVersion, verInfo.szCSDVersion);
+ }
+ else
+ {
+ printf(" version %d.%02d.\n", verInfo.dwMajorVersion, verInfo.dwMinorVersion);
+ }
+ }
+ }
+ else if(verInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
+ {
+ switch(verInfo.dwMajorVersion)
+ {
+ case 5:
+ switch(verInfo.dwMinorVersion)
+ {
+ case 0:
+ printf("\tRunning under Windows 2000");
+ break;
+ case 1:
+ printf("\tRunning under Windows XP");
+ break;
+ case 2:
+ printf("\tRunning under Windows Server 2003");
+ break;
+ default:
+ printf("\tRunning under Windows NT");
+ }
+ break;
+ case 6:
+ switch(verInfo.dwMinorVersion)
+ {
+ case 0:
+ printf("\tRunning under Windows Vista");
+ break;
+ case 1:
+ printf("\tRunning under Windows 7");
+ break;
+ case 2:
+ printf("\tRunning under Windows 8");
+ break;
+ case 3:
+ printf("\tRunning under Windows 8.1");
+ break;
+ default:
+ printf("\tRunning under Windows NT");
+ break;
+ }
+ break;
+ case 10:
+ printf("\tRunning under Windows 10");
+ break;
+ default:
+ printf("\tRunning under Windows NT");
+ break;
+ }
+
+ if(verInfo.dwMinorVersion < 10)
+ {
+ verInfo.dwMinorVersion = verInfo.dwMinorVersion * 10;
+ }
+
+ if(verInfo.dwBuildNumber > 0)
+ {
+ if(strlen(verInfo.szCSDVersion) > 0)
+ {
+ printf(" version %d.%02d.%d %s.\n", verInfo.dwMajorVersion, verInfo.dwMinorVersion, verInfo.dwBuildNumber, verInfo.szCSDVersion);
+ }
+ else
+ {
+ printf(" version %d.%02d.%d.\n", verInfo.dwMajorVersion, verInfo.dwMinorVersion, verInfo.dwBuildNumber);
+ }
+ }
+ else
+ {
+ if(strlen(verInfo.szCSDVersion) > 0)
+ {
+ printf(" version %d.%02d %s.\n", verInfo.dwMajorVersion, verInfo.dwMinorVersion, verInfo.szCSDVersion);
+ }
+ else
+ {
+ printf(" version %d.%02d.\n", verInfo.dwMajorVersion, verInfo.dwMinorVersion);
+ }
+ }
+ }
}
void GetVolumeInfo(const char *path, size_t *clusterSize)
{
- // TODO: Implement
+ BOOL ret;
+ DWORD error;
+ LPTSTR lpVolumeNameBuffer;
+ DWORD dwMaximumComponentLength;
+ DWORD dwFileSystemFlags;
+ DWORD dwMaxNameSize = MAX_PATH + 1;
+ LPTSTR lpFileSystemNameBuffer;
+ LPTSTR lpRootPathName;
+ size_t pathSize = strlen(path);
+ DWORD dwSectorsPerCluster;
+ DWORD dwBytesPerSector;
+ DWORD dwNumberOfFreeClusters;
+ DWORD dwTotalNumberOfClusters;
+ OSVERSIONINFO verInfo;
+ ULARGE_INTEGER qwFreeBytesAvailableToCaller;
+ ULARGE_INTEGER qwTotalNumberOfBytes;
+ ULARGE_INTEGER qwTotalNumberOfFreeBytes;
+
+ *clusterSize = 0;
+
+ printf("Volume information:\n");
+ printf("\tPath: %s\n", path);
+
+ lpVolumeNameBuffer = malloc(dwMaxNameSize);
+
+ if(lpVolumeNameBuffer == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ return;
+ }
+
+ lpFileSystemNameBuffer = malloc(dwMaxNameSize);
+
+ if(lpFileSystemNameBuffer == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ free(lpVolumeNameBuffer);
+ return;
+ }
+
+ lpRootPathName = malloc(dwMaxNameSize);
+
+ if(lpRootPathName == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ free(lpVolumeNameBuffer);
+ free(lpFileSystemNameBuffer);
+ return;
+ }
+
+ memset(lpRootPathName, 0x00, MAX_PATH);
+ strcpy(lpRootPathName, path);
+
+ if(path[pathSize - 1] != '\\')
+ {
+ lpRootPathName[pathSize] = '\\';
+ }
+
+ ret = GetVolumeInformation(lpRootPathName, lpVolumeNameBuffer, dwMaxNameSize, NULL, &dwMaximumComponentLength, &dwFileSystemFlags, lpFileSystemNameBuffer, dwMaxNameSize);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d querying volume information.\n", error);
+ free(lpVolumeNameBuffer);
+ free(lpFileSystemNameBuffer);
+ free(lpRootPathName);
+ return;
+ }
+
+ printf("\tFilesystem: %s\n", lpFileSystemNameBuffer);
+ printf("\tVolume name: %s\n", lpVolumeNameBuffer);
+ printf("\tMaximum component size: %d\n", dwMaximumComponentLength);
+
+ if(dwFileSystemFlags > 0)
+ {
+ printf("\tFlags:\n");
+
+ if(dwFileSystemFlags & FILE_CASE_PRESERVED_NAMES)
+ {
+ printf("\t\tVolume preserves file name case.\n");
+ dwFileSystemFlags -= FILE_CASE_PRESERVED_NAMES;
+ }
+
+ if(dwFileSystemFlags & FILE_CASE_SENSITIVE_SEARCH)
+ {
+ printf("\t\tVolume supports case sensitiveness.\n");
+ dwFileSystemFlags -= FILE_CASE_SENSITIVE_SEARCH;
+ }
+
+ if(dwFileSystemFlags & FILE_DAX_VOLUME)
+ {
+ printf("\t\tDirect access volume.\n");
+ dwFileSystemFlags -= FILE_DAX_VOLUME;
+ }
+
+ if(dwFileSystemFlags & FILE_FILE_COMPRESSION)
+ {
+ printf("\t\tVolume supports per-file compression.\n");
+ dwFileSystemFlags -= FILE_FILE_COMPRESSION;
+ }
+
+ if(dwFileSystemFlags & FILE_NAMED_STREAMS)
+ {
+ printf("\t\tVolume supports Alternate Data Streams.\n");
+ dwFileSystemFlags -= FILE_NAMED_STREAMS;
+ }
+
+ if(dwFileSystemFlags & FILE_PERSISTENT_ACLS)
+ {
+ printf("\t\tVolume supports persistent Access Control Lists.\n");
+ dwFileSystemFlags -= FILE_PERSISTENT_ACLS;
+ }
+
+ if(dwFileSystemFlags & FILE_READ_ONLY_VOLUME)
+ {
+ printf("\t\tVolume is read-only.\n");
+ dwFileSystemFlags -= FILE_READ_ONLY_VOLUME;
+ }
+
+ if(dwFileSystemFlags & FILE_SEQUENTIAL_WRITE_ONCE)
+ {
+ printf("\t\tVolume supports a single sequential write.\n");
+ dwFileSystemFlags -= FILE_SEQUENTIAL_WRITE_ONCE;
+ }
+
+ if(dwFileSystemFlags & FILE_SUPPORTS_ENCRYPTION)
+ {
+ printf("\t\tVolume supports per-file encryption.\n");
+ dwFileSystemFlags -= FILE_SUPPORTS_ENCRYPTION;
+ }
+
+ if(dwFileSystemFlags & FILE_SUPPORTS_EXTENDED_ATTRIBUTES)
+ {
+ printf("\t\tVolume supports extended attributes.\n");
+ dwFileSystemFlags -= FILE_SUPPORTS_EXTENDED_ATTRIBUTES;
+ }
+
+ if(dwFileSystemFlags & FILE_SUPPORTS_HARD_LINKS)
+ {
+ printf("\t\tVolume supports hard links.\n");
+ dwFileSystemFlags -= FILE_SUPPORTS_HARD_LINKS;
+ }
+
+ if(dwFileSystemFlags & FILE_SUPPORTS_OBJECT_IDS)
+ {
+ printf("\t\tVolume supports object IDs.\n");
+ dwFileSystemFlags -= FILE_SUPPORTS_OBJECT_IDS;
+ }
+
+ if(dwFileSystemFlags & FILE_SUPPORTS_OPEN_BY_FILE_ID)
+ {
+ printf("\t\tVolume can open files by ID.\n");
+ dwFileSystemFlags -= FILE_SUPPORTS_OPEN_BY_FILE_ID;
+ }
+
+ if(dwFileSystemFlags & FILE_SUPPORTS_REPARSE_POINTS)
+ {
+ printf("\t\tVolume supports reparse points.\n");
+ dwFileSystemFlags -= FILE_SUPPORTS_REPARSE_POINTS;
+ }
+
+ if(dwFileSystemFlags & FILE_SUPPORTS_SPARSE_FILES)
+ {
+ printf("\t\tVolume supports sparse files.\n");
+ dwFileSystemFlags -= FILE_SUPPORTS_SPARSE_FILES;
+ }
+
+ if(dwFileSystemFlags & FILE_SUPPORTS_TRANSACTIONS)
+ {
+ printf("\t\tVolume supports transactions.\n");
+ dwFileSystemFlags -= FILE_SUPPORTS_TRANSACTIONS;
+ }
+
+ if(dwFileSystemFlags & FILE_SUPPORTS_USN_JOURNAL)
+ {
+ printf("\t\tVolume has an USN journal.\n");
+ dwFileSystemFlags -= FILE_SUPPORTS_USN_JOURNAL;
+ }
+
+ if(dwFileSystemFlags & FILE_UNICODE_ON_DISK)
+ {
+ printf("\t\tVolume stores filenames as Unicode.\n");
+ dwFileSystemFlags -= FILE_UNICODE_ON_DISK;
+ }
+
+ if(dwFileSystemFlags & FILE_VOLUME_IS_COMPRESSED)
+ {
+ printf("\t\tVolume is compressed.\n");
+ dwFileSystemFlags -= FILE_VOLUME_IS_COMPRESSED;
+ }
+
+ if(dwFileSystemFlags & FILE_VOLUME_QUOTAS)
+ {
+ printf("\t\tVolume supports user quotas.\n");
+ dwFileSystemFlags -= FILE_VOLUME_QUOTAS;
+ }
+
+ if(dwFileSystemFlags > 0)
+ {
+ printf("Unknown flags: 0x%08x.\n", dwFileSystemFlags);
+ }
+ }
+
+ free(lpVolumeNameBuffer);
+ free(lpFileSystemNameBuffer);
+
+ ret=GetDiskFreeSpace(lpRootPathName, &dwSectorsPerCluster, &dwBytesPerSector, &dwNumberOfFreeClusters, &dwTotalNumberOfClusters);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d querying volume space.\n", error);
+ free(lpRootPathName);
+ return;
+ }
+
+ *clusterSize = dwSectorsPerCluster*dwBytesPerSector;
+ printf("\tBytes per sector: %u\n", dwBytesPerSector);
+ printf("\tSectors per cluster: %u (%u bytes)\n", dwSectorsPerCluster, *clusterSize);
+
+ verInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ ret = GetVersionEx(&verInfo);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d querying Windows version.\n", error);
+ free(lpRootPathName);
+ return;
+ }
+
+ if((verInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS && verInfo.dwBuildNumber >= 1000) ||
+ verInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
+ {
+ ret = GetDiskFreeSpaceEx(lpRootPathName, &qwFreeBytesAvailableToCaller, &qwTotalNumberOfBytes, &qwTotalNumberOfFreeBytes);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d querying extended volume space.\n", error);
+ free(lpRootPathName);
+ return;
+ }
+
+ printf("\tVolume size: %Lu bytes\n", qwTotalNumberOfBytes);
+ printf("\tVolume free: %Lu bytes\n", qwTotalNumberOfFreeBytes);
+ }
+ else
+ {
+ qwTotalNumberOfBytes.QuadPart = dwTotalNumberOfClusters;
+ qwTotalNumberOfFreeBytes.QuadPart = dwNumberOfFreeClusters;
+ qwTotalNumberOfBytes.QuadPart *= *clusterSize;
+ qwTotalNumberOfFreeBytes.QuadPart *= *clusterSize;
+
+ printf("\tClusters: %lu (%Lu bytes)\n", dwTotalNumberOfClusters, qwTotalNumberOfBytes);
+ printf("\tFree clusters: %lu (%Lu bytes)\n", dwNumberOfFreeClusters, qwTotalNumberOfFreeBytes);
+ }
+
+ free(lpRootPathName);
}
void FileAttributes(const char *path)
{
- // TODO: Implement
+ BOOL ret;
+ DWORD error;
+ LPTSTR lpRootPathName;
+ DWORD dwMaxNameSize = MAX_PATH + 1;
+ size_t pathSize = strlen(path);
+ HANDLE h;
+ DWORD dwNumberOfBytesWritten;
+ DWORD rc, wRc, cRc;
+ OSVERSIONINFO verInfo;
+ DWORD defaultCompression = COMPRESSION_FORMAT_DEFAULT;
+
+ lpRootPathName = malloc(dwMaxNameSize);
+
+ if(lpRootPathName == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ return;
+ }
+
+ memset(lpRootPathName, 0x00, MAX_PATH);
+ strcpy(lpRootPathName, path);
+
+ if(path[pathSize - 1] != '\\')
+ {
+ lpRootPathName[pathSize] = '\\';
+ }
+
+ ret = SetCurrentDirectory(lpRootPathName);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to specified path.\n", error);
+ return;
+ }
+
+ ret = CreateDirectory("ATTRS", NULL);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d creating working directory.\n", error);
+ return;
+ }
+
+ ret = SetCurrentDirectory("ATTRS");
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to working directory.\n", error);
+ return;
+ }
+
+ verInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ ret = GetVersionEx(&verInfo);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d querying Windows version.\n", error);
+ free(lpRootPathName);
+ return;
+ }
+
+ printf("Creating attributes files.\n");
+
+ h = CreateFile("NONE", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)noAttributeText, strlen(noAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with no attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "NONE", rc, wRc, cRc);
+
+ h = CreateFile("ARCHIVE", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_ARCHIVE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with archived attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "ARCHIVE", rc, wRc, cRc);
+
+ h = CreateFile("ENCRYPT", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_ENCRYPTED, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "ENCRYPT", rc, wRc, cRc);
+
+ h = CreateFile("HIDDEN", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with hidden attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "HIDDEN", rc, wRc, cRc);
+
+ h = CreateFile("OFFLINE", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_OFFLINE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "OFFLINE", rc, wRc, cRc);
+
+ h = CreateFile("READONLY", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with read-only attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "READONLY", rc, wRc, cRc);
+
+ h = CreateFile("SYSTEM", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_SYSTEM, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)systemAttributeText, strlen(systemAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with system attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "SYSTEM", rc, wRc, cRc);
+
+ h = CreateFile("TEMPORAR", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tTemporary file: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TEMPORAR", rc, wRc, cRc);
+
+ h = CreateFile("EA", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_ENCRYPTED | FILE_ATTRIBUTE_ARCHIVE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with archived attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "EA", rc, wRc, cRc);
+
+ h = CreateFile("HA", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_ARCHIVE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with hidden and archived attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "HA", rc, wRc, cRc);
+
+ h = CreateFile("OA", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_ARCHIVE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with archived attribute is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "OA", rc, wRc, cRc);
+
+ h = CreateFile("RA", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_ARCHIVE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with read-only and archived attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "RA", rc, wRc, cRc);
+
+ h = CreateFile("SA", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_ARCHIVE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)systemAttributeText, strlen(systemAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with system and archived attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "SA", rc, wRc, cRc);
+
+ h = CreateFile("TA", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_ARCHIVE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tTemporary file with archived attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TA", rc, wRc, cRc);
+
+ h = CreateFile("HE", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_ENCRYPTED, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with hidden attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "HE", rc, wRc, cRc);
+
+ h = CreateFile("OE", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_ENCRYPTED, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "OE", rc, wRc, cRc);
+
+ h = CreateFile("RE", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_ENCRYPTED, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with read-only attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "REREADONLY", rc, wRc, cRc);
+
+ h = CreateFile("TE", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_ENCRYPTED, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted temporary file: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TE", rc, wRc, cRc);
+
+ h = CreateFile("OH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_HIDDEN, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with hidden attribute that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "OH", rc, wRc, cRc);
+
+ h = CreateFile("RH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with system and read-only attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "RH", rc, wRc, cRc);
+
+ h = CreateFile("SH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)systemAttributeText, strlen(systemAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with system and hidden attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "SH", rc, wRc, cRc);
+
+ h = CreateFile("TH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_HIDDEN, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tTemporary file with hidden attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TH", rc, wRc, cRc);
+
+ h = CreateFile("RO", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_OFFLINE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with read-only attribute that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "RO", rc, wRc, cRc);
+
+ h = CreateFile("SO", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_OFFLINE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)systemAttributeText, strlen(systemAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with system attribute that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "SO", rc, wRc, cRc);
+
+ h = CreateFile("TO", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_OFFLINE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tTemporary file that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TO", rc, wRc, cRc);
+
+ h = CreateFile("SR", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_READONLY, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)systemAttributeText, strlen(systemAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with system and read-only attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "SR", rc, wRc, cRc);
+
+ h = CreateFile("TR", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_READONLY, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tTemporary file with read-only attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TR", rc, wRc, cRc);
+
+ h = CreateFile("ST", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_TEMPORARY, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)systemAttributeText, strlen(systemAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tTemporary file with system attribute: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "ST", rc, wRc, cRc);
+
+ h = CreateFile("HAE", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_ENCRYPTED, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with hiden and archive attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "HAE", rc, wRc, cRc);
+
+ h = CreateFile("OAE", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_ENCRYPTED, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with archive attribute that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "OAE", rc, wRc, cRc);
+
+ h = CreateFile("RAE", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_ENCRYPTED, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with archive and read-only attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "RAE", rc, wRc, cRc);
+
+ h = CreateFile("TAE", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_ENCRYPTED, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with archive attribute that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TAE", rc, wRc, cRc);
+
+ h = CreateFile("OAH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_HIDDEN, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with archive and hidden attributes that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "OAH", rc, wRc, cRc);
+
+ h = CreateFile("RAH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_HIDDEN, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with read-only, hidden and archive attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "RAH", rc, wRc, cRc);
+
+ h = CreateFile("SAH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_HIDDEN, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)systemAttributeText, strlen(systemAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with system, archive and hidden attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "SAH", rc, wRc, cRc);
+
+ h = CreateFile("TAH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_HIDDEN, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tTemporary file with archive and hidden attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TAH", rc, wRc, cRc);
+
+ h = CreateFile("EAO", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_ENCRYPTED | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_OFFLINE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(systemAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with archive attribute that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "EAO", rc, wRc, cRc);
+
+ h = CreateFile("RAO", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_OFFLINE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with read-only and archive attributes that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "RAO", rc, wRc, cRc);
+
+ h = CreateFile("SAO", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_OFFLINE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)systemAttributeText, strlen(systemAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with system and archive attributes that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "SAO", rc, wRc, cRc);
+
+ h = CreateFile("TAO", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_OFFLINE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tTemporary file with archive attribute that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TAO", rc, wRc, cRc);
+
+ h = CreateFile("EAR", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_ENCRYPTED | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_READONLY, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText ), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with archive and read-only attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "EAR", rc, wRc, cRc);
+
+ h = CreateFile("OAR", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_READONLY, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with read-only and archive attributes that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "OAR", rc, wRc, cRc);
+
+ h = CreateFile("TAR", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_READONLY, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tTemporary file with archive and read-only attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TAR", rc, wRc, cRc);
+
+ h = CreateFile("TAS", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_SYSTEM, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)systemAttributeText, strlen(systemAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tTemporary file with archive and system attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TAS", rc, wRc, cRc);
+
+ h = CreateFile("OAEH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_OFFLINE |FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_ENCRYPTED| FILE_ATTRIBUTE_HIDDEN, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with archive and hidden attributes that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "OAEH", rc, wRc, cRc);
+
+ h = CreateFile("RAEH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY |FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_ENCRYPTED| FILE_ATTRIBUTE_HIDDEN, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with read-only, archive and hidden attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "RAEH", rc, wRc, cRc);
+
+ h = CreateFile("TAEH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY |FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_ENCRYPTED| FILE_ATTRIBUTE_HIDDEN, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText ), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted temporary file with hidden and archive attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TAEH", rc, wRc, cRc);
+
+ h = CreateFile("RAEO", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY| FILE_ATTRIBUTE_ARCHIVE| FILE_ATTRIBUTE_ENCRYPTED | FILE_ATTRIBUTE_OFFLINE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with read-only and archive attributes that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "RAEO", rc, wRc, cRc);
+
+ h = CreateFile("TAEO", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY| FILE_ATTRIBUTE_ARCHIVE| FILE_ATTRIBUTE_ENCRYPTED | FILE_ATTRIBUTE_OFFLINE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted temporary file with archive attribute that is available offline: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TAEO", rc, wRc, cRc);
+
+ h = CreateFile("TAER", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY|FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_ENCRYPTED | FILE_ATTRIBUTE_READONLY, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted temporary file with archive and read-only attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TAER", rc, wRc, cRc);
+
+ h = CreateFile("RAEH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_ENCRYPTED|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_OFFLINE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted file with read-only, archive and hidden attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "RAEH", rc, wRc, cRc);
+
+ h = CreateFile("TAEH", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_TEMPORARY|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_ENCRYPTED|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_OFFLINE, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)encryptedAttributeText, strlen(encryptedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tEncrypted temporary file with archive and hidden attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TAEH", rc, wRc, cRc);
+
+ h = CreateFile("AHORST", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)archivedAttributeText, strlen(archivedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)hiddenAttributeText, strlen(hiddenAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)offlineAttributeText, strlen(offlineAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)readonlyAttributeText, strlen(readonlyAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)systemAttributeText, strlen(systemAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+ ret = WriteFile(h, (LPCVOID)temporaryAttributeText, strlen(temporaryAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with all attributes: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "AHORST", rc, wRc, cRc);
+
+ if(verInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
+ {
+ h = CreateFile("COMPRESS", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)compressedAttributeText, strlen(compressedAttributeText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = DeviceIoControl(h, FSCTL_SET_COMPRESSION, &defaultCompression, sizeof(DWORD), NULL, 0, &dwNumberOfBytesWritten, NULL);
+
+ if(!ret)
+ {
+ rc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile is compressed: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "COMPRESS", rc, wRc, cRc);
+ }
}
void FilePermissions(const char *path)
@@ -55,54 +2249,2179 @@ void FilePermissions(const char *path)
/* Do nothing, not supported by target operating system */
}
+// TODO: It is not working properly
void ExtendedAttributes(const char *path)
{
- // TODO: Implement
+/*
+ BOOL ret;
+ DWORD error;
+ OSVERSIONINFO verInfo;
+ HINSTANCE ntdll;
+ void *func;
+ DWORD dwNumberOfBytesWritten;
+ DWORD rc, wRc, cRc;
+ char message[300];
+ IO_STATUS_BLOCK eaStatus;
+ HANDLE h;
+ LPTSTR lpRootPathName;
+ DWORD dwMaxNameSize = MAX_PATH + 1;
+ size_t pathSize = strlen(path);
+ PVOID eaData;
+
+ verInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ ret = GetVersionEx(&verInfo);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d querying Windows version.\n", error);
+ return;
+ }
+
+ if(verInfo.dwPlatformId != VER_PLATFORM_WIN32_NT)
+ {
+ // Not supported on Windows 9x
+ return;
+ }
+
+ lpRootPathName = malloc(dwMaxNameSize);
+
+ if(lpRootPathName == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ return;
+ }
+
+ memset(lpRootPathName, 0x00, MAX_PATH);
+ strcpy(lpRootPathName, path);
+
+ if(path[pathSize - 1] != '\\')
+ {
+ lpRootPathName[pathSize] = '\\';
+ }
+
+ ret = SetCurrentDirectory(lpRootPathName);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to specified path.\n", error);
+ return;
+ }
+
+ ret = CreateDirectory("XATTRS", NULL);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d creating working directory.\n", error);
+ return;
+ }
+
+ ret = SetCurrentDirectory("XATTRS");
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to working directory.\n", error);
+ return;
+ }
+
+ ntdll = LoadLibrary("ntdll.dll");
+
+ if(ntdll == NULL)
+ {
+ error = GetLastError();
+ printf("Error %d loading NTDLL.DLL.\n", error);
+ return;
+ }
+
+ func = GetProcAddress(ntdll, "NtSetEaFile");
+
+ if(func == NULL)
+ {
+ error = GetLastError();
+ printf("Error %d finding NtSetEaFile.\n", error);
+ return;
+ }
+
+ NtSetEaFile = func;
+
+ printf("Creating files with extended attributes.\n");
+
+ h = CreateFile("COMMENTS", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf(&message, "This files has an optional .COMMENTS EA\n");
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ eaData = malloc(sizeof(CommentsEA));
+ memcpy(eaData, &CommentsEA, sizeof(CommentsEA));
+
+ rc = NtSetEaFile(h, &eaStatus, eaData, sizeof(CommentsEA));
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(eaData);
+ }
+
+ printf("\tFile with comments = \"%s\", rc = 0x%08x, wRc = %d, cRc = %d\n", "COMMENTS", rc, wRc, cRc);
+
+ h = CreateFile("COMMENTS.CRT", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf(&message, "This files has a critical .COMMENTS EA\n");
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ eaData = malloc(sizeof(CommentsEACritical));
+ memcpy(eaData, &CommentsEACritical, sizeof(CommentsEACritical));
+
+ rc = NtSetEaFile(h, &eaStatus, eaData, sizeof(CommentsEACritical));
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(eaData);
+ }
+
+ printf("\tFile with comments = \"%s\", rc = 0x%08x, wRc = %d, cRc = %d\n", "COMMENTS.CRT", rc, wRc, cRc);
+
+ h = CreateFile("ICON", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf(&message, "This files has an optional .ICON EA\n");
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ eaData = malloc(sizeof(IconEA));
+ memcpy(eaData, &IconEA, sizeof(IconEA));
+
+ rc = NtSetEaFile(h, &eaStatus, eaData, sizeof(IconEA));
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(eaData);
+ }
+
+ printf("\tFile with icon = \"%s\", rc = 0x%08x, wRc = %d, cRc = %d\n", "ICON", rc, wRc, cRc);
+
+ FreeLibrary(ntdll);
+*/
}
void ResourceFork(const char *path)
{
- // TODO: Implement with ADS
+ BOOL ret;
+ DWORD error;
+ LPTSTR lpRootPathName;
+ DWORD dwMaxNameSize = MAX_PATH + 1;
+ size_t pathSize = strlen(path);
+ HANDLE h;
+ DWORD dwNumberOfBytesWritten;
+ DWORD rc, wRc, cRc;
+ OSVERSIONINFO verInfo;
+ int maxLoop, i;
+
+ verInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ ret = GetVersionEx(&verInfo);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d querying Windows version.\n", error);
+ return;
+ }
+
+ if(verInfo.dwPlatformId != VER_PLATFORM_WIN32_NT)
+ {
+ // Not supported on Windows 9x
+ return;
+ }
+
+ lpRootPathName = malloc(dwMaxNameSize);
+
+ if(lpRootPathName == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ return;
+ }
+
+ memset(lpRootPathName, 0x00, MAX_PATH);
+ strcpy(lpRootPathName, path);
+
+ if(path[pathSize - 1] != '\\')
+ {
+ lpRootPathName[pathSize] = '\\';
+ }
+
+ ret = SetCurrentDirectory(lpRootPathName);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to specified path.\n", error);
+ return;
+ }
+
+ ret = CreateDirectory("ADS", NULL);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d creating working directory.\n", error);
+ return;
+ }
+
+ ret = SetCurrentDirectory("ADS");
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to working directory.\n", error);
+ return;
+ }
+
+ printf("Creating alternate data streams.\n");
+
+ h = CreateFile("TINY:ADS", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)tinyAdsText, strlen(tinyAdsText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with tiny alternate data stream: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "TINY:ADS", rc, wRc, cRc);
+
+ maxLoop = (4095 - strlen(smallAdsText)) / strlen(smallAdsRepeatText);
+ h = CreateFile("SMALL:ADS", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)smallAdsText, strlen(smallAdsText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ for(i = 0; i < maxLoop; i++)
+ {
+ ret = WriteFile(h, (LPCVOID)smallAdsRepeatText, strlen(smallAdsRepeatText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ break;
+ }
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with small alternate data stream: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "SMALL:ADS", rc, wRc, cRc);
+
+ maxLoop = (65535 - strlen(mediumAdsText)) / strlen(mediumAdsRepeatText);
+ h = CreateFile("MEDIUM:ADS", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)mediumAdsText, strlen(mediumAdsText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ for(i = 0; i < maxLoop; i++)
+ {
+ ret = WriteFile(h, (LPCVOID)mediumAdsRepeatText, strlen(mediumAdsRepeatText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ break;
+ }
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with medium alternate data stream: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "MEDIUM:ADS", rc, wRc, cRc);
+
+ maxLoop = (67584 - strlen(bigAdsText)) / strlen(bigAdsRepeatText);
+ h = CreateFile("BIG:ADS", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)bigAdsText, strlen(bigAdsText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ for(i = 0; i < maxLoop; i++)
+ {
+ ret = WriteFile(h, (LPCVOID)bigAdsRepeatText, strlen(bigAdsRepeatText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ break;
+ }
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with big alternate data stream: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "BIG:ADS", rc, wRc, cRc);
+
+ h = CreateFile("MULTIPLE:ADS", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)tinyAdsText, strlen(tinyAdsText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with tiny alternate data stream: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "MULTIPLE:ADS", rc, wRc, cRc);
+
+ maxLoop = (4095 - strlen(smallAdsText)) / strlen(smallAdsRepeatText);
+ h = CreateFile("MULTIPLE:ADS", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)smallAdsText, strlen(smallAdsText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ for(i = 0; i < maxLoop; i++)
+ {
+ ret = WriteFile(h, (LPCVOID)smallAdsRepeatText, strlen(smallAdsRepeatText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ break;
+ }
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with small alternate data stream: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "MULTIPLE:ADS", rc, wRc, cRc);
+
+ maxLoop = (65535 - strlen(mediumAdsText)) / strlen(mediumAdsRepeatText);
+ h = CreateFile("MULTIPLE:ADS", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)mediumAdsText, strlen(mediumAdsText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ for(i = 0; i < maxLoop; i++)
+ {
+ ret = WriteFile(h, (LPCVOID)mediumAdsRepeatText, strlen(mediumAdsRepeatText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ break;
+ }
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with medium alternate data stream: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "MULTIPLE:ADS", rc, wRc, cRc);
+
+ maxLoop = (67584 - strlen(bigAdsText)) / strlen(bigAdsRepeatText);
+ h = CreateFile("MULTIPLE:ADS", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ ret = WriteFile(h, (LPCVOID)bigAdsText, strlen(bigAdsText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ for(i = 0; i < maxLoop; i++)
+ {
+ ret = WriteFile(h, (LPCVOID)bigAdsRepeatText, strlen(bigAdsRepeatText), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ break;
+ }
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile with medium alternate data stream: name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", "MULTIPLE:ADS", rc, wRc, cRc);
}
void Filenames(const char *path)
{
- // TODO: Implement
+ BOOL ret;
+ DWORD error;
+ LPTSTR lpRootPathName;
+ DWORD dwMaxNameSize = MAX_PATH + 1;
+ size_t pathSize = strlen(path);
+ HANDLE h;
+ DWORD dwNumberOfBytesWritten;
+ DWORD rc, wRc, cRc;
+ char message[300];
+ int pos = 0;
+
+ lpRootPathName = malloc(dwMaxNameSize);
+
+ if(lpRootPathName == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ return;
+ }
+
+ memset(lpRootPathName, 0x00, MAX_PATH);
+ strcpy(lpRootPathName, path);
+
+ if(path[pathSize - 1] != '\\')
+ {
+ lpRootPathName[pathSize] = '\\';
+ }
+
+ ret = SetCurrentDirectory(lpRootPathName);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to specified path.\n", error);
+ return;
+ }
+
+ ret = CreateDirectory("FILENAME", NULL);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d creating working directory.\n", error);
+ return;
+ }
+
+ ret = SetCurrentDirectory("FILENAME");
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to working directory.\n", error);
+ return;
+ }
+
+ printf("Creating files with different filenames.\n");
+
+ for(pos = 0; filenames[pos]; pos++)
+ {
+ h = CreateFile(filenames[pos], GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf(&message, FILENAME_FORMAT, filenames[pos]);
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d\n", filenames[pos], rc, wRc, cRc);
+ }
}
void Timestamps(const char *path)
{
- // TODO: Implement
+ char message[300];
+ BOOL ret;
+ DWORD error;
+ LPTSTR lpRootPathName;
+ DWORD dwMaxNameSize = MAX_PATH + 1;
+ size_t pathSize = strlen(path);
+ FILETIME ftCreationTime;
+ FILETIME ftLastAccessTime;
+ FILETIME ftLastWriteTime;
+ HANDLE h;
+ DWORD rc, wRc, cRc, tRc;
+ DWORD dwNumberOfBytesWritten;
+
+ lpRootPathName = malloc(dwMaxNameSize);
+
+ if(lpRootPathName == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ return;
+ }
+
+ memset(lpRootPathName, 0x00, MAX_PATH);
+ strcpy(lpRootPathName, path);
+
+ if(path[pathSize - 1] != '\\')
+ {
+ lpRootPathName[pathSize] = '\\';
+ }
+
+ ret = SetCurrentDirectory(lpRootPathName);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to specified path.\n", error);
+ return;
+ }
+
+ ret = CreateDirectory("TIMES", NULL);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d creating working directory.\n", error);
+ return;
+ }
+
+ ret = SetCurrentDirectory("TIMES");
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to working directory.\n", error);
+ return;
+ }
+
+ printf("Creating timestamped files.\n");
+
+ h = CreateFile("MAXCTIME", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf((char *)message, DATETIME_FORMAT, MAXDATETIME, "creation");
+ ftCreationTime.dwHighDateTime = MAXTIMESTAMP;
+ ftCreationTime.dwLowDateTime = MAXTIMESTAMP;
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = SetFileTime(h, &ftCreationTime, NULL, NULL);
+ if(!ret)
+ {
+ tRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "MAXCTIME", rc, wRc, cRc, tRc);
+
+ h = CreateFile("MAXATIME", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf((char *)message, DATETIME_FORMAT, MAXDATETIME, "access");
+ ftLastAccessTime.dwHighDateTime = MAXTIMESTAMP;
+ ftLastAccessTime.dwLowDateTime = MAXTIMESTAMP;
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = SetFileTime(h, NULL, &ftLastAccessTime, NULL);
+ if(!ret)
+ {
+ tRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "MAXATIME", rc, wRc, cRc, tRc);
+
+ h = CreateFile("MAXMTIME", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf((char *)message, DATETIME_FORMAT, MAXDATETIME, "modification");
+ ftLastWriteTime.dwHighDateTime = MAXTIMESTAMP;
+ ftLastWriteTime.dwLowDateTime = MAXTIMESTAMP;
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = SetFileTime(h, NULL, NULL, &ftLastWriteTime);
+ if(!ret)
+ {
+ tRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "MAXMTIME", rc, wRc, cRc, tRc);
+
+ h = CreateFile("MINCTIME", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf((char *)message, DATETIME_FORMAT, MINDATETIME, "creation");
+ ftCreationTime.dwHighDateTime = MINTIMESTAMP;
+ ftCreationTime.dwLowDateTime = MINTIMESTAMP;
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = SetFileTime(h, &ftCreationTime, NULL, NULL);
+ if(!ret)
+ {
+ tRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "MINCTIME", rc, wRc, cRc, tRc);
+
+ h = CreateFile("MINATIME", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf((char *)message, DATETIME_FORMAT, MINDATETIME, "access");
+ ftLastAccessTime.dwHighDateTime = MINTIMESTAMP;
+ ftLastAccessTime.dwLowDateTime = MINTIMESTAMP;
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = SetFileTime(h, NULL, &ftLastAccessTime, NULL);
+ if(!ret)
+ {
+ tRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "MINATIME", rc, wRc, cRc, tRc);
+
+ h = CreateFile("MINMTIME", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf((char *)message, DATETIME_FORMAT, MINDATETIME, "modification");
+ ftLastWriteTime.dwHighDateTime = MINTIMESTAMP;
+ ftLastWriteTime.dwLowDateTime = MINTIMESTAMP;
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = SetFileTime(h, NULL, NULL, &ftLastWriteTime);
+ if(!ret)
+ {
+ tRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "MINMTIME", rc, wRc, cRc, tRc);
+
+ h = CreateFile("Y1KCTIME", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf((char *)message, DATETIME_FORMAT, Y1KDATETIME, "creation");
+ ftCreationTime.dwHighDateTime = TIMESTAMP_HI;
+ ftCreationTime.dwLowDateTime = Y1KTIMESTAMP_LO;
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = SetFileTime(h, &ftCreationTime, NULL, NULL);
+ if(!ret)
+ {
+ tRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y1KCTIME", rc, wRc, cRc, tRc);
+
+ h = CreateFile("Y1KATIME", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf((char *)message, DATETIME_FORMAT, Y1KDATETIME, "access");
+ ftLastAccessTime.dwHighDateTime = TIMESTAMP_HI;
+ ftLastAccessTime.dwLowDateTime = Y1KTIMESTAMP_LO;
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = SetFileTime(h, NULL, &ftLastAccessTime, NULL);
+ if(!ret)
+ {
+ tRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y1KATIME", rc, wRc, cRc, tRc);
+
+ h = CreateFile("Y1KMTIME", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf((char *)message, DATETIME_FORMAT, Y1KDATETIME, "modification");
+ ftLastWriteTime.dwHighDateTime = TIMESTAMP_HI;
+ ftLastWriteTime.dwLowDateTime = Y1KTIMESTAMP_LO;
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = SetFileTime(h, NULL, NULL, &ftLastWriteTime);
+ if(!ret)
+ {
+ tRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y1KMTIME", rc, wRc, cRc, tRc);
+
+ h = CreateFile("Y2KCTIME", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf((char *)message, DATETIME_FORMAT, Y2KDATETIME, "creation");
+ ftCreationTime.dwHighDateTime = TIMESTAMP_HI;
+ ftCreationTime.dwLowDateTime = Y2KTIMESTAMP_LO;
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = SetFileTime(h, &ftCreationTime, NULL, NULL);
+ if(!ret)
+ {
+ tRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y2KCTIME", rc, wRc, cRc, tRc);
+
+ h = CreateFile("Y2KATIME", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf((char *)message, DATETIME_FORMAT, Y2KDATETIME, "access");
+ ftLastAccessTime.dwHighDateTime = TIMESTAMP_HI;
+ ftLastAccessTime.dwLowDateTime = Y2KTIMESTAMP_LO;
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = SetFileTime(h, NULL, &ftLastAccessTime, NULL);
+ if(!ret)
+ {
+ tRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y2KATIME", rc, wRc, cRc, tRc);
+
+ h = CreateFile("Y2KMTIME", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf((char *)message, DATETIME_FORMAT, Y1KDATETIME, "modification");
+ ftLastWriteTime.dwHighDateTime = TIMESTAMP_HI;
+ ftLastWriteTime.dwLowDateTime = Y2KTIMESTAMP_LO;
+
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = SetFileTime(h, NULL, NULL, &ftLastWriteTime);
+ if(!ret)
+ {
+ tRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+ printf("\tFile name = \"%s\", rc = %d, wRc = %d, cRc = %d, tRc = %d\n", "Y2KMTIME", rc, wRc, cRc, tRc);
}
void DirectoryDepth(const char *path)
{
- // TODO: Implement
+ BOOL ret;
+ DWORD error;
+ LPTSTR lpRootPathName;
+ DWORD dwMaxNameSize = MAX_PATH + 1;
+ size_t pathSize = strlen(path);
+ char filename[9];
+ long pos = 2;
+
+ lpRootPathName = malloc(dwMaxNameSize);
+
+ if(lpRootPathName == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ return;
+ }
+
+ memset(lpRootPathName, 0x00, MAX_PATH);
+ strcpy(lpRootPathName, path);
+
+ if(path[pathSize - 1] != '\\')
+ {
+ lpRootPathName[pathSize] = '\\';
+ }
+
+ ret = SetCurrentDirectory(lpRootPathName);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to specified path.\n", error);
+ return;
+ }
+
+ ret = CreateDirectory("DEPTH", NULL);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d creating working directory.\n", error);
+ return;
+ }
+
+ ret = SetCurrentDirectory("DEPTH");
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to working directory.\n", error);
+ return;
+ }
+
+ printf("Creating deepest directory tree.\n");
+
+ while(ret)
+ {
+ memset(&filename, 0, 9);
+ sprintf(&filename, "%08d", pos);
+ ret = CreateDirectory(filename, NULL);
+
+ if(ret)
+ ret = SetCurrentDirectory(filename);
+
+ pos++;
+ }
+
+ printf("\tCreated %d levels of directory hierarchy\n", pos);
}
void Fragmentation(const char *path, size_t clusterSize)
{
- // TODO: Implement
+ size_t halfCluster = clusterSize / 2;
+ size_t quarterCluster = clusterSize / 4;
+ size_t twoCluster = clusterSize * 2;
+ size_t threeQuartersCluster = halfCluster + quarterCluster;
+ size_t twoAndThreeQuartCluster = threeQuartersCluster + twoCluster;
+ unsigned char *buffer;
+ long i;
+ BOOL ret;
+ DWORD error;
+ LPTSTR lpRootPathName;
+ DWORD dwMaxNameSize = MAX_PATH + 1;
+ size_t pathSize = strlen(path);
+ HANDLE h;
+ DWORD rc, wRc, cRc, tRc;
+ DWORD dwNumberOfBytesWritten;
+
+ lpRootPathName = malloc(dwMaxNameSize);
+
+ if(lpRootPathName == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ return;
+ }
+
+ memset(lpRootPathName, 0x00, MAX_PATH);
+ strcpy(lpRootPathName, path);
+
+ if(path[pathSize - 1] != '\\')
+ {
+ lpRootPathName[pathSize] = '\\';
+ }
+
+ ret = SetCurrentDirectory(lpRootPathName);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to specified path.\n", error);
+ return;
+ }
+
+ ret = CreateDirectory("FRAGS", NULL);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d creating working directory.\n", error);
+ return;
+ }
+
+ ret = SetCurrentDirectory("FRAGS");
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to working directory.\n", error);
+ return;
+ }
+
+ h = CreateFile("HALFCLST", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ buffer = malloc(halfCluster);
+ memset(buffer, 0, halfCluster);
+
+ for(i = 0; i < halfCluster; i++)
+ buffer[i] = clauniaBytes[i % CLAUNIA_SIZE];
+
+ ret = WriteFile(h, buffer, halfCluster, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(buffer);
+ }
+
+ printf("\tFile name = \"%s\", size = %d, rc = %d, wRc = %d, cRc = %d\n", "HALFCLST", halfCluster, rc, wRc, cRc);
+
+ h = CreateFile("QUARCLST", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ buffer = malloc(quarterCluster);
+ memset(buffer, 0, quarterCluster);
+
+ for(i = 0; i < quarterCluster; i++)
+ buffer[i] = clauniaBytes[i % CLAUNIA_SIZE];
+
+ ret = WriteFile(h, buffer, quarterCluster, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(buffer);
+ }
+
+ printf("\tFile name = \"%s\", size = %d, rc = %d, wRc = %d, cRc = %d\n", "QUARCLST", quarterCluster, rc, wRc, cRc);
+
+ h = CreateFile("TWOCLST", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ buffer = malloc(twoCluster);
+ memset(buffer, 0, twoCluster);
+
+ for(i = 0; i < twoCluster; i++)
+ buffer[i] = clauniaBytes[i % CLAUNIA_SIZE];
+
+ ret = WriteFile(h, buffer, twoCluster, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(buffer);
+ }
+
+ printf("\tFile name = \"%s\", size = %d, rc = %d, wRc = %d, cRc = %d\n", "TWOCLST", twoCluster, rc, wRc, cRc);
+
+ h = CreateFile("TRQTCLST", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ buffer = malloc(threeQuartersCluster);
+ memset(buffer, 0, threeQuartersCluster);
+
+ for(i = 0; i < threeQuartersCluster; i++)
+ buffer[i] = clauniaBytes[i % CLAUNIA_SIZE];
+
+ ret = WriteFile(h, buffer, threeQuartersCluster, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(buffer);
+ }
+
+ printf("\tFile name = \"%s\", size = %d, rc = %d, wRc = %d, cRc = %d\n", "TRQTCLST", threeQuartersCluster, rc, wRc,
+ cRc);
+
+ h = CreateFile("TWTQCLST", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ buffer = malloc(twoAndThreeQuartCluster);
+ memset(buffer, 0, twoAndThreeQuartCluster);
+
+ for(i = 0; i < twoAndThreeQuartCluster; i++)
+ buffer[i] = clauniaBytes[i % CLAUNIA_SIZE];
+
+ ret = WriteFile(h, buffer, twoAndThreeQuartCluster, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(buffer);
+ }
+
+ printf("\tFile name = \"%s\", size = %d, rc = %d, wRc = %d, cRc = %d\n", "TWTQCLST", twoAndThreeQuartCluster, rc,
+ wRc, cRc);
+
+ h = CreateFile("TWO1", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ buffer = malloc(twoCluster);
+ memset(buffer, 0, twoCluster);
+
+ for(i = 0; i < twoCluster; i++)
+ buffer[i] = clauniaBytes[i % CLAUNIA_SIZE];
+
+ ret = WriteFile(h, buffer, twoCluster, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(buffer);
+ }
+
+ printf("\tFile name = \"%s\", size = %d, rc = %d, wRc = %d, cRc = %d\n", "TWO1", twoCluster, rc, wRc, cRc);
+
+ h = CreateFile("TWO2", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ buffer = malloc(twoCluster);
+ memset(buffer, 0, twoCluster);
+
+ for(i = 0; i < twoCluster; i++)
+ buffer[i] = clauniaBytes[i % CLAUNIA_SIZE];
+
+ ret = WriteFile(h, buffer, twoCluster, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(buffer);
+ }
+
+ printf("\tFile name = \"%s\", size = %d, rc = %d, wRc = %d, cRc = %d\n", "TWO2", twoCluster, rc, wRc, cRc);
+
+ h = CreateFile("TWO3", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ buffer = malloc(twoCluster);
+ memset(buffer, 0, twoCluster);
+
+ for(i = 0; i < twoCluster; i++)
+ buffer[i] = clauniaBytes[i % CLAUNIA_SIZE];
+
+ ret = WriteFile(h, buffer, twoCluster, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(buffer);
+ }
+
+ printf("\tDeleting \"TWO2\".\n");
+ ret = DeleteFile("TWO2");
+ if(!ret)
+ {
+ rc = GetLastError();
+ }
+
+ printf("\tFile name = \"%s\", size = %d, rc = %d, wRc = %d, cRc = %d\n", "TWO3", twoCluster, rc, wRc, cRc);
+
+ h = CreateFile("FRAGTHRQ", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ buffer = malloc(threeQuartersCluster);
+ memset(buffer, 0, threeQuartersCluster);
+
+ for(i = 0; i < threeQuartersCluster; i++)
+ buffer[i] = clauniaBytes[i % CLAUNIA_SIZE];
+
+ ret = WriteFile(h, buffer, threeQuartersCluster, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(buffer);
+ }
+
+ printf("\tDeleting \"TWO1\".\n");
+ ret = DeleteFile("TWO1");
+ if(!ret)
+ {
+ rc = GetLastError();
+ }
+ printf("\tDeleting \"TWO3\".\n");
+ ret = DeleteFile("TWO3");
+ if(!ret)
+ {
+ rc = GetLastError();
+ }
+
+ printf("\tFile name = \"%s\", size = %d, rc = %d, wRc = %d, cRc = %d\n", "FRAGTHRQ", threeQuartersCluster, rc, wRc,
+ cRc);
+
+ h = CreateFile("FRAGSIXQ", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ tRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ buffer = malloc(twoAndThreeQuartCluster);
+ memset(buffer, 0, twoAndThreeQuartCluster);
+
+ for(i = 0; i < twoAndThreeQuartCluster; i++)
+ buffer[i] = clauniaBytes[i % CLAUNIA_SIZE];
+
+ ret = WriteFile(h, buffer, twoAndThreeQuartCluster, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(buffer);
+ }
+
+ printf("\tFile name = \"%s\", size = %d, rc = %d, wRc = %d, cRc = %d\n", "FRAGSIXQ", twoAndThreeQuartCluster, rc,
+ wRc, cRc);
}
void Sparse(const char *path)
{
- // TODO: Implement
+ BOOL ret;
+ DWORD error;
+ LPTSTR lpVolumeNameBuffer;
+ DWORD dwMaximumComponentLength;
+ DWORD dwFileSystemFlags;
+ DWORD dwMaxNameSize = MAX_PATH + 1;
+ LPTSTR lpFileSystemNameBuffer;
+ LPTSTR lpRootPathName;
+ size_t pathSize = strlen(path);
+ DWORD rc, wRc, cRc, sRc, zRc;
+ FILE_ZERO_DATA_INFORMATION zeroData;
+ HANDLE h;
+ unsigned char *buffer;
+ int i;
+ DWORD dwNumberOfBytesWritten;
+
+ lpVolumeNameBuffer = malloc(dwMaxNameSize);
+
+ if(lpVolumeNameBuffer == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ return;
+ }
+
+ lpFileSystemNameBuffer = malloc(dwMaxNameSize);
+
+ if(lpFileSystemNameBuffer == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ free(lpVolumeNameBuffer);
+ return;
+ }
+
+ lpRootPathName = malloc(dwMaxNameSize);
+
+ if(lpRootPathName == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ free(lpVolumeNameBuffer);
+ free(lpFileSystemNameBuffer);
+ return;
+ }
+
+ memset(lpRootPathName, 0x00, MAX_PATH);
+ strcpy(lpRootPathName, path);
+
+ if(path[pathSize - 1] != '\\')
+ {
+ lpRootPathName[pathSize] = '\\';
+ }
+
+ ret = GetVolumeInformation(lpRootPathName, lpVolumeNameBuffer, dwMaxNameSize, NULL, &dwMaximumComponentLength, &dwFileSystemFlags, lpFileSystemNameBuffer, dwMaxNameSize);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d querying volume information.\n", error);
+ free(lpVolumeNameBuffer);
+ free(lpFileSystemNameBuffer);
+ free(lpRootPathName);
+ return;
+ }
+
+ free(lpVolumeNameBuffer);
+ free(lpFileSystemNameBuffer);
+
+ if(!(dwFileSystemFlags & FILE_SUPPORTS_SPARSE_FILES))
+ {
+ free(lpRootPathName);
+ return;
+ }
+
+ ret = SetCurrentDirectory(lpRootPathName);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to specified path.\n", error);
+ return;
+ }
+
+ ret = CreateDirectory("SPARSE", NULL);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d creating working directory.\n", error);
+ return;
+ }
+
+ ret = SetCurrentDirectory("SPARSE");
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to working directory.\n", error);
+ return;
+ }
+
+ free(lpRootPathName);
+
+ printf("Creating sparse files.\n");
+
+ h = CreateFile("SMALL", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ sRc = 0;
+ zRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ buffer = malloc(4096*3);
+ memset(buffer, 0, 4096*3);
+
+ for(i = 0; i < 4096*3; i++)
+ buffer[i] = clauniaBytes[i % CLAUNIA_SIZE];
+
+ ret = WriteFile(h, buffer, 4096*3, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = DeviceIoControl(h, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ sRc = GetLastError();
+ if(sRc == 1)
+ {
+ sRc = 0;
+ ret = DeviceIoControl(h, FSCTL_SET_SPARSE_OLD, NULL, 0, NULL, 0, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ sRc = GetLastError();
+ }
+ }
+ }
+
+ if(sRc == 0)
+ {
+ zeroData.FileOffset.QuadPart = 4096;
+ zeroData.BeyondFinalZero.QuadPart = 8192;
+
+ ret = DeviceIoControl(h, FSCTL_SET_ZERO_DATA, &zeroData, sizeof(FILE_ZERO_DATA_INFORMATION), NULL, 0, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ zRc = GetLastError();
+ if(zRc == 1)
+ {
+ zRc = 0;
+ ret = DeviceIoControl(h, FSCTL_SET_ZERO_DATA_OLD, &zeroData, sizeof(FILE_ZERO_DATA_INFORMATION), NULL, 0, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ zRc = GetLastError();
+ }
+ }
+ }
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(buffer);
+ }
+
+ printf("\tFile name = \"%s\", size = %d, rc = %d, wRc = %d, cRc = %d, sRc = %d, zRc\n", "SMALL", 4096*3, rc, wRc, cRc, sRc, zRc);
+
+ h = CreateFile("BIG", GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ sRc = 0;
+ zRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ buffer = malloc(4096*30);
+ memset(buffer, 0, 4096*30);
+
+ for(i = 0; i < 4096*30; i++)
+ buffer[i] = clauniaBytes[i % CLAUNIA_SIZE];
+
+ ret = WriteFile(h, buffer, 4096*30, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = DeviceIoControl(h, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ sRc = GetLastError();
+ if(sRc == 1)
+ {
+ sRc = 0;
+ ret = DeviceIoControl(h, FSCTL_SET_SPARSE_OLD, NULL, 0, NULL, 0, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ sRc = GetLastError();
+ }
+ }
+ }
+
+ if(sRc == 0)
+ {
+ zeroData.FileOffset.QuadPart = 32768;
+ zeroData.BeyondFinalZero.QuadPart = 81920;
+
+ ret = DeviceIoControl(h, FSCTL_SET_ZERO_DATA, &zeroData, sizeof(FILE_ZERO_DATA_INFORMATION), NULL, 0, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ zRc = GetLastError();
+ if(zRc == 1)
+ {
+ zRc = 0;
+ ret = DeviceIoControl(h, FSCTL_SET_ZERO_DATA_OLD, &zeroData, sizeof(FILE_ZERO_DATA_INFORMATION), NULL, 0, &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ zRc = GetLastError();
+ }
+ }
+ }
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ free(buffer);
+ }
+
+ printf("\tFile name = \"%s\", size = %d, rc = %d, wRc = %d, cRc = %d, sRc = %d, zRc\n", "BIG", 4096*30, rc, wRc, cRc, sRc, zRc);
}
void Links(const char *path)
{
- // TODO: Implement
+/*
+ BOOL ret;
+ DWORD error;
+ OSVERSIONINFO verInfo;
+ HINSTANCE kernel32;
+ void *func;
+ DWORD dwNumberOfBytesWritten;
+ DWORD rc, wRc, cRc, lRc;
+ char message[300];
+ HANDLE h;
+ LPTSTR lpRootPathName;
+ DWORD dwMaxNameSize = MAX_PATH + 1;
+ size_t pathSize = strlen(path);
+
+ verInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ ret = GetVersionEx(&verInfo);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d querying Windows version.\n", error);
+ return;
+ }
+
+ if(verInfo.dwPlatformId != VER_PLATFORM_WIN32_NT)
+ {
+ // Not supported on Windows 9x
+ return;
+ }
+
+ lpRootPathName = malloc(dwMaxNameSize);
+
+ if(lpRootPathName == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ return;
+ }
+
+ memset(lpRootPathName, 0x00, MAX_PATH);
+ strcpy(lpRootPathName, path);
+
+ if(path[pathSize - 1] != '\\')
+ {
+ lpRootPathName[pathSize] = '\\';
+ }
+
+ ret = SetCurrentDirectory(lpRootPathName);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to specified path.\n", error);
+ return;
+ }
+
+ ret = CreateDirectory("LINKS", NULL);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d creating working directory.\n", error);
+ return;
+ }
+
+ ret = SetCurrentDirectory("LINKS");
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to working directory.\n", error);
+ return;
+ }
+
+ kernel32 = LoadLibrary("kernel32.dll");
+
+ if(kernel32 == NULL)
+ {
+ error = GetLastError();
+ printf("Error %d loading KERNEL32.DLL.\n", error);
+ return;
+ }
+
+ func = GetProcAddress(kernel32, "CreateSymbolicLinkA");
+
+ if(func == NULL)
+ {
+ error = GetLastError();
+ printf("Error %d finding CreateSymbolicLinkA.\n", error);
+ }
+ else
+ {
+ CreateSymbolicLinkA = func;
+ printf("Creating symbolic links.\n");
+
+ h = CreateFile("TARGET", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ lRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf(&message, "This file is the target of a symbolic link.\n");
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+
+ ret = CreateSymbolicLinkA("SYMLINK", "TARGET", 0);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+
+ printf("\tSymbolic link, rc = 0x%08x, wRc = %d, cRc = %d, lRc = %d\n", rc, wRc, cRc, lRc);
+ }
+
+ func = GetProcAddress(kernel32, "CreateHardLinkA");
+
+ if(func == NULL)
+ {
+ error = GetLastError();
+ printf("Error %d finding CreateHardLinkA.\n", error);
+ }
+ else
+ {
+ CreateSymbolicLinkA = func;
+ printf("Creating hard links.\n");
+
+ h = CreateFile("HARDTRGT", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ rc = 0;
+ wRc = 0;
+ cRc = 0;
+ lRc = 0;
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ rc = GetLastError();
+ }
+ else
+ {
+ memset(&message, 0, 300);
+ sprintf(&message, "This file is part of a hard link.\n");
+ ret = WriteFile(h, &message, strlen(message), &dwNumberOfBytesWritten, NULL);
+ if(!ret)
+ {
+ wRc = GetLastError();
+ }
+
+ ret = CloseHandle(h);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+
+ ret = CreateSymbolicLinkA("HARDLINK", "HARDTRGT", NULL);
+ if(!ret)
+ {
+ cRc = GetLastError();
+ }
+ }
+
+ printf("\tHard link, rc = 0x%08x, wRc = %d, cRc = %d, lRc = %d\n", rc, wRc, cRc, lRc);
+ }
+
+ FreeLibrary(kernel32);
+*/
}
void MillionFiles(const char *path)
{
- // TODO: Implement
+ char filename[9];
+ DWORD pos = 0;
+ HANDLE h;
+ BOOL ret;
+ DWORD error;
+ LPTSTR lpRootPathName;
+ DWORD dwMaxNameSize = MAX_PATH + 1;
+ size_t pathSize = strlen(path);
+
+ lpRootPathName = malloc(dwMaxNameSize);
+
+ if(lpRootPathName == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ return;
+ }
+
+ memset(lpRootPathName, 0x00, MAX_PATH);
+ strcpy(lpRootPathName, path);
+
+ if(path[pathSize - 1] != '\\')
+ {
+ lpRootPathName[pathSize] = '\\';
+ }
+
+ ret = SetCurrentDirectory(lpRootPathName);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to specified path.\n", error);
+ return;
+ }
+
+ ret = CreateDirectory("MILLION", NULL);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d creating working directory.\n", error);
+ return;
+ }
+
+ ret = SetCurrentDirectory("MILLION");
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to working directory.\n", error);
+ return;
+ }
+
+ printf("Creating lots of files.\n");
+
+ for(pos = 0; pos < 100000; pos++)
+ {
+ memset(&filename, 0, 9);
+ sprintf(&filename, "%08Lu", pos);
+
+ h = CreateFile(&filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ break;
+ }
+
+ CloseHandle(h);
+ }
+
+ printf("\tCreated %Lu files\n", pos);
}
void DeleteFiles(const char *path)
{
- // TODO: Implement
+ char filename[9];
+ DWORD pos = 0;
+ HANDLE h;
+ BOOL ret;
+ DWORD error;
+ LPTSTR lpRootPathName;
+ DWORD dwMaxNameSize = MAX_PATH + 1;
+ size_t pathSize = strlen(path);
+
+ lpRootPathName = malloc(dwMaxNameSize);
+
+ if(lpRootPathName == NULL)
+ {
+ printf("Could not allocate memory.\n");
+ return;
+ }
+
+ memset(lpRootPathName, 0x00, MAX_PATH);
+ strcpy(lpRootPathName, path);
+
+ if(path[pathSize - 1] != '\\')
+ {
+ lpRootPathName[pathSize] = '\\';
+ }
+
+ ret = SetCurrentDirectory(lpRootPathName);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to specified path.\n", error);
+ return;
+ }
+
+ ret = CreateDirectory("DELETED", NULL);
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d creating working directory.\n", error);
+ return;
+ }
+
+ ret = SetCurrentDirectory("DELETED");
+
+ if(!ret)
+ {
+ error = GetLastError();
+ printf("Error %d changing to working directory.\n", error);
+ return;
+ }
+
+ printf("Creating and deleting files.\n");
+
+ for(pos = 0; pos < 64; pos++)
+ {
+ memset(&filename, 0, 9);
+ sprintf(&filename, "%X", pos);
+ h = CreateFile(&filename, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if(h == INVALID_HANDLE_VALUE)
+ {
+ break;
+ }
+
+ CloseHandle(h);
+ DeleteFile(&filename);
+ }
}
#endif
diff --git a/setter/win32.h b/setter/win32.h
new file mode 100644
index 0000000..20aa58f
--- /dev/null
+++ b/setter/win32.h
@@ -0,0 +1,499 @@
+/****************************************************************************
+The Disc Image Chef
+-----------------------------------------------------------------------------
+
+Filename : win32.h
+Author(s) : Natalia Portillo
+
+Component : fstester.setter.win32
+
+--[ Description ] -----------------------------------------------------------
+
+Contains 32-bit and 64-bit Windows declarations
+
+--[ License ] ---------------------------------------------------------------
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warraty of
+ MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+-----------------------------------------------------------------------------
+Copyright (C) 2011-2018 Natalia Portillo
+*****************************************************************************/
+
+#if defined(__WINDOWS__) || defined (__TOS_WIN__) || defined (__WIN32__) || defined (_WIN64) || defined (_WIN32) || defined (__NT__)
+
+#ifndef DIC_FSTESTER_SETTER_WIN32_H
+#define DIC_FSTESTER_SETTER_WIN32_H
+
+#ifndef VER_PLATFORM_WIN32s
+#define VER_PLATFORM_WIN32s 0
+#endif
+
+#ifndef VER_PLATFORM_WIN32_WINDOWS
+#define VER_PLATFORM_WIN32_WINDOWS 1
+#endif
+
+#ifndef VER_PLATFORM_WIN32_NT
+#define VER_PLATFORM_WIN32_NT 2
+#endif
+
+#ifndef VER_PLATFORM_WIN32_NT
+#define VER_PLATFORM_WIN32_NT 2
+#endif
+
+#ifndef FILE_CASE_PRESERVED_NAMES
+#define FILE_CASE_PRESERVED_NAMES 0x00000002
+#endif
+
+#ifndef FILE_CASE_SENSITIVE_SEARCH
+#define FILE_CASE_SENSITIVE_SEARCH 0x00000001
+#endif
+
+#ifndef FILE_DAX_VOLUME
+#define FILE_DAX_VOLUME 0x20000000
+#endif
+
+#ifndef FILE_FILE_COMPRESSION
+#define FILE_FILE_COMPRESSION 0x00000010
+#endif
+
+#ifndef FILE_NAMED_STREAMS
+#define FILE_NAMED_STREAMS 0x00040000
+#endif
+
+#ifndef FILE_PERSISTENT_ACLS
+#define FILE_PERSISTENT_ACLS 0x00000008
+#endif
+
+#ifndef FILE_READ_ONLY_VOLUME
+#define FILE_READ_ONLY_VOLUME 0x00080000
+#endif
+
+#ifndef FILE_SEQUENTIAL_WRITE_ONCE
+#define FILE_SEQUENTIAL_WRITE_ONCE 0x00100000
+#endif
+
+#ifndef FILE_SUPPORTS_ENCRYPTION
+#define FILE_SUPPORTS_ENCRYPTION 0x00020000
+#endif
+
+#ifndef FILE_SUPPORTS_EXTENDED_ATTRIBUTES
+#define FILE_SUPPORTS_EXTENDED_ATTRIBUTES 0x00800000
+#endif
+
+#ifndef FILE_SUPPORTS_HARD_LINKS
+#define FILE_SUPPORTS_HARD_LINKS 0x00400000
+#endif
+
+#ifndef FILE_SUPPORTS_OBJECT_IDS
+#define FILE_SUPPORTS_OBJECT_IDS 0x00010000
+#endif
+
+#ifndef FILE_SUPPORTS_OPEN_BY_FILE_ID
+#define FILE_SUPPORTS_OPEN_BY_FILE_ID 0x01000000
+#endif
+
+#ifndef FILE_SUPPORTS_REPARSE_POINTS
+#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
+#endif
+
+#ifndef FILE_SUPPORTS_SPARSE_FILES
+#define FILE_SUPPORTS_SPARSE_FILES 0x00000040
+#endif
+
+#ifndef FILE_SUPPORTS_TRANSACTIONS
+#define FILE_SUPPORTS_TRANSACTIONS 0x00200000
+#endif
+
+#ifndef FILE_SUPPORTS_USN_JOURNAL
+#define FILE_SUPPORTS_USN_JOURNAL 0x02000000
+#endif
+
+#ifndef FILE_UNICODE_ON_DISK
+#define FILE_UNICODE_ON_DISK 0x00000004
+#endif
+
+#ifndef FILE_VOLUME_IS_COMPRESSED
+#define FILE_VOLUME_IS_COMPRESSED 0x00008000
+#endif
+
+#ifndef FILE_VOLUME_QUOTAS
+#define FILE_VOLUME_QUOTAS 0x00000020
+#endif
+
+#ifndef FILE_ATTRIBUTE_ARCHIVE
+#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
+#endif
+
+#ifndef FILE_ATTRIBUTE_ENCRYPTED
+#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
+#endif
+
+#ifndef FILE_ATTRIBUTE_HIDDEN
+#define FILE_ATTRIBUTE_HIDDEN 0x00000002
+#endif
+
+#ifndef FILE_ATTRIBUTE_NORMAL
+#define FILE_ATTRIBUTE_NORMAL 0x00000080
+#endif
+
+#ifndef FILE_ATTRIBUTE_OFFLINE
+#define FILE_ATTRIBUTE_OFFLINE 0x00001000
+#endif
+
+#ifndef FILE_ATTRIBUTE_READONLY
+#define FILE_ATTRIBUTE_READONLY 0x00000001
+#endif
+
+#ifndef FILE_ATTRIBUTE_SYSTEM
+#define FILE_ATTRIBUTE_SYSTEM 0x00000004
+#endif
+
+#ifndef FILE_ATTRIBUTE_TEMPORARY
+#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
+#endif
+
+#ifndef FILE_ATTRIBUTE_COMPRESSED
+#define FILE_ATTRIBUTE_COMPRESSED 0x00000800
+#endif
+
+#ifndef FSCTL_SET_COMPRESSION
+#define FSCTL_SET_COMPRESSION 0x9C040
+#endif
+
+#ifndef COMPRESSION_FORMAT_DEFAULT
+#define COMPRESSION_FORMAT_DEFAULT 1
+#endif
+
+const char *archivedAttributeText = "This file has the archived attribute set.\n";
+const char *encryptedAttributeText = "This file is encrypted.\n";
+const char *hiddenAttributeText = "This file has the hidden attribute set.\n";
+const char *noAttributeText = "This file has no attribute set.\n";
+const char *offlineAttributeText = "This file is available offline.\n";
+const char *readonlyAttributeText = "This file has the read-only attribute set.\n";
+const char *systemAttributeText = "This file has the system attribute set.\n";
+const char *temporaryAttributeText = "This file is temporary.\n";
+const char *compressedAttributeText = "This file is compressed.\n";
+const char *tinyAdsText = "This is a tiny Alternate Data Stream.\n";
+const char *smallAdsText = "This is a small Alternate Data Stream.\n";
+const char *mediumAdsText = "This is a medium Alternate Data Stream.\n";
+const char *bigAdsText = "This is a big Alternate Data Stream.\n";
+const char *smallAdsRepeatText = "This message repeats until almost 4KiB.\n";
+const char *mediumAdsRepeatText = "This message repeats until almost 64KiB.\n";
+const char *bigAdsRepeatText = "This message repeats until more than 64KiB.\n";
+
+typedef struct _FILE_FULL_EA_INFORMATION {
+ ULONG NextEntryOffset;
+ UCHAR Flags;
+ UCHAR EaNameLength;
+ USHORT EaValueLength;
+ CHAR EaName[1];
+} FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
+
+#ifndef FILE_NEED_EA
+#define FILE_NEED_EA 0x80
+#endif
+
+typedef LONG NTSTATUS;
+
+typedef struct _IO_STATUS_BLOCK {
+ union {
+ NTSTATUS Status;
+ PVOID Pointer;
+ } DUMMYUNIONNAME;
+ PULONG Information;
+} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
+
+NTSTATUS (*NtSetEaFile)(HANDLE, PIO_STATUS_BLOCK, PVOID, ULONG);
+
+#ifndef FSCTL_SET_SPARSE
+#define FSCTL_SET_SPARSE 0x000900C4
+#define FSCTL_SET_SPARSE_OLD 0x000980C4
+#endif
+
+#ifndef FSCTL_SET_ZERO_DATA
+#define FSCTL_SET_ZERO_DATA 0x000900C8
+#define FSCTL_SET_ZERO_DATA_OLD 0x000980C8
+#endif
+
+typedef struct _FILE_ZERO_DATA_INFORMATION {
+ LARGE_INTEGER FileOffset;
+ LARGE_INTEGER BeyondFinalZero;
+} FILE_ZERO_DATA_INFORMATION, *PFILE_ZERO_DATA_INFORMATION;
+
+unsigned char CommentsEA[72] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x33, 0x00, 0x2E, 0x43, 0x4F, 0x4D, 0x4D, 0x45,
+ 0x4E, 0x54, 0x53, 0x00, 0xFD, 0xFF, 0x2E, 0x00, 0x54, 0x68, 0x69, 0x73, 0x20, 0x45,
+ 0x41, 0x20, 0x63, 0x6F, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x73, 0x20, 0x63, 0x6F, 0x6D,
+ 0x6D, 0x65, 0x6E, 0x74, 0x73, 0x20, 0x66, 0x6F, 0x72, 0x20, 0x57, 0x6F, 0x72, 0x6B,
+ 0x50, 0x6C, 0x61, 0x63, 0x65, 0x20, 0x53, 0x68, 0x65, 0x6C, 0x6C, 0x2E, 0x00, 0x00,
+ 0x00, 0x00};
+
+unsigned char CommentsEACritical[72] = {0x00, 0x00, 0x00, 0x00, 0x80, 0x09, 0x33, 0x00, 0x2E, 0x43, 0x4F, 0x4D, 0x4D,
+ 0x45, 0x4E, 0x54, 0x53, 0x00, 0xFD, 0xFF, 0x2E, 0x00, 0x54, 0x68, 0x69, 0x73,
+ 0x20, 0x45, 0x41, 0x20, 0x63, 0x6F, 0x6E, 0x74, 0x61, 0x69, 0x6E, 0x73, 0x20,
+ 0x63, 0x6F, 0x6D, 0x6D, 0x65, 0x6E, 0x74, 0x73, 0x20, 0x66, 0x6F, 0x72, 0x20,
+ 0x57, 0x6F, 0x72, 0x6B, 0x50, 0x6C, 0x61, 0x63, 0x65, 0x20, 0x53, 0x68, 0x65,
+ 0x6C, 0x6C, 0x2E, 0x00, 0x00, 0x00, 0x00};
+
+unsigned char IconEA[3516] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xAE, 0x0D, 0x2E, 0x49, 0x43, 0x4F, 0x4E, 0x00, 0xF9,
+ 0xFF, 0xAA, 0x0D, 0x42, 0x41, 0x28, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x43, 0x49, 0x1A, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0xDA, 0x01, 0x00,
+ 0x00, 0x0C, 0x00, 0x00, 0x00, 0x20, 0x00, 0x40, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0xFF, 0xFF, 0xFF, 0x43, 0x49, 0x1A, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0xDA,
+ 0x02, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x01, 0x00, 0x04, 0x00,
+ 0x00, 0x00, 0x00, 0x3F, 0x3F, 0x3F, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x80, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x80, 0x80, 0x00,
+ 0xFF, 0x00, 0xFF, 0x80, 0x00, 0x80, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00,
+ 0xFF, 0x00, 0x00, 0x42, 0x41, 0x28, 0x00, 0x00, 0x00, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x43, 0x49, 0x1A, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0xDA, 0x04, 0x00,
+ 0x00, 0x0C, 0x00, 0x00, 0x00, 0x20, 0x00, 0x40, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0xFF, 0xFF, 0xFF, 0x43, 0x49, 0x1A, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0xDA,
+ 0x05, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x42, 0x41, 0x28, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x49, 0x1A, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00,
+ 0x5A, 0x06, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x10, 0x00, 0x20, 0x00, 0x01, 0x00, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x43, 0x49, 0x1A, 0x00, 0x00, 0x00, 0x08, 0x00,
+ 0x08, 0x00, 0xDA, 0x06, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x01,
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x41, 0x28, 0x00, 0x00, 0x00,
+ 0x62, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x49, 0x1A, 0x00, 0x00, 0x00, 0x0A,
+ 0x00, 0x0A, 0x00, 0x1A, 0x07, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x14, 0x00, 0x28, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x43, 0x49, 0x1A, 0x00, 0x00,
+ 0x00, 0x0A, 0x00, 0x0A, 0x00, 0xBA, 0x07, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x14, 0x00,
+ 0x14, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x41, 0x28,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x03, 0x43, 0x49, 0x1A, 0x00,
+ 0x00, 0x00, 0x14, 0x00, 0x14, 0x00, 0x0A, 0x08, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x28,
+ 0x00, 0x50, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x43, 0x49,
+ 0x1A, 0x00, 0x00, 0x00, 0x14, 0x00, 0x14, 0x00, 0x8A, 0x0A, 0x00, 0x00, 0x0C, 0x00, 0x00,
+ 0x00, 0x28, 0x00, 0x28, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x3F, 0x3F,
+ 0x80, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0xFF, 0xFF, 0xFF, 0x00, 0x80, 0x80, 0x80, 0xA0, 0x80,
+ 0x28, 0x50, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x80, 0x00, 0xD0, 0xD8, 0xB0, 0xC0, 0xFF, 0xFF,
+ 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F,
+ 0xFE, 0x3F, 0xFE, 0x0F, 0xF8, 0x3F, 0xFE, 0x0F, 0xF8, 0x3F, 0xFE, 0x0F, 0xF8, 0x3F, 0xFE,
+ 0x00, 0x00, 0x3F, 0xFF, 0x00, 0x00, 0x3F, 0xFF, 0x00, 0x00, 0x7F, 0xFF, 0x00, 0x00, 0x7F,
+ 0xFF, 0x00, 0x00, 0x1F, 0xFE, 0x00, 0x00, 0x0F, 0xFC, 0x00, 0x00, 0x0F, 0xF8, 0x00, 0x00,
+ 0x0F, 0xF8, 0x00, 0x00, 0x0F, 0xF8, 0x00, 0x00, 0x0F, 0xF8, 0x00, 0x00, 0x0F, 0xF8, 0x00,
+ 0x00, 0x0F, 0xF8, 0x00, 0x00, 0x0F, 0xF8, 0x00, 0x00, 0x0F, 0xF8, 0x00, 0x00, 0x0F, 0xF8,
+ 0x00, 0x00, 0x0F, 0xF8, 0x00, 0x00, 0x0F, 0xF8, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x3F,
+ 0xFC, 0x00, 0x00, 0x7F, 0xFF, 0xFC, 0x7F, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x22, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x31, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x31, 0x22,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x31, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x31,
+ 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x33, 0x12, 0x22, 0x22, 0x22, 0x22, 0x13,
+ 0x31, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x12, 0x22, 0x22, 0x22, 0x22,
+ 0x13, 0x12, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x11, 0x11, 0x11, 0x11,
+ 0x11, 0x13, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x33, 0x33, 0x33,
+ 0x33, 0x33, 0x33, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x31, 0x11,
+ 0x11, 0x11, 0x11, 0x31, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x21, 0x31,
+ 0x22, 0x22, 0x22, 0x21, 0x31, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11,
+ 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x34,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x31, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x41, 0x22, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x41, 0x22, 0x00, 0x00, 0x00,
+ 0x00, 0x01, 0x44, 0x46, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x44, 0x41, 0x22, 0x00, 0x00,
+ 0x00, 0x00, 0x01, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x41, 0x22, 0x00,
+ 0x00, 0x00, 0x00, 0x01, 0x44, 0x46, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x44, 0x41, 0x22,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x41,
+ 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x44, 0x46, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x44,
+ 0x41, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x41, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x44, 0x46, 0x66, 0x66, 0x66, 0x66, 0x66,
+ 0x66, 0x44, 0x41, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x44, 0x44, 0x41, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x34, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x44, 0x44, 0x44, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x11, 0x11,
+ 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x14, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x07, 0xFC,
+ 0x1F, 0xFC, 0x07, 0xF0, 0x1F, 0xFC, 0x07, 0xF0, 0x1F, 0xFC, 0x07, 0xF0, 0x1F, 0xFC, 0x00,
+ 0x00, 0x1F, 0xFC, 0x00, 0x00, 0x1F, 0xFE, 0x00, 0x00, 0x1F, 0xFE, 0x00, 0x00, 0x3F, 0xFE,
+ 0x00, 0x00, 0x1F, 0xFE, 0x00, 0x00, 0x0F, 0xFC, 0x00, 0x00, 0x07, 0xF8, 0x00, 0x00, 0x07,
+ 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00,
+ 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00,
+ 0x00, 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x0F, 0xF0,
+ 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x3F, 0xFC, 0x00, 0x00, 0x7F, 0xFF, 0xFC, 0x7F, 0xFF,
+ 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x03, 0xE0, 0x03, 0x88, 0x0E, 0x20, 0x02, 0x08,
+ 0x08, 0x20, 0x02, 0x88, 0x0A, 0x20, 0x02, 0x8F, 0xFA, 0x20, 0x02, 0xC0, 0x06, 0x20, 0x01,
+ 0x40, 0x04, 0x20, 0x01, 0x40, 0x04, 0x40, 0x01, 0x7F, 0xFC, 0x60, 0x01, 0x20, 0x08, 0x10,
+ 0x02, 0x20, 0x08, 0x08, 0x04, 0x00, 0x00, 0x08, 0x0B, 0xFF, 0xFF, 0x88, 0x0B, 0xFF, 0xFF,
+ 0x88, 0x0B, 0xFF, 0xFF, 0x88, 0x0B, 0x00, 0x03, 0x88, 0x0B, 0xFF, 0xFF, 0x88, 0x0B, 0x00,
+ 0x03, 0x88, 0x0B, 0xFF, 0xFF, 0x88, 0x0B, 0x00, 0x03, 0x88, 0x0B, 0xFF, 0xFF, 0x88, 0x0B,
+ 0x00, 0x03, 0x88, 0x0B, 0xFF, 0xFF, 0x90, 0x0B, 0xFF, 0xFF, 0xA0, 0x04, 0x00, 0x00, 0x40,
+ 0x03, 0xFD, 0x7F, 0x80, 0x00, 0x02, 0x80, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xED, 0x41, 0x00, 0x00, 0x3B, 0x00, 0x00, 0x00, 0x27, 0x09, 0x00,
+ 0x00, 0xF5, 0x08, 0x00, 0x00, 0x1F, 0x09, 0x00, 0x00, 0x4A, 0x09, 0x00, 0x00, 0x9F, 0x0A,
+ 0x00, 0x00, 0xE3, 0x0A, 0x00, 0x00, 0xE4, 0x09, 0x00, 0x00, 0x02, 0x0A, 0x00, 0x00, 0x29,
+ 0x0A, 0x00, 0x00, 0x55, 0x0A, 0x00, 0x00, 0x72, 0x0A, 0x00, 0x00, 0x88, 0x0A, 0xFF, 0xFF,
+ 0x00, 0x00, 0xE7, 0xCF, 0xE5, 0x1C, 0xE7, 0xCF, 0x65, 0x00, 0xF0, 0x1F, 0xDD, 0x04, 0xF3,
+ 0x9F, 0xF2, 0x03, 0xE0, 0x0F, 0xC7, 0x04, 0xDF, 0xF7, 0x0B, 0x05, 0xDF, 0xF7, 0xF8, 0x04,
+ 0xDF, 0xF7, 0x32, 0x04, 0xDF, 0xF7, 0xA8, 0x04, 0xDF, 0xF7, 0x9E, 0x04, 0xDF, 0xF7, 0xBA,
+ 0x04, 0xE0, 0x0F, 0x7A, 0x04, 0xFD, 0x7F, 0x85, 0x04, 0xFE, 0xFF, 0xFF, 0x04, 0xFF, 0xFF,
+ 0xDF, 0x04, 0xFF, 0xFF, 0x00, 0x00, 0xE7, 0xCF, 0x00, 0x1F, 0xE7, 0xCF, 0x00, 0x1F, 0xF0,
+ 0x1F, 0x00, 0x1F, 0xF3, 0x9F, 0x00, 0x1F, 0xE0, 0x0F, 0x00, 0x1F, 0xDF, 0xF7, 0x00, 0x1F,
+ 0xDF, 0xF7, 0x00, 0x1F, 0xDF, 0xF7, 0x00, 0x1F, 0xDF, 0xF7, 0x00, 0x1F, 0xDF, 0xF7, 0x00,
+ 0x1F, 0xDF, 0xF7, 0x00, 0x7F, 0xE0, 0x0F, 0x00, 0x7F, 0xFD, 0x7F, 0xFF, 0xFF, 0xFE, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x33, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x7F, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x80, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x03, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x88, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x7F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xF0, 0x00,
+ 0xE3, 0xF1, 0xF0, 0x00, 0xEB, 0xF5, 0xF1, 0x11, 0xE9, 0xE5, 0xF0, 0x00, 0xF4, 0x0B, 0xF0,
+ 0x00, 0xF7, 0xFB, 0xF0, 0x00, 0xFA, 0x17, 0xF1, 0x11, 0xFA, 0xD7, 0xF0, 0x00, 0xE0, 0x01,
+ 0xF0, 0x0F, 0xDF, 0xFE, 0xF0, 0x00, 0xDF, 0xFE, 0xFF, 0xFF, 0xDF, 0xFE, 0xF0, 0x00, 0xDF,
+ 0xFE, 0xFF, 0xFF, 0xDF, 0xFE, 0xFF, 0xFF, 0xDF, 0xFE, 0xF0, 0x00, 0xDF, 0xFE, 0xFF, 0xFF,
+ 0xE0, 0x01, 0xFF, 0xFF, 0xFF, 0x5F, 0xFF, 0xFF, 0xFF, 0xBF, 0xF6, 0x66, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xE3, 0xF1, 0xF0, 0x01, 0xEB, 0xF5, 0xF1, 0x11, 0xE9, 0xE5,
+ 0xF0, 0x00, 0xF4, 0x0B, 0xF0, 0x01, 0xF7, 0xFB, 0xF1, 0x11, 0xFA, 0x17, 0xF0, 0x00, 0xFA,
+ 0xD7, 0xF0, 0x01, 0xE0, 0x01, 0xF1, 0x11, 0xDF, 0xFE, 0xF0, 0x00, 0xDF, 0xFE, 0xF0, 0x01,
+ 0xDF, 0xFE, 0xF1, 0x11, 0xDF, 0xFE, 0xF0, 0x00, 0xDF, 0xFE, 0xF0, 0x00, 0xDF, 0xFE, 0xF0,
+ 0x00, 0xDF, 0xFE, 0xF0, 0x00, 0xE0, 0x01, 0xF0, 0x00, 0xFF, 0x5F, 0xF1, 0x00, 0xFF, 0xBF,
+ 0xF0, 0x00, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x7F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x80,
+ 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88,
+ 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x33, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x88, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xF7, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x88, 0x08, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x88, 0x88, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x7F, 0xFF, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0x87, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0x33, 0x33, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x88, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x7F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88,
+ 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
+ 0x77, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x08, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x33, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xF7, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x88, 0x88, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x7F, 0xFF, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0x33, 0x33, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x7F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11,
+ 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11,
+ 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x7F, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xF0, 0x66, 0x66, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x7F, 0xFF, 0xFF, 0xC3,
+ 0xFF, 0xE1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0x81, 0xFF, 0x07, 0x00, 0x00, 0xFF,
+ 0x03, 0xFF, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x03, 0xFF, 0x81, 0xFF, 0xFF, 0x06, 0x60,
+ 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x00, 0x37, 0x77, 0xFF, 0x00, 0x00, 0x01, 0xFF, 0x77, 0x77,
+ 0x77, 0xFF, 0x80, 0x00, 0x03, 0xFF, 0xEE, 0x00, 0x00, 0xFF, 0x80, 0x00, 0x03, 0xFF, 0x33,
+ 0x33, 0x33, 0xFF, 0x80, 0x00, 0x03, 0xFF, 0x00, 0x00, 0xEE, 0xFF, 0xC0, 0x00, 0x03, 0xFF,
+ 0x00, 0x33, 0x33, 0xFF, 0xC0, 0x00, 0x01, 0xFF, 0x33, 0x33, 0x33, 0xFF, 0x00, 0x00, 0x00,
+ 0xFF, 0x0E, 0xEE, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x7F, 0x33, 0x33, 0x33, 0xFC, 0x00, 0x00,
+ 0x00, 0x7F, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x33, 0x33, 0xFC, 0x00,
+ 0x00, 0x00, 0x7F, 0x33, 0x33, 0x33, 0xFC, 0x00, 0x00, 0x00, 0x7F, 0xEE, 0x0E, 0xEE, 0xFC,
+ 0x00, 0x00, 0x00, 0x7F, 0x33, 0x33, 0x33, 0xFC, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00,
+ 0xFC, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x33, 0x33, 0xFC, 0x00, 0x00, 0x00, 0x7F, 0x33, 0x33,
+ 0x33, 0xFC, 0x00, 0x00, 0x00, 0x7F, 0x0E, 0xEE, 0x0E, 0xFC, 0x00, 0x00, 0x00, 0x7F, 0x33,
+ 0x33, 0x33, 0xFC, 0x00, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x7F,
+ 0x40, 0x33, 0x33, 0xFC, 0x00, 0x00, 0x00, 0x7F, 0x33, 0x33, 0x33, 0xFC, 0x00, 0x00, 0x00,
+ 0xFF, 0x00, 0x0E, 0x00, 0xFC, 0x00, 0x00, 0x01, 0xFF, 0x33, 0x33, 0x33, 0xFE, 0x00, 0x00,
+ 0x03, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x87, 0xFF, 0xFF, 0xF0, 0x33, 0x33, 0xFF, 0xFF,
+ 0x87, 0xFF, 0xFF, 0x33, 0x33, 0x33, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0x00, 0x00, 0x04, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x33, 0x33, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x5D, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x22, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x11, 0x11, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x12, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x31, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x33,
+ 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x31, 0x22, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01, 0x33, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x13, 0x33, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x13, 0x33, 0x12, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x33, 0x12, 0x22, 0x22, 0x22, 0x22, 0x22, 0x13, 0x33,
+ 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x33, 0x12, 0x22, 0x22,
+ 0x22, 0x22, 0x22, 0x13, 0x31, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x33, 0x31, 0x11, 0x11, 0x11, 0x11, 0x11, 0x33, 0x31, 0x22, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x31,
+ 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x33, 0x33, 0x33,
+ 0x33, 0x33, 0x33, 0x33, 0x12, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x13, 0x31, 0x11, 0x11, 0x11, 0x11, 0x11, 0x33, 0x12, 0x22, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x13, 0x33, 0x12, 0x22, 0x22, 0x22, 0x13, 0x33, 0x12,
+ 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, 0x11,
+ 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x43, 0x12, 0x20, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x14, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x44, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x12, 0x20, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x14, 0x44, 0x43, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x44,
+ 0x44, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x44, 0x49, 0x99, 0x99, 0x99,
+ 0x99, 0x99, 0x99, 0x99, 0x44, 0x44, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x12, 0x20, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x14, 0x44, 0x43, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x44,
+ 0x44, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x44, 0x49, 0x99, 0x99, 0x99,
+ 0x99, 0x99, 0x99, 0x99, 0x44, 0x44, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x12, 0x20, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x14, 0x44, 0x43, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x44,
+ 0x44, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x44, 0x49, 0x99, 0x99, 0x99,
+ 0x99, 0x99, 0x99, 0x99, 0x44, 0x44, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x12, 0x20, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x14, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x44, 0x44, 0x44, 0x44, 0x44,
+ 0x44, 0x44, 0x44, 0x44, 0x44, 0x43, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x33, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x33, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+#define DATETIME_FORMAT "This file is dated %s for %s\r"
+#define MAXDATETIME "60056/05/28 05:36:11"
+#define MINDATETIME "1601/01/01 00:00:00"
+#define Y2KDATETIME "2000/01/01 00:00:00"
+#define Y1KDATETIME "1999/12/31 23:59:59"
+#define MAXTIMESTAMP 0xFFFFFFFF
+#define MINTIMESTAMP 0x00000000
+#define TIMESTAMP_HI 0x01BF53EB
+#define Y2KTIMESTAMP_LO 0x256D4000
+#define Y1KTIMESTAMP_LO 0x24D4A980
+
+BOOL (*CreateHardLinkA)(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES);
+BOOL (*CreateSymbolicLinkA)(LPCSTR, LPCSTR, DWORD);
+
+#endif
+
+#endif
diff --git a/setter/win32.lk1 b/setter/win32.lk1
index 2195538..734e276 100644
--- a/setter/win32.lk1
+++ b/setter/win32.lk1
@@ -1,2 +1,2 @@
-FIL main.obj,win32.obj
+FIL dos.obj,macos.obj,main.obj,os2_16.obj,os2_32.obj,unix.obj,win32.obj
diff --git a/setter/win32.mk b/setter/win32.mk
index 0a81edc..88da554 100644
--- a/setter/win32.mk
+++ b/setter/win32.mk
@@ -1,3 +1,3 @@
-project : C:\dic\win32.exe .SYMBOLIC
+project : c:\setter\win32.exe .SYMBOLIC
-!include C:\dic\win32.mk1
+!include c:\setter\win32.mk1
diff --git a/setter/win32.mk1 b/setter/win32.mk1
index 60119c0..a7474fb 100644
--- a/setter/win32.mk1
+++ b/setter/win32.mk1
@@ -1,21 +1,55 @@
!define BLANK ""
-C:\dic\main.obj : C:\dic\main.c .AUTODEPEND
- @C:
- cd C:\dic
- *wcc386 main.c -i="C:\WATCOM/h;C:\WATCOM/h/nt" -w4 -e25 -zq -od -d2 -3r -bt&
-=nt -fo=.obj -mf
+c:\setter\dos.obj : c:\setter\dos.c .AUTODEPEND
+ @c:
+ cd c:\setter
+ *wcc386 dos.c -i=C:\WATCOM\h;C:\WATCOM\h\nt -w4 -e25 -zq -od -d2 -5r -bt=nt&
+ -mf
-C:\dic\win32.obj : C:\dic\win32.c .AUTODEPEND
- @C:
- cd C:\dic
- *wcc386 win32.c -i="C:\WATCOM/h;C:\WATCOM/h/nt" -w4 -e25 -zq -od -d2 -3r -b&
-t=nt -fo=.obj -mf
+c:\setter\macos.obj : c:\setter\macos.c .AUTODEPEND
+ @c:
+ cd c:\setter
+ *wcc386 macos.c -i=C:\WATCOM\h;C:\WATCOM\h\nt -w4 -e25 -zq -od -d2 -5r -bt=&
+nt -mf
-C:\dic\win32.exe : C:\dic\main.obj C:\dic\win32.obj C:\dic\consts.h C:\dic\d&
-efs.h C:\dic\main.h .AUTODEPEND
- @C:
- cd C:\dic
- @%write win32.lk1 FIL main.obj,win32.obj
+c:\setter\main.obj : c:\setter\main.c .AUTODEPEND
+ @c:
+ cd c:\setter
+ *wcc386 main.c -i=C:\WATCOM\h;C:\WATCOM\h\nt -w4 -e25 -zq -od -d2 -5r -bt=n&
+t -mf
+
+c:\setter\os2_16.obj : c:\setter\os2_16.c .AUTODEPEND
+ @c:
+ cd c:\setter
+ *wcc386 os2_16.c -i=C:\WATCOM\h;C:\WATCOM\h\nt -w4 -e25 -zq -od -d2 -5r -bt&
+=nt -mf
+
+c:\setter\os2_32.obj : c:\setter\os2_32.c .AUTODEPEND
+ @c:
+ cd c:\setter
+ *wcc386 os2_32.c -i=C:\WATCOM\h;C:\WATCOM\h\nt -w4 -e25 -zq -od -d2 -5r -bt&
+=nt -mf
+
+c:\setter\unix.obj : c:\setter\unix.c .AUTODEPEND
+ @c:
+ cd c:\setter
+ *wcc386 unix.c -i=C:\WATCOM\h;C:\WATCOM\h\nt -w4 -e25 -zq -od -d2 -5r -bt=n&
+t -mf
+
+c:\setter\win32.obj : c:\setter\win32.c .AUTODEPEND
+ @c:
+ cd c:\setter
+ *wcc386 win32.c -i=C:\WATCOM\h;C:\WATCOM\h\nt -w4 -e25 -zq -od -d2 -5r -bt=&
+nt -mf
+
+c:\setter\win32.exe : c:\setter\dos.obj c:\setter\macos.obj c:\setter\main.o&
+bj c:\setter\os2_16.obj c:\setter\os2_32.obj c:\setter\unix.obj c:\setter\wi&
+n32.obj c:\setter\consts.h c:\setter\defs.h c:\setter\dos.h c:\setter\dosos2&
+.h c:\setter\macos.h c:\setter\main.h c:\setter\os2_16.h c:\setter\os2_32.h &
+c:\setter\win32.h .AUTODEPEND
+ @c:
+ cd c:\setter
+ @%write win32.lk1 FIL dos.obj,macos.obj,main.obj,os2_16.obj,os2_32.obj,unix&
+.obj,win32.obj
@%append win32.lk1
!ifneq BLANK ""
*wlib -q -n -b win32.imp
@@ -24,5 +58,6 @@ efs.h C:\dic\main.h .AUTODEPEND
!ifneq BLANK ""
@%append win32.lk1 op resource=
!endif
- *wlink name win32 d all SYS nt op m op maxe=25 op q op symf @win32.lk1
+ *wlink name win32 d all op inc SYS nt op m op maxe=25 op q op symf @win32.l&
+k1
diff --git a/setter/win32.tgt b/setter/win32.tgt
index a00673f..af58f7b 100644
--- a/setter/win32.tgt
+++ b/setter/win32.tgt
@@ -12,7 +12,7 @@ NEXE
3
WString
5
-nc2eo
+nc2en
1
0
1
@@ -42,7 +42,7 @@ WVList
0
10
WPickList
-7
+18
11
MItem
3
@@ -53,143 +53,317 @@ WString
COBJ
13
WVList
-2
-14
-MRState
-15
-WString
-3
-WCC
-16
-WString
-33
-??2??80386 Register based calling
-1
-1
-17
-MRState
-18
-WString
-3
-WCC
-19
-WString
-39
-??2??Pentium Pro Register based calling
-1
0
-20
+14
WVList
0
-1
1
1
0
+15
+MItem
+5
+dos.c
+16
+WString
+4
+COBJ
+17
+WVList
+0
+18
+WVList
+0
+11
+1
+1
+0
+19
+MItem
+7
+macos.c
+20
+WString
+4
+COBJ
21
+WVList
+0
+22
+WVList
+0
+11
+1
+1
+0
+23
MItem
6
main.c
-22
+24
WString
4
COBJ
-23
+25
WVList
0
-24
+26
WVList
0
11
1
1
0
-25
+27
+MItem
+8
+os2_16.c
+28
+WString
+4
+COBJ
+29
+WVList
+0
+30
+WVList
+0
+11
+1
+1
+0
+31
+MItem
+8
+os2_32.c
+32
+WString
+4
+COBJ
+33
+WVList
+0
+34
+WVList
+0
+11
+1
+1
+0
+35
+MItem
+6
+unix.c
+36
+WString
+4
+COBJ
+37
+WVList
+0
+38
+WVList
+0
+11
+1
+1
+0
+39
MItem
7
win32.c
-26
+40
WString
4
COBJ
-27
+41
WVList
0
-28
+42
WVList
0
11
1
1
0
-29
+43
MItem
3
*.h
-30
+44
WString
3
NIL
-31
+45
WVList
0
-32
+46
WVList
0
-1
1
1
0
-33
+47
MItem
8
consts.h
-34
+48
WString
3
NIL
-35
+49
WVList
0
-36
+50
WVList
0
-29
+43
1
1
0
-37
+51
MItem
6
defs.h
-38
+52
WString
3
NIL
-39
+53
WVList
0
-40
+54
WVList
0
-29
+43
1
1
0
-41
+55
+MItem
+5
+dos.h
+56
+WString
+3
+NIL
+57
+WVList
+0
+58
+WVList
+0
+43
+1
+1
+0
+59
+MItem
+8
+dosos2.h
+60
+WString
+3
+NIL
+61
+WVList
+0
+62
+WVList
+0
+43
+1
+1
+0
+63
+MItem
+7
+macos.h
+64
+WString
+3
+NIL
+65
+WVList
+0
+66
+WVList
+0
+43
+1
+1
+0
+67
MItem
6
main.h
-42
+68
WString
3
NIL
+69
+WVList
+0
+70
+WVList
+0
+43
+1
+1
+0
+71
+MItem
+8
+os2_16.h
+72
+WString
+3
+NIL
+73
+WVList
+0
+74
+WVList
+0
+43
+1
+1
+0
+75
+MItem
+8
+os2_32.h
+76
+WString
+3
+NIL
+77
+WVList
+0
+78
+WVList
+0
+43
+1
+1
+0
+79
+MItem
+7
+win32.h
+80
+WString
+3
+NIL
+81
+WVList
+0
+82
+WVList
+0
43
-WVList
-0
-44
-WVList
-0
-29
1
1
0
diff --git a/setter/win32.wpj b/setter/win32.wpj
index 4739264..f576345 100644
--- a/setter/win32.wpj
+++ b/setter/win32.wpj
@@ -4,10 +4,10 @@ projectIdent
VpeMain
1
WRect
-1504
-1490
+0
+0
7680
-9220
+9200
2
MProject
3
@@ -28,16 +28,16 @@ WVList
VComponent
8
WRect
-216
-220
-5712
-4330
+0
+0
+5700
+4280
0
0
9
WFileName
9
win32.tgt
-0
-2
+4
+10
7