Copying to System32\drivers

Hi.

I have a problem I was wondering if someone could help me with. I need to copy (only copy) two driver files to the System32\drivers folder from within a program on a Windows 7 and Windows Vista, 32 and 64 bit operating system.

I can copy the files quite successfully from an administrator console, “copy file.sys c:\windows\system32\drivers” and I can quite successfully (after writing a INF) with “rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 c:\my folder\my inf.inf”

However both methods inside a NSIS installer will refuse to work. The same inside an executable. I receive no error and my problem is possibly best demostrated with what happens when I try running an executable with several system(“copy c:\file.sys c:\windows\system32\drivers\file.sys”)

1 file copied.
1 file copied.
Would you like to overwrite file.sys?

After the program has finished executing, the file is no longer there. Almost like Windows has deleted it as soon as the application has ended.

I have tried, an INF installer, installed as the above, the drivers are cross signed, the applications are signed, I have tried system, I have tried CopyFile, I have tried NSIS’s File “/oname=c:\windows.…” file.sys

I am out of ideas and I have so far only found one reference to somebody else have the same problem but his issue was never resolved. I have written some filter drivers which work successfully on the targetted operating system and only need to have their files copied to the system32\driver folder for the program to be complete.

Does anyone reconise this problem and could anyone help?

Thankyou so much.

TBL.

Did you elevate the program to admin status either via it’s property page,
or setting “Run As Admin”?

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.co.uk
Sent: Saturday, November 13, 2010 11:16 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Copying to System32\drivers

Hi.

I have a problem I was wondering if someone could help me with. I need to
copy (only copy) two driver files to the System32\drivers folder from within
a program on a Windows 7 and Windows Vista, 32 and 64 bit operating system.

I can copy the files quite successfully from an administrator console, “copy
file.sys c:\windows\system32\drivers” and I can quite successfully (after
writing a INF) with “rundll32.exe setupapi.dll,InstallHinfSection
DefaultInstall 132 c:\my folder\my inf.inf”

However both methods inside a NSIS installer will refuse to work. The same
inside an executable. I receive no error and my problem is possibly best
demostrated with what happens when I try running an executable with several
system(“copy c:\file.sys c:\windows\system32\drivers\file.sys”)

1 file copied.
1 file copied.
Would you like to overwrite file.sys?

After the program has finished executing, the file is no longer there.
Almost like Windows has deleted it as soon as the application has ended.

I have tried, an INF installer, installed as the above, the drivers are
cross signed, the applications are signed, I have tried system, I have tried
CopyFile, I have tried NSIS’s File “/oname=c:\windows.…” file.sys

I am out of ideas and I have so far only found one reference to somebody
else have the same problem but his issue was never resolved. I have written
some filter drivers which work successfully on the targetted operating
system and only need to have their files copied to the system32\driver
folder for the program to be complete.

Does anyone reconise this problem and could anyone help?

Thankyou so much.

TBL.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

__________ Information from ESET Smart Security, version of virus signature
database 5617 (20101113) __________

The message was checked by ESET Smart Security.

http://www.eset.com

Run as admin. I assumed it made no difference.

I don’t really want ask end users to change the admin status via the property page if possible.

-----Original Message-----
Did you elevate the program to admin status either via it’s property page,
or setting “Run As Admin”?

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.co.uk
Sent: Saturday, November 13, 2010 11:16 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Copying to System32\drivers

Hi.

I have a problem I was wondering if someone could help me with. I need to
copy (only copy) two driver files to the System32\drivers folder from within
a program on a Windows 7 and Windows Vista, 32 and 64 bit operating system.

I can copy the files quite successfully from an administrator console, “copy
file.sys c:\windows\system32\drivers” and I can quite successfully (after
writing a INF) with “rundll32.exe setupapi.dll,InstallHinfSection
DefaultInstall 132 c:\my folder\my inf.inf”

However both methods inside a NSIS installer will refuse to work. The same
inside an executable. I receive no error and my problem is possibly best
demostrated with what happens when I try running an executable with several
system(“copy c:\file.sys c:\windows\system32\drivers\file.sys”)

1 file copied.
1 file copied.
Would you like to overwrite file.sys?

After the program has finished executing, the file is no longer there.
Almost like Windows has deleted it as soon as the application has ended.

I have tried, an INF installer, installed as the above, the drivers are
cross signed, the applications are signed, I have tried system, I have tried
CopyFile, I have tried NSIS’s File “/oname=c:\windows.…” file.sys

I am out of ideas and I have so far only found one reference to somebody
else have the same problem but his issue was never resolved. I have written
some filter drivers which work successfully on the targetted operating
system and only need to have their files copied to the system32\driver
folder for the program to be complete.

Does anyone reconise this problem and could anyone help?

Thankyou so much.

TBL.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

__________ Information from ESET Smart Security, version of virus signature
database 5617 (20101113) __________

The message was checked by ESET Smart Security.

http://www.eset.com

Hi,

use procmon and then you will see the reason of the failure.
http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

Calin

----- Original Message ----
From: “xxxxx@hotmail.co.uk
To: Windows System Software Devs Interest List
Sent: Sat, November 13, 2010 7:50:01 PM
Subject: RE:[ntdev] Copying to System32\drivers

Run as admin. I assumed it made no difference.

I don’t really want ask end users to change the admin status via the property
page if possible.

-----Original Message-----
Did you elevate the program to admin status either via it’s property page,
or setting “Run As Admin”?

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.co.uk
Sent: Saturday, November 13, 2010 11:16 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Copying to System32\drivers

