docs: document win32

This commit is contained in:
d0p1 🏳️‍⚧️ 2024-09-13 13:06:48 +02:00
parent 8fdb8beb12
commit 560a5000da
3 changed files with 57 additions and 1 deletions

View file

@ -23,6 +23,16 @@ static int inode = -1;
static int block = -1;
static int super = 0;
static const struct {
int flag;
char *name;
} flags[] = {
{STPDFS_INO_FLAG_ALOC, "ALLOCATED"},
{STPDFS_INO_FLAG_ENC, "XCHACHA12"},
{STPDFS_INO_FLAG_LZP, "LZP"},
{0, NULL}
};
#ifdef HAVE_STRUCT_OPTION
static struct option long_options[] = {
{"help", no_argument, 0, 'h'},
@ -81,7 +91,15 @@ inspect(void)
printf(" nlink: %hu\n", ip->inode.nlink);
printf(" uid: %hx\n", ip->inode.uid);
printf(" gid: %hx\n", ip->inode.gid);
printf(" flags: %hx\n", ip->inode.flags);
printf(" flags: ");
for (idx = 0; flags[idx].name != NULL; idx++)
{
if (ip->inode.flags & flags[idx].flag)
{
printf("%s ", flags[idx].name);
}
}
printf("\n");
printf(" size: %u\n", ip->inode.size);
for (idx = 0; idx < 10; idx++)
{

23
win32/create.c Normal file
View file

@ -0,0 +1,23 @@
#include <ntddk.h>
#include <ntifs.h>
#include <wdf.h>
#include <ntddscsi.h>
#include <scsi.h>
#include <ntddcdrm.h>
#include <ntdddisk.h>
#include <ntddstor.h>
#include <ntintsafe.h>
typedef struct _VOLUME_DEVICE_OBJECT {
DEVICE_OBJECT DeviceObject;
} VOLUME_DEVICE_OBJECT;
typedef VOLUME_DEVICE_OBJECT *PVOLUME_DEVICE_OBJECT;
_Function_class_(IRP_MJ_CREATE)
_Function_class_(DRIVER_DISPATCH)
NTSTATUS
StpdFsdCreate(_In_ PVOLUME_DEVICE_OBJECT VolumeDeviceObject, _Inout_ PIRP Irp)
{
return (0);
}

View file

@ -14,6 +14,11 @@ DRIVER_INITIALIZE DriverEntry;
PDEVICE_OBJECT StpdDiskFileSystemDeviceObject;
/**
* Unload routine for StpdFS.
*
* \param DriverObject pointer to driver object.
*/
VOID
StpdUnload(_In_ PDRIVER_OBJECT DriverObject)
{
@ -22,6 +27,14 @@ StpdUnload(_In_ PDRIVER_OBJECT DriverObject)
KdPrintEx((DPFLTR_IHVDRIVER_ID, DPFLTR_INFO_LEVEL, "StupidFS: Driver unload\n"));
}
/**
* Initialization routine for the StupidFS device driver.
*
* \param DriverObject Pointer to driver object
* \param RegistryPath XXX
*
* \return status
*/
NTSTATUS
DriverEntry(
_In_ PDRIVER_OBJECT DriverObject,
@ -49,6 +62,8 @@ DriverEntry(
#pragma prefast(disable:28169, "these are all correct")
#pragma prefast(disable:28175, "this is a filesystem, touching FastIoDispatch is allowed")
DriverObject->DriverUnload = StpdUnload;
DriverObject->MajorFunction[IRP_MJ_CREATE] = NULL;
#pragma prefast(pop)
return status;
}