Skip to content

Commit

Permalink
[filedisk] Introduce mini-driver entry-point
Browse files Browse the repository at this point in the history
But not used, just yet.
  • Loading branch information
Shao Miller committed Dec 20, 2012
1 parent 23463a9 commit c19796b
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/winvblock/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ extern DRIVER_INITIALIZE WvG4dDriverEntry;
/* From safehook/probe.c */
extern DRIVER_INITIALIZE WvSafeHookDriverEntry;

/* From filedisk/filedisk.c */
extern DRIVER_INITIALIZE WvFilediskDriverEntry;

/** Public objects */
DRIVER_OBJECT * WvDriverObj;
UINT32 WvFindDisk;
Expand Down
43 changes: 43 additions & 0 deletions src/winvblock/filedisk/filedisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ extern VOID WvFilediskStopImpersonating(void);
extern NTSTATUS STDCALL WvFilediskCreateClientSecurity(OUT PVOID *);
extern VOID STDCALL WvFilediskDeleteClientSecurity(IN OUT PVOID *);

/** Function declarations */
DRIVER_INITIALIZE WvFilediskDriverEntry;

/** Private function declarations. */
static WVL_F_DISK_IO WvFilediskIo_;
static NTSTATUS STDCALL WvFilediskPnpQueryId_(
Expand All @@ -68,8 +71,48 @@ static BOOLEAN STDCALL WvFilediskHotSwap_(
);
static WVL_F_THREAD_ITEM WvFilediskHotSwapThread_;

/** Objects */
static S_WVL_MINI_DRIVER * WvFilediskMiniDriver;

/** Exported function definitions. */

/**
* The mini-driver entry-point
*
* @param DriverObject
* The driver object provided by the caller
*
* @param RegistryPath
* The Registry path provided by the caller
*
* @return
* The status of the operation
*/
NTSTATUS WvFilediskDriverEntry(
IN DRIVER_OBJECT * drv_obj,
IN UNICODE_STRING * reg_path
) {
NTSTATUS status;

/* Register this mini-driver */
status = WvlRegisterMiniDriver(
&WvFilediskMiniDriver,
drv_obj,
/* TODO */
0 /* WvFilediskDriveDevice */,
0 /* WvFilediskUnload */
);
if (!NT_SUCCESS(status))
goto err_register;
ASSERT(WvFilediskMiniDriver);

return STATUS_SUCCESS;

err_register:

return status;
}

/* Attach a file as a disk, based on an IRP. */
NTSTATUS STDCALL WvFilediskAttach(IN PIRP irp) {
PCHAR buf = irp->AssociatedIrp.SystemBuffer;
Expand Down

0 comments on commit c19796b

Please sign in to comment.