From: Moulefrite on
Hi Don Burn and thank you for your reply,

I have tested the F8 Mode and now the driver has been installed correctly,
My problem now, is I don't have debugView informations appears when I launch
the remote debug ( remote debug from debugView v 4.74), which work fine with
XP 64 but not Vista and Seven 64 (even with firewall disabled).

I don't know why, and normally driver works fine because I can connect the
reader to a smartcard.

Thanks a lot for your help.

SomeOne could gave me a tools like usbMonitor for visualise bulk IN/OUT frame.
and a tool for debug my sourceCode ( like softIce for XP and older).

Regards,


"Don Burn" wrote:

> Yes if you are going for WHQL you should use the latest WDK. Your build
> environment is correct by using the oldest 64-bit OS you will support
> all of them. I suspect your install problem is that 64-bit drivers
> must have a digital signature to load. Try having Windbg connected and
> boot choosing the F8 option to ignore signatures and see if that allows
> the driver to load.
>
> If you are not doing stupid things like passing 32-bit pointers in IOCTL
> data you should not need to modify your driver for 64-bit. You may need
> to in order to pass WHQL.
>
>
> Don Burn (MVP, Windows DKD)
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
>
>
> "Moulefrite" <Moulefrite(a)discussions.microsoft.com> wrote in message
> news:E6180A95-8A30-4F1D-8EE0-05E24B764A01(a)microsoft.com:
>
> > Hi all,
> > I have a project where it's necessary to "upgrade" sourceCode of
> > smartcardReader driver for pass WHQL certification.
> > This driver works fine in XP 32 bits.
> > Someone can explain me differents steps for finish this project.
> > For the moment :
> > _ I have updated the .inf file for execute "AMD64" routine.
> > _ Recomplied the sourceCode and installed to XP x64 bit, and driver seems to
> > be work.
> >
> > Someone could confirm me that for compile a driver 64 bit Vista Seven, it's
> > necessary to build it with "WDK 7600 >> build environnement >> Windows Server
> > 2003" and select "X64 Free or Checked" for generate "wnet64" directory ?
> >
> > If I use a computer with Intel processor, I can compile the driver with X64
> > ? or necessarily with IA64 ?
> >
> > I have an other problem, I have compiled a "wnet64" drivers that work with
> > XP 64bit, but when I try to install it to Vista I have an error code 39 and
> > the same error status with seven (value 52)
> > Even if I remove the integrity verification signature drivers, result is the
> > same.
> > Some one have an idea ?
> >
> > I have read MSDN but I don't know if this driver need some rewrite for work
> > with Vista, Seven OS or just need a particular compilation.
> > For exemple this link found in other thread :
> > http://msdn.microsoft.com/en-us/library/ff545635%28v=VS.85%29.aspx
> > Someone can explain me the different part to rewrite ( ioDeviceControl ? ,
> > inOutBuffer from IRP ?)
> > Interest to use this macro : ULongToHandle(ul) ?
> >
> > Thanks a lot by advance (^_^)
> >
> > ps : Sorry for my poor level in english.
>
> .
>
From: Don Burn on
SoftIce has been gone for a long time, and most of us said good
riddance. The current approach for single machine debugging is to use a
virtual machine for debugging. For the debug output starting with Vista
you have to enable it see http://www.osronline.com/article.cfm?id=295


Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr




"Moulefrite" <Moulefrite(a)discussions.microsoft.com> wrote in message
news:B17F6519-DED2-45CC-9ACC-5C392C3FEA88(a)microsoft.com:

