Need to send SMB request from driver

Greetings, this is a newbie sort of question. I have a device driver (a
file system filter driver to be exact) which needs to send requests via
SMB to read or write files using SMB. I am not familiar with the SMB
protocol and I do not know what to do to issue SMB client request from a
device driver.

The questions I have is which alternative is appropriate or better amongst
these scenarios (lets call MYDRV my driver):

  1. MYDRV uses normal open/read/write/close file system calls (same as a
    what a WIN32 user program would use) to do the network file processing

  2. MYDRV talks to the client SMB driver (the Microsoft Workstation
    driver/service) to do the network file processing

  3. MYDRV builds the SMB requests and sends them to the remote server to do
    the network file processing.

Or is there a better alternative?

A few questions on these scenarios are:

Is scenario 1 possible (used CreatFile and WriteFile WIN32 API from the
driver (I kinda doubt it))

In scenario 2, how do I know how to communicate with the Microsoft
WORKSTATION service? If this scenario is the better approach, could
people give me examples of such calls for writing a BLOCK.

In scenario 3, are there Windows libary calls which can be used to do this?

Your help is much appreciated.


Users Guide http://discuss.microsoft.com/archives/mailfaq.html
contains important info including how to unsubscribe. Save time, search
the archives at http://discuss.microsoft.com/archives/index.html

Use ZwXxxFile calls and UNC pathnames.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Mario Fran?ois Jauvin”
To: “Windows File Systems Devs Interest List”
Sent: Monday, January 26, 2004 3:29 AM
Subject: [ntfsd] Need to send SMB request from driver

> Greetings, this is a newbie sort of question. I have a device driver (a
> file system filter driver to be exact) which needs to send requests via
> SMB to read or write files using SMB. I am not familiar with the SMB
> protocol and I do not know what to do to issue SMB client request from a
> device driver.
>
> The questions I have is which alternative is appropriate or better amongst
> these scenarios (lets call MYDRV my driver):
>
> 1. MYDRV uses normal open/read/write/close file system calls (same as a
> what a WIN32 user program would use) to do the network file processing
>
> 2. MYDRV talks to the client SMB driver (the Microsoft Workstation
> driver/service) to do the network file processing
>
> 3. MYDRV builds the SMB requests and sends them to the remote server to do
> the network file processing.
>
> Or is there a better alternative?
>
> A few questions on these scenarios are:
>
> Is scenario 1 possible (used CreatFile and WriteFile WIN32 API from the
> driver (I kinda doubt it))
>
> In scenario 2, how do I know how to communicate with the Microsoft
> WORKSTATION service? If this scenario is the better approach, could
> people give me examples of such calls for writing a BLOCK.
>
> In scenario 3, are there Windows libary calls which can be used to do this?
>
> Your help is much appreciated.
>
> ----------------------------------------------------------------
> Users Guide http://discuss.microsoft.com/archives/mailfaq.html
> contains important info including how to unsubscribe. Save time, search
> the archives at http://discuss.microsoft.com/archives/index.html
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>