Hi.

I have a problem I was wondering if someone could help me with. I need to
copy (only copy) two driver files to the System32\drivers folder from within
a program on a Windows 7 and Windows Vista, 32 and 64 bit operating system.

I can copy the files quite successfully from an administrator console, “copy
file.sys c:\windows\system32\drivers” and I can quite successfully (after
writing a INF) with “rundll32.exe setupapi.dll,InstallHinfSection
DefaultInstall 132 c:\my folder\my inf.inf”

However both methods inside a NSIS installer will refuse to work. The same
inside an executable. I receive no error and my problem is possibly best
demostrated with what happens when I try running an executable with several
system(“copy c:\file.sys c:\windows\system32\drivers\file.sys”)

1 file copied.
1 file copied.
Would you like to overwrite file.sys?

After the program has finished executing, the file is no longer there.
Almost like Windows has deleted it as soon as the application has ended.

I have tried, an INF installer, installed as the above, the drivers are
cross signed, the applications are signed, I have tried system, I have tried
CopyFile, I have tried NSIS’s File “/oname=c:\windows.…” file.sys

I am out of ideas and I have so far only found one reference to somebody
else have the same problem but his issue was never resolved. I have written
some filter drivers which work successfully on the targetted operating
system and only need to have their files copied to the system32\driver
folder for the program to be complete.

Does anyone reconise this problem and could anyone help?

Thankyou so much.

TBL.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Information from ESET Smart Security, version of virus signature
database 5617 (20101113)


The message was checked by ESET Smart Security.

http://www.eset.com


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

So, what is the reason for the failure?

“Calin Iaru” wrote in message news:xxxxx@ntdev…
> Hi,
>
> use procmon and then you will see the reason of the failure.
> http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx
>
> Calin
>
>
> ----- Original Message ----
> From: “xxxxx@hotmail.co.uk
> To: Windows System Software Devs Interest List
> Sent: Sat, November 13, 2010 7:50:01 PM
> Subject: RE:[ntdev] Copying to System32\drivers
>
> Run as admin. I assumed it made no difference.
>
> I don’t really want ask end users to change the admin status via the property
> page if possible.
>
> -----Original Message-----
> Did you elevate the program to admin status either via it’s property page,
> or setting “Run As Admin”?
>
> Gary G. Little
> H (952) 223-1349
> C (952) 454-4629
> xxxxx@comcast.net
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> xxxxx@hotmail.co.uk
> Sent: Saturday, November 13, 2010 11:16 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Copying to System32\drivers
>
> Hi.
>
> I have a problem I was wondering if someone could help me with. I need to
> copy (only copy) two driver files to the System32\drivers folder from within
> a program on a Windows 7 and Windows Vista, 32 and 64 bit operating system.
>
> I can copy the files quite successfully from an administrator console, “copy
> file.sys c:\windows\system32\drivers” and I can quite successfully (after
> writing a INF) with “rundll32.exe setupapi.dll,InstallHinfSection
> DefaultInstall 132 c:\my folder\my inf.inf”
>
> However both methods inside a NSIS installer will refuse to work. The same
> inside an executable. I receive no error and my problem is possibly best
> demostrated with what happens when I try running an executable with several
> system(“copy c:\file.sys c:\windows\system32\drivers\file.sys”)
>
> 1 file copied.
> 1 file copied.
> Would you like to overwrite file.sys?
>
> After the program has finished executing, the file is no longer there.
> Almost like Windows has deleted it as soon as the application has ended.
>
> I have tried, an INF installer, installed as the above, the drivers are
> cross signed, the applications are signed, I have tried system, I have tried
> CopyFile, I have tried NSIS’s File “/oname=c:\windows.…” file.sys
>
> I am out of ideas and I have so far only found one reference to somebody
> else have the same problem but his issue was never resolved. I have written
> some filter drivers which work successfully on the targetted operating
> system and only need to have their files copied to the system32\driver
> folder for the program to be complete.
>
> Does anyone reconise this problem and could anyone help?
>
> Thankyou so much.
>
> TBL.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> Information from ESET Smart Security, version of virus signature
> database 5617 (20101113)

>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
>
>
>

xxxxx@hotmail.co.uk wrote:

I have a problem I was wondering if someone could help me with. I need to copy (only copy) two driver files to the System32\drivers folder from within a program on a Windows 7 and Windows Vista, 32 and 64 bit operating system.

I can copy the files quite successfully from an administrator console, “copy file.sys c:\windows\system32\drivers” and I can quite successfully (after writing a INF) with “rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 c:\my folder\my inf.inf”

However both methods inside a NSIS installer will refuse to work. The same inside an executable. I receive no error and my problem is possibly best demostrated with what happens when I try running an executable with several system(“copy c:\file.sys c:\windows\system32\drivers\file.sys”)

After the program has finished executing, the file is no longer there. Almost like Windows has deleted it as soon as the application has ended.

I am out of ideas and I have so far only found one reference to somebody else have the same problem but his issue was never resolved.

Does anyone reconise this problem and could anyone help?

Remember: when you run a 32-bit executable on a 64-bit operating system,
all references to “c:\windows\system32” are automatically changed to
c:\windows\syswow64. From your command shell, see if
c:\windows\syswow64\drivers\file.sys happens to exist.

You can temporarily override the file system redirection with the
redundantly named Wow64DisableWow64FsRedirection.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.