> Hi Don Burn and thank you for your reply,
>
> I have tested the F8 Mode and now the driver has been installed correctly,
> My problem now, is I don't have debugView informations appears when I launch
> the remote debug ( remote debug from debugView v 4.74), which work fine with
> XP 64 but not Vista and Seven 64 (even with firewall disabled).
>
> I don't know why, and normally driver works fine because I can connect the
> reader to a smartcard.
>
> Thanks a lot for your help.
>
> SomeOne could gave me a tools like usbMonitor for visualise bulk IN/OUT frame.
> and a tool for debug my sourceCode ( like softIce for XP and older).
>
> Regards,
>
>
> "Don Burn" wrote:
>
> > Yes if you are going for WHQL you should use the latest WDK. Your build
> > environment is correct by using the oldest 64-bit OS you will support
> > all of them. I suspect your install problem is that 64-bit drivers
> > must have a digital signature to load. Try having Windbg connected and
> > boot choosing the F8 option to ignore signatures and see if that allows
> > the driver to load.
> >
> > If you are not doing stupid things like passing 32-bit pointers in IOCTL
> > data you should not need to modify your driver for 64-bit. You may need
> > to in order to pass WHQL.
> >
> >
> > Don Burn (MVP, Windows DKD)
> > Windows Filesystem and Driver Consulting
> > Website: http://www.windrvr.com
> > Blog: http://msmvps.com/blogs/WinDrvr
> >
> >
> >
> >
> > "Moulefrite" <Moulefrite(a)discussions.microsoft.com> wrote in message
> > news:E6180A95-8A30-4F1D-8EE0-05E24B764A01(a)microsoft.com:
> >
> > > Hi all,
> > > I have a project where it's necessary to "upgrade" sourceCode of
> > > smartcardReader driver for pass WHQL certification.
> > > This driver works fine in XP 32 bits.
> > > Someone can explain me differents steps for finish this project.
> > > For the moment :
> > > _ I have updated the .inf file for execute "AMD64" routine.
> > > _ Recomplied the sourceCode and installed to XP x64 bit, and driver seems to
> > > be work.
> > >
> > > Someone could confirm me that for compile a driver 64 bit Vista Seven, it's
> > > necessary to build it with "WDK 7600 >> build environnement >> Windows Server
> > > 2003" and select "X64 Free or Checked" for generate "wnet64" directory ?
> > >
> > > If I use a computer with Intel processor, I can compile the driver with X64
> > > ? or necessarily with IA64 ?
> > >
> > > I have an other problem, I have compiled a "wnet64" drivers that work with
> > > XP 64bit, but when I try to install it to Vista I have an error code 39 and
> > > the same error status with seven (value 52)
> > > Even if I remove the integrity verification signature drivers, result is the
> > > same.
> > > Some one have an idea ?
> > >
> > > I have read MSDN but I don't know if this driver need some rewrite for work
> > > with Vista, Seven OS or just need a particular compilation.
> > > For exemple this link found in other thread :
> > > http://msdn.microsoft.com/en-us/library/ff545635%28v=VS.85%29.aspx
> > > Someone can explain me the different part to rewrite ( ioDeviceControl ? ,
> > > inOutBuffer from IRP ?)
> > > Interest to use this macro : ULongToHandle(ul) ?
> > >
> > > Thanks a lot by advance (^_^)
> > >
> > > ps : Sorry for my poor level in english.
> >
> > .
> >

From: Moulefrite on
Hi Don Burn and thanks a lot for this link,
Now I can catch debugPrint info with debugView launched in remote debug.

"Don Burn" wrote:

> SoftIce has been gone for a long time, and most of us said good
> riddance. The current approach for single machine debugging is to use a
> virtual machine for debugging. For the debug output starting with Vista
> you have to enable it see http://www.osronline.com/article.cfm?id=295
>
>
> Don Burn (MVP, Windows DKD)
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/WinDrvr
>
>
>
>
> "Moulefrite" <Moulefrite(a)discussions.microsoft.com> wrote in message
> news:B17F6519-DED2-45CC-9ACC-5C392C3FEA88(a)microsoft.com:
>
> > Hi Don Burn and thank you for your reply,
> >
> > I have tested the F8 Mode and now the driver has been installed correctly,
> > My problem now, is I don't have debugView informations appears when I launch
> > the remote debug ( remote debug from debugView v 4.74), which work fine with
> > XP 64 but not Vista and Seven 64 (even with firewall disabled).
> >
> > I don't know why, and normally driver works fine because I can connect the
> > reader to a smartcard.
> >
> > Thanks a lot for your help.
> >
> > SomeOne could gave me a tools like usbMonitor for visualise bulk IN/OUT frame.
> > and a tool for debug my sourceCode ( like softIce for XP and older).
> >
> > Regards,
> >
> >
> > "Don Burn" wrote:
> >
> > > Yes if you are going for WHQL you should use the latest WDK. Your build
> > > environment is correct by using the oldest 64-bit OS you will support
> > > all of them. I suspect your install problem is that 64-bit drivers
> > > must have a digital signature to load. Try having Windbg connected and
> > > boot choosing the F8 option to ignore signatures and see if that allows
> > > the driver to load.
> > >
> > > If you are not doing stupid things like passing 32-bit pointers in IOCTL
> > > data you should not need to modify your driver for 64-bit. You may need
> > > to in order to pass WHQL.
> > >
> > >
> > > Don Burn (MVP, Windows DKD)
> > > Windows Filesystem and Driver Consulting
> > > Website: http://www.windrvr.com
> > > Blog: http://msmvps.com/blogs/WinDrvr
> > >
> > >
> > >
> > >
> > > "Moulefrite" <Moulefrite(a)discussions.microsoft.com> wrote in message
> > > news:E6180A95-8A30-4F1D-8EE0-05E24B764A01(a)microsoft.com:
> > >
> > > > Hi all,
> > > > I have a project where it's necessary to "upgrade" sourceCode of
> > > > smartcardReader driver for pass WHQL certification.
> > > > This driver works fine in XP 32 bits.
> > > > Someone can explain me differents steps for finish this project.
> > > > For the moment :
> > > > _ I have updated the .inf file for execute "AMD64" routine.
> > > > _ Recomplied the sourceCode and installed to XP x64 bit, and driver seems to
> > > > be work.
> > > >
> > > > Someone could confirm me that for compile a driver 64 bit Vista Seven, it's
> > > > necessary to build it with "WDK 7600 >> build environnement >> Windows Server
> > > > 2003" and select "X64 Free or Checked" for generate "wnet64" directory ?
> > > >
> > > > If I use a computer with Intel processor, I can compile the driver with X64
> > > > ? or necessarily with IA64 ?
> > > >
> > > > I have an other problem, I have compiled a "wnet64" drivers that work with
> > > > XP 64bit, but when I try to install it to Vista I have an error code 39 and
> > > > the same error status with seven (value 52)
> > > > Even if I remove the integrity verification signature drivers, result is the
> > > > same.
> > > > Some one have an idea ?
> > > >
> > > > I have read MSDN but I don't know if this driver need some rewrite for work
> > > > with Vista, Seven OS or just need a particular compilation.
> > > > For exemple this link found in other thread :
> > > > http://msdn.microsoft.com/en-us/library/ff545635%28v=VS.85%29.aspx
> > > > Someone can explain me the different part to rewrite ( ioDeviceControl ? ,
> > > > inOutBuffer from IRP ?)
> > > > Interest to use this macro : ULongToHandle(ul) ?
> > > >
> > > > Thanks a lot by advance (^_^)
> > > >
> > > > ps : Sorry for my poor level in english.
> > >
> > > .
> > >
>
> .
>
From: Moulefrite on
Thanks Maxim for your reply,

I noticed that with an OS 64 Bit (XP/Vista/Seven) I have a problem with
deviceIoControl routine ( MAJOR : IRP_MJ_DEVICE_CONTROL).
It appears that IOCTL process are different from 32 bit OS.
It's maybe here that it's necessary to rewrite the code for adapt for 64 bit.
( use this MACRO "ULongToHandle(ul)" and "IoIs32bitProcess" ?)

example extract from MSDN:
##################################################
##################################################
#if defined(_WIN64)
if (IoIs32bitProcess(Irp)) {
PTESTDRV_EVENT_BUFFER32 Buffer32;

if (InputBufferLength < sizeof(TESTDRV_EVENT_BUFFER32)) {
DebugTrace(0, Dbg, "Irp32 : System buffer size is too
small\n", 0);

FsRtlCompleteRequest( Irp, STATUS_INVALID_PARAMETER );
return STATUS_INVALID_PARAMETER;
}
Buffer = &LocalBuffer;
Buffer32 = Irp->AssociatedIrp.SystemBuffer;
Buffer->Handle = (HANDLE)Buffer32->Handle;
Buffer->Key = Buffer32->Key;
}
else {
#endif
####################################################
####################################################

Someone could tell me part mandatory necessary to rewrite for work on 64bit
OSes.

Thanks by advance,

Regards,


"Maxim S. Shatskih" wrote:

> > Someone could confirm me that for compile a driver 64 bit Vista Seven, it's
> > necessary to build it with "WDK 7600 >> build environnement >> Windows Server
> > 2003" and select "X64 Free or Checked" for generate "wnet64" directory ?
>
> I don't know the smartcard drivers in particular, but usually old driver binary (if it is not using some hard undocumented things like EPROCESS structure offsets) just plain work being installed on a new OS.
>
> The major exception are technology changes. For instance, NDIS5 driver will work badly on Vista+, and TDI filters will not filter half of the traffic (with Vista+, not all TCP/IP capable software are TDI clients). So are XPDM -> WDDM.
>
> I don't know whether there was some major technology changes in smartcard stack in Vista+.
>
> > If I use a computer with Intel processor, I can compile the driver with X64
> > ? or necessarily with IA64 ?
>
> IA64 is Itanium. The usual 64-bit machine is x64.
>
> > XP 64bit, but when I try to install it to Vista I have an error code 39 and
> > the same error status with seven (value 52)
>
> Signature issue? try on 32bit Vista.
>
> --
> Maxim S. Shatskih
> Windows DDK MVP
> maxim(a)storagecraft.com
> http://www.storagecraft.com
>
> .
>
From: Maxim S. Shatskih on
> I noticed that with an OS 64 Bit (XP/Vista/Seven) I have a problem with
> deviceIoControl routine ( MAJOR : IRP_MJ_DEVICE_CONTROL).
> It appears that IOCTL process are different from 32 bit OS.

If you use pointers or handles in IOCTL buffers - then yes.

In this case, you must declare 2 structures in your 64bit driver code - one is IOCTL buffer for 32bit clients, another - for 64bit. Like:

typedef struct _IOCTL_BUFFER
{
...
} IOCTL_BUFFER, *PIOCTL_BUFFER;

#ifdef _WIN64

typedef struct _IOCTL_BUFFER32
{
// This is for 32bit clients of 64bit driver
// Here, use VOID *POINTER_32 instead of PVOID and HANDLE
...
} IOCTL_BUFFER32, *PIOCTL_BUFFER32;

#endif

Then the 64bit driver must call IoIs32BitProcess and use one of these structures.

The apps always use IOCTL_BUFFER, both 32 and 64 bit builds.

--
Maxim S. Shatskih

Windows DDK MVP

maxim(a)storagecraft.com

http://www.storagecraft.com