How to copy a file in kernel mode?

Hi all,

Is there any function in kernel can copy a file to another file?

Thanks for help.

Laura


Do You Yahoo!?

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

READ from source file , then write to target. What kind of questions your
asking anyway ? They are ELEMENTARY. Get the DDK, read its help, then read
it again. Then read the header files, and what you dont find there, you
should not use in your drivers.

----- Original Message -----
From: “gaoren”
To: “File Systems Developers”
Sent: Tuesday, July 09, 2002 5:49 PM
Subject: [ntfsd] How to copy a file in kernel mode?

> Hi all,
>
> Is there any function in kernel can copy a file to another file?
>
> Thanks for help.
>
> Laura
>
>
> _________________________________________________________
>
> 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%%
>

No – you have to do it yourself using the basic read and write
functions that are available(ZwReadFile, ZwWriteFile, or build your own
irps).

Molly

This posting is provided “AS IS” with no warranties and confers no
rights.

-----Original Message-----
From: gaoren [mailto:xxxxx@yahoo.ca]
Sent: Tuesday, July 09, 2002 7:50 AM
To: File Systems Developers
Subject: [ntfsd] How to copy a file in kernel mode?

Hi all,

Is there any function in kernel can copy a file to another file?

Thanks for help.

Laura


Do You Yahoo!?

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


You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

1 Like

No, there is no such a function like CopyFile in
the kernel mode. You must do everything by yourself,
but the task is really not trivial if you want to
be “really correct”. You should preserve at least:

  • all data streams
  • file attributes + dates and times
  • extended attributes
  • security descriptor

Paul

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of gaoren
Sent: Tuesday, July 09, 2002 4:50 PM
To: File Systems Developers
Subject: [ntfsd] How to copy a file in kernel mode?

Hi all,

Is there any function in kernel can copy a file to another file?

Thanks for help.

Laura


Do You Yahoo!?

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


You are currently subscribed to ntfsd as: xxxxx@compelson.com
To unsubscribe send a blank email to %%email.unsub%%

Thanks Molly, Dan.

Laura

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Molly Brown
Sent: Tuesday, July 09, 2002 10:54 AM
To: File Systems Developers
Subject: [ntfsd] RE: How to copy a file in kernel mode?

No – you have to do it yourself using the basic read and write
functions that are available(ZwReadFile, ZwWriteFile, or build your own
irps).

Molly

This posting is provided “AS IS” with no warranties and confers no
rights.

-----Original Message-----
From: gaoren [mailto:xxxxx@yahoo.ca]
Sent: Tuesday, July 09, 2002 7:50 AM
To: File Systems Developers
Subject: [ntfsd] How to copy a file in kernel mode?

Hi all,

Is there any function in kernel can copy a file to another file?

Thanks for help.

Laura


Do You Yahoo!?

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


You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@yahoo.ca
To unsubscribe send a blank email to %%email.unsub%%


Do You Yahoo!?

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

RE: [ntfsd] How to copy a file in kernel mode?That is why I am looking for a
function. The file i want to copy may be used by some one else ( kernel or
user mode)
so I’m not sure if i can open it and preserve it. anyway I will try.
Thanks a lot Paul.

Laura
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Pavel Hrdina
Sent: Tuesday, July 09, 2002 11:03 AM
To: File Systems Developers
Subject: [ntfsd] RE: How to copy a file in kernel mode?

No, there is no such a function like CopyFile in
the kernel mode. You must do everything by yourself,
but the task is really not trivial if you want to
be “really correct”. You should preserve at least:

  • all data streams
  • file attributes + dates and times
  • extended attributes
  • security descriptor

Paul

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of gaoren
Sent: Tuesday, July 09, 2002 4:50 PM
To: File Systems Developers
Subject: [ntfsd] How to copy a file in kernel mode?

Hi all,

Is there any function in kernel can copy a file to another file?

Thanks for help.

Laura


Do You Yahoo!?

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


You are currently subscribed to ntfsd as: xxxxx@compelson.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@yahoo.ca
To unsubscribe send a blank email to %%email.unsub%%

If you will open it with FILE_SHARE_READ only, so there is no
updater, I think that you can have no fear about data consistency.
And for the first time you probably can forget the complexity of
such an operation. Default data stream, file attributes and security
descriptor would be enough - EAs and multiple data streams are
used very rarely (EAs comes from OS/2, multiple streams from Mac).

Paul

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of gaoren
Sent: Tuesday, July 09, 2002 5:17 PM
To: File Systems Developers
Subject: [ntfsd] RE: How to copy a file in kernel mode?

That is why I am looking for a function. The file i want to copy may be used
by some one else ( kernel or user mode)
so I’m not sure if i can open it and preserve it. anyway I will try.
Thanks a lot Paul.

Laura

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Pavel Hrdina
Sent: Tuesday, July 09, 2002 11:03 AM
To: File Systems Developers
Subject: [ntfsd] RE: How to copy a file in kernel mode?

No, there is no such a function like CopyFile in
the kernel mode. You must do everything by yourself,
but the task is really not trivial if you want to
be “really correct”. You should preserve at least:

  • all data streams
  • file attributes + dates and times
  • extended attributes
  • security descriptor

Paul

-----Original Message-----
From: xxxxx@lists.osr.com
mailto:xxxxx@lists.osr.com
mailto:xxxxx ]On Behalf Of gaoren
Sent: Tuesday, July 09, 2002 4:50 PM
To: File Systems Developers
Subject: [ntfsd] How to copy a file in kernel mode?

Hi all,

Is there any function in kernel can copy a file to another file?

Thanks for help.

Laura

_________________________________________________________

Do You Yahoo!?

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


You are currently subscribed to ntfsd as: xxxxx@compelson.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@yahoo.ca
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@compelson.com
To unsubscribe send a blank email to %%email.unsub%%</http:></mailto:xxxxx>