How to find files and subfolders under a known folder in kernel?

Dear all,
I met another problem when do file copy or delete in kernel. when I want to
copy a folder or delete a folder in kernel how to get files and subfolders
under the know folder?
say
C:/folderA/file1,
C:/folderA/subfolderA

want to copy C:/folderA to C:/folderB

but don’t know what in folderA then how to get file1 handle and subfolderA
handle?

Thanks a lot

La


Do You Yahoo!?

Get your free @yahoo.com address at http://mail.yahoo.com

roll your own Irp with IRP_MJ_DIRECTORY_CONTROL with IRP_MN_QUERY_DIRECTORY
or use the system provided ZwQueryDirectoryFile function . Youll have most
likely to recurse for subfolders, watch out , the kernel stack is limited.

----- Original Message -----
From: “gaoren”
To: “File Systems Developers”
Sent: Wednesday, July 10, 2002 7:25 PM
Subject: [ntfsd] How to find files and subfolders under a known folder in
kernel?

> Dear all,
> I met another problem when do file copy or delete in kernel. when I want
to
> copy a folder or delete a folder in kernel how to get files and subfolders
> under the know folder?
> say
> C:/folderA/file1,
> C:/folderA/subfolderA
>
> want to copy C:/folderA to C:/folderB
>
> but don’t know what in folderA then how to get file1 handle and subfolderA
> handle?
>
> Thanks a lot
>
> La
>
>
>
> _________________________________________________________
>
> Do You Yahoo!?
>
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@rdsor.ro
> To unsubscribe send a blank email to %%email.unsub%%
>

There is an FAQ on the OSR site about how to enumerate a directory in
the kernel.

Pete

Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com

>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>xxxxx@lists.osr.com] On Behalf Of gaoren
>Sent: Wednesday, July 10, 2002 10:25 AM
>To: File Systems Developers
>Subject: [ntfsd] How to find files and subfolders under a known folder
in
>kernel?
>
>Dear all,
>I met another problem when do file copy or delete in kernel. when I
want
>to
>copy a folder or delete a folder in kernel how to get files and
subfolders
>under the know folder?
>say
>C:/folderA/file1,
>C:/folderA/subfolderA
>
>want to copy C:/folderA to C:/folderB
>
>but don’t know what in folderA then how to get file1 handle and
subfolderA
>handle?
>
>Thanks a lot
>
>La
>
>
>
>_________________________________________________________
>
>Do You Yahoo!?
>
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>To unsubscribe send a blank email to %%email.unsub%%

You do it the same way you would if you were writing a Windows Explorer
work-alike. You enumerate every file and subdirectory and recurse
downwards. Should you be trying to write a device driver with this type of
a design? Maybe the design needs to be revisited.

----- Original Message -----
From: “gaoren”
To: “File Systems Developers”
Sent: Wednesday, July 10, 2002 12:25 PM
Subject: [ntfsd] How to find files and subfolders under a known folder in
kernel?

> Dear all,
> I met another problem when do file copy or delete in kernel. when I want
to
> copy a folder or delete a folder in kernel how to get files and subfolders
> under the know folder?
> say
> C:/folderA/file1,
> C:/folderA/subfolderA
>
> want to copy C:/folderA to C:/folderB
>
> but don’t know what in folderA then how to get file1 handle and subfolderA
> handle?
>
> Thanks a lot
>
> La
>
>
>
> _________________________________________________________
>
> Do You Yahoo!?
>
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@yoshimuni.com
> To unsubscribe send a blank email to %%email.unsub%%
>