1
0
This commit is contained in:
Scott E. Graves
2017-04-05 23:49:49 -05:00
parent 2be0d08359
commit 8834eb76d2
2 changed files with 361 additions and 245 deletions

View File

@@ -61,9 +61,9 @@ class SIADRIVE_DOKAN_EXPORTABLE DriveMountEnded :
public CEvent
{
public:
DriveMountEnded(const SString mountLocation, const NTSTATUS& mountStatus) :
DriveMountEnded(const SString mountLocation, const NTSTATUS& result) :
_mountLocation(mountLocation),
_mountStatus(mountStatus)
_result(result)
{
}
@@ -74,17 +74,17 @@ public:
private:
const SString _mountLocation;
const NTSTATUS _mountStatus;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DriveMountEnded(_mountLocation, _mountStatus));
return std::shared_ptr<CEvent>(new DriveMountEnded(_mountLocation, _result));
}
virtual SString GetSingleLineMessage() const override
{
return L"DriveMountEnded|LOC|" + _mountLocation + L"|STATUS|" + SString::FromInt32(_mountStatus);
return L"DriveMountEnded|LOC|" + _mountLocation + L"|RET|" + SString::FromInt32(_result);
}
};
@@ -153,13 +153,13 @@ class SIADRIVE_DOKAN_EXPORTABLE DokanCreateFile :
public CEvent
{
public:
DokanCreateFile(const SString& filePath, const DWORD& fileAttributesAndFlags, const DWORD& creationDisposition, const ACCESS_MASK& genericDesiredAccess, const NTSTATUS& returnStatus) :
DokanCreateFile(const SString& filePath, const DWORD& fileAttributesAndFlags, const DWORD& creationDisposition, const ACCESS_MASK& genericDesiredAccess, const NTSTATUS& result) :
CEvent(EventLevel::Debug),
_filePath(filePath),
_fileAttributesAndFlags(fileAttributesAndFlags),
_creationDisposition(creationDisposition),
_genericDesiredAccess(genericDesiredAccess),
_returnStatus(returnStatus)
_result(result)
{
}
@@ -174,12 +174,12 @@ private:
const DWORD _fileAttributesAndFlags;
const DWORD _creationDisposition;
const ACCESS_MASK _genericDesiredAccess;
const NTSTATUS _returnStatus;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DokanCreateFile(_filePath, _fileAttributesAndFlags, _creationDisposition, _genericDesiredAccess, _returnStatus));
return std::shared_ptr<CEvent>(new DokanCreateFile(_filePath, _fileAttributesAndFlags, _creationDisposition, _genericDesiredAccess, _result));
}
virtual SString GetSingleLineMessage() const override
@@ -188,7 +188,7 @@ public:
"|ATTR|" + SString::FromUInt32(_fileAttributesAndFlags) +
"|DISP|" + SString::FromUInt32(_creationDisposition) +
"|MASK|" + SString::FromUInt32(_genericDesiredAccess) +
"|RET|" + SString::FromUInt32(_returnStatus);
"|RET|" + SString::FromUInt32(_result);
}
};
@@ -197,13 +197,14 @@ class SIADRIVE_DOKAN_EXPORTABLE DokanFindFiles :
public CEvent
{
public:
DokanFindFiles(const SString& cachePath, const SString& rootPath, const SString& siaQuery, const SString& findFile, const SString& fileName) :
DokanFindFiles(const SString& cachePath, const SString& rootPath, const SString& siaQuery, const SString& findFile, const SString& fileName, const NTSTATUS& result) :
CEvent(EventLevel::Debug),
_cachePath(cachePath),
_rootPath(rootPath),
_siaQuery(siaQuery),
_findFile(findFile),
_fileName(fileName)
_fileName(fileName),
_result(result)
{
}
@@ -218,11 +219,12 @@ private:
const SString _siaQuery;
const SString _findFile;
const SString _fileName;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DokanFindFiles(_cachePath, _rootPath, _siaQuery, _findFile, _fileName));
return std::shared_ptr<CEvent>(new DokanFindFiles(_cachePath, _rootPath, _siaQuery, _findFile, _fileName, _result));
}
virtual SString GetSingleLineMessage() const override
@@ -231,7 +233,8 @@ public:
"|ROOT|" + _rootPath +
"|QUERY|" + _siaQuery +
"|FIND|" + _findFile +
"|FN|" + _fileName;
"|FN|" + _fileName +
"|RET|" + SString::FromUInt32(_result);
}
};
@@ -270,10 +273,11 @@ class SIADRIVE_DOKAN_EXPORTABLE DokanGetFileInformation :
public CEvent
{
public:
DokanGetFileInformation(const SString& cachePath, const SString& fileName, const NTSTATUS& result) :
DokanGetFileInformation(const SString& cachePath, const SString& fileName, const bool& opened, const NTSTATUS& result) :
CEvent(EventLevel::Debug),
_cachePath(cachePath),
_fileName(fileName),
_opened(opened),
_result(result)
{
}
@@ -286,17 +290,21 @@ public:
private:
const SString _cachePath;
const SString _fileName;
const bool _opened;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DokanGetFileInformation(_cachePath, _fileName, _result));
return std::shared_ptr<CEvent>(new DokanGetFileInformation(_cachePath, _fileName, _opened, _result));
}
virtual SString GetSingleLineMessage() const override
{
return L"DokanGetFileInformation|PATH|" + _cachePath + "|FN|" + _fileName + "|RES|" + SString::FromUInt32(_result);
return L"DokanGetFileInformation|PATH|" + _cachePath +
"|FN|" + _fileName +
"|OPN|" + SString::FromBool(_opened) +
"|RES|" + SString::FromUInt32(_result);
}
};
@@ -305,9 +313,11 @@ class SIADRIVE_DOKAN_EXPORTABLE DokanReadFile :
public CEvent
{
public:
DokanReadFile(const SString& cachePath) :
DokanReadFile(const SString& cachePath, const bool& opened, const NTSTATUS& result) :
CEvent(EventLevel::Debug),
_cachePath(cachePath)
_cachePath(cachePath),
_opened(opened),
_result(result)
{
}
@@ -318,27 +328,32 @@ public:
private:
const SString _cachePath;
const bool _opened;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DokanReadFile(_cachePath));
return std::shared_ptr<CEvent>(new DokanReadFile(_cachePath, _opened, _result));
}
virtual SString GetSingleLineMessage() const override
{
return L"DokanReadFile|PATH|" + _cachePath;
return L"DokanReadFile|PATH|" + _cachePath +
"|OPN|" + SString::FromBool(_opened) +
"|RES|" + SString::FromUInt32(_result);
}
};
class SIADRIVE_DOKAN_EXPORTABLE DokanWriteFile :
public CEvent
{
public:
DokanWriteFile(const SString& cachePath) :
DokanWriteFile(const SString& cachePath, const bool& opened, const NTSTATUS& result) :
CEvent(EventLevel::Debug),
_cachePath(cachePath)
_cachePath(cachePath),
_opened(opened),
_result(result)
{
}
@@ -349,16 +364,20 @@ public:
private:
const SString _cachePath;
const bool _opened;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DokanWriteFile(_cachePath));
return std::shared_ptr<CEvent>(new DokanWriteFile(_cachePath, _opened, _result));
}
virtual SString GetSingleLineMessage() const override
{
return L"DokanWriteFile|PATH|" + _cachePath;
return L"DokanWriteFile|PATH|" + _cachePath +
"|OPN|" + SString::FromBool(_opened) +
"|RES|" + SString::FromUInt32(_result);
}
};
@@ -367,9 +386,10 @@ class SIADRIVE_DOKAN_EXPORTABLE DokanSetEndOfFile :
public CEvent
{
public:
DokanSetEndOfFile(const SString& cachePath) :
DokanSetEndOfFile(const SString& cachePath, const NTSTATUS& result) :
CEvent(EventLevel::Debug),
_cachePath(cachePath)
_cachePath(cachePath),
_result(result)
{
}
@@ -380,16 +400,18 @@ public:
private:
const SString _cachePath;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DokanSetEndOfFile(_cachePath));
return std::shared_ptr<CEvent>(new DokanSetEndOfFile(_cachePath, _result));
}
virtual SString GetSingleLineMessage() const override
{
return L"DokanSetEndOfFile|PATH|" + _cachePath;
return L"DokanSetEndOfFile|PATH|" + _cachePath +
"|RES|" + SString::FromUInt32(_result);
}
};
@@ -398,9 +420,10 @@ class SIADRIVE_DOKAN_EXPORTABLE DokanFlushFileBuffers :
public CEvent
{
public:
DokanFlushFileBuffers(const SString& cachePath) :
DokanFlushFileBuffers(const SString& cachePath, const NTSTATUS& result) :
CEvent(EventLevel::Debug),
_cachePath(cachePath)
_cachePath(cachePath),
_result(result)
{
}
@@ -411,16 +434,18 @@ public:
private:
const SString _cachePath;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DokanFlushFileBuffers(_cachePath));
return std::shared_ptr<CEvent>(new DokanFlushFileBuffers(_cachePath, _result));
}
virtual SString GetSingleLineMessage() const override
{
return L"DokanFlushFileBuffers|PATH|" + _cachePath;
return L"DokanFlushFileBuffers|PATH|" + _cachePath +
"|RES|" + SString::FromUInt32(_result);
}
};
@@ -429,8 +454,9 @@ class SIADRIVE_DOKAN_EXPORTABLE DokanDeleteDirectory :
public CEvent
{
public:
DokanDeleteDirectory(const SString& cachePath) :
_cachePath(cachePath)
DokanDeleteDirectory(const SString& cachePath, const NTSTATUS& result) :
_cachePath(cachePath),
_result(result)
{
}
@@ -441,16 +467,18 @@ public:
private:
const SString _cachePath;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DokanDeleteDirectory(_cachePath));
return std::shared_ptr<CEvent>(new DokanDeleteDirectory(_cachePath, _result));
}
virtual SString GetSingleLineMessage() const override
{
return L"DokanDeleteDirectory|PATH|" + _cachePath;
return L"DokanDeleteDirectory|PATH|" + _cachePath +
"|RES|" + SString::FromUInt32(_result);
}
};
@@ -459,9 +487,10 @@ class SIADRIVE_DOKAN_EXPORTABLE DokanDeleteFileW :
public CEvent
{
public:
DokanDeleteFileW(const SString& cachePath) :
DokanDeleteFileW(const SString& cachePath, const NTSTATUS& result) :
CEvent(EventLevel::Debug),
_cachePath(cachePath)
_cachePath(cachePath),
_result(result)
{
}
@@ -472,16 +501,18 @@ public:
private:
const SString _cachePath;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DokanDeleteFileW(_cachePath));
return std::shared_ptr<CEvent>(new DokanDeleteFileW(_cachePath, _result));
}
virtual SString GetSingleLineMessage() const override
{
return L"DokanDeleteFileW|PATH|" + _cachePath;
return L"DokanDeleteFileW|PATH|" + _cachePath +
"|RES|" + SString::FromUInt32(_result);
}
};
@@ -490,10 +521,10 @@ class SIADRIVE_DOKAN_EXPORTABLE DokanSetFileAttributesW :
public CEvent
{
public:
DokanSetFileAttributesW(const SString& cachePath, const NTSTATUS& ret) :
DokanSetFileAttributesW(const SString& cachePath, const NTSTATUS& result) :
CEvent(EventLevel::Debug),
_cachePath(cachePath),
_ret(ret)
_result(result)
{
}
@@ -504,17 +535,18 @@ public:
private:
const SString _cachePath;
const NTSTATUS _ret;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DokanSetFileAttributesW(_cachePath, _ret));
return std::shared_ptr<CEvent>(new DokanSetFileAttributesW(_cachePath, _result));
}
virtual SString GetSingleLineMessage() const override
{
return L"DokanSetFileAttributesW|PATH|" + _cachePath + "|RET|" + SString::FromUInt64(_ret);
return L"DokanSetFileAttributesW|PATH|" + _cachePath +
"|RES|" + SString::FromUInt64(_result);
}
};
@@ -585,9 +617,10 @@ class SIADRIVE_DOKAN_EXPORTABLE DokanSetFileTime :
public CEvent
{
public:
DokanSetFileTime(const SString& cachePath) :
DokanSetFileTime(const SString& cachePath, const NTSTATUS& result) :
CEvent(EventLevel::Debug),
_cachePath(cachePath)
_cachePath(cachePath),
_result(result)
{
}
@@ -598,16 +631,18 @@ public:
private:
const SString _cachePath;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DokanSetFileTime(_cachePath));
return std::shared_ptr<CEvent>(new DokanSetFileTime(_cachePath, _result));
}
virtual SString GetSingleLineMessage() const override
{
return L"DokanSetFileTime|PATH|" + _cachePath;
return L"DokanSetFileTime|PATH|" + _cachePath +
"|RES|" + SString::FromUInt64(_result);
}
};
@@ -616,9 +651,10 @@ class SIADRIVE_DOKAN_EXPORTABLE DokanSetAllocationSize :
public CEvent
{
public:
DokanSetAllocationSize(const SString& cachePath) :
DokanSetAllocationSize(const SString& cachePath, const NTSTATUS& result) :
CEvent(EventLevel::Debug),
_cachePath(cachePath)
_cachePath(cachePath),
_result(result)
{
}
@@ -629,16 +665,18 @@ public:
private:
const SString _cachePath;
const NTSTATUS _result;
public:
virtual std::shared_ptr<CEvent> Clone() const override
{
return std::shared_ptr<CEvent>(new DokanSetAllocationSize(_cachePath));
return std::shared_ptr<CEvent>(new DokanSetAllocationSize(_cachePath, _result));
}
virtual SString GetSingleLineMessage() const override
{
return L"DokanSetAllocationSize|PATH|" + _cachePath;
return L"DokanSetAllocationSize|PATH|" + _cachePath +
"|RES|" + SString::FromUInt64(_result);
}
};