Page limit when using GDI to print
Although this is a client side issue, I believe the real issue is a
buffering limit in the printer driver. Since our Unidrv-based printer driver
is the first driver Iâ??ve ever worked on, I am curious if I am diagnosing this
problem correctly and if I understand all possible solutions.
We are experiencing a page limit when using GDI printing. After printing 85
pages from our application, we get a failure. We raised our Unidrv-based
printer memory limit to 2 GByte maximum and printing fails consistently on
the 86th page. This happens whether we print to an external printer or to our
Unidrv-based software PDF printer, i.e. a printer that creates a PDF
document.
When we print from our application using GDI printing, the return value for
the EndPage function for the 86th page is 0cFFFFFFFF, i.e. -1, and
GetLastError returns 0 (zero). We then call AbortDoc. If I modify the code to
allow printing to continue, only the first 85 pages are printed. The same
thing happens on an external printer.
Note, we do not believe that any pages approach the 350 MByte limitation
mentioned in the documentation. Also, if we delete pages at the beginning of
the document, then the document will still print only 85 pages, i.e. some
pages that previously didnâ??t print suddenly print.
Is the only solution to reduce the color-depth the 24 bit color images ouor
application produces, and of course, greatly reduce the size of the images
for gray scale or black and white printing? Then Ican modify the device
context to reduce the memory requirements for each page. Is there anything
else I can do?
If that is the solution, do printers typically use 16 bit color, 8 bit
color, or something else? We do need to be able to print photographs to high
quality printers, but the buik what our application deals with is black and
white documents. If those documents contain a color photograph we do want to
support printing that without such a small page limit. We've heard of
customer documents that exceeded 4000 pages! (Granted, these are quite rare,
but 1000 pages is no unheard of).
Thanks in advance.
P.S. Our printer driver is a Unidrv-based PDF printer driver, i.e. it
produces PDF files. It was built using DDK 3790. We support Windows 2000 and
Windows XP. It was developed using the Unidrv sample code provided in the
DDK.
The printer-generated PDF file is sent to an application we also have
developed, i.e. there is no hardware printer.
-------------------------------------------------------------------------
I posted the message above in the win32.programmer.gdi newsgroup in a post
titled "Page limit when using GDI printing.", and I received the reply below
from Rhett Gong [MSFT]:
Note however, despite his reply, that this is NOT just a Unidrv issue. It
happens when using GDI to print to other printers. I responded in that forum,
and included the calculation that shows that 2 GBytes will handle 85 8.5 inch
by 11 inch 300 DPI 24 bit color images.
(2 to the power 31) / ( (300 DPI * 8.5 I) * ( 300 DPI * 11.0 I) * 24
bits/pixel) ) = 85.0
This is what makes me believe the page limit is related to buffering in the
driver (or at least buffering somewhere).
The issue is that printing doesn't start until EndDoc() is called. Is it
reasonable to raise the driver buffering way above the virtual memory limit?
Is this data all mapped to a file?
I do not want to segement a 1000 page print job into multiple jobs as these
arrive back asynchronously from the Unidrv printer and are loaded into our
application. Having to append these over and over again would annoy most
users.
Note also, there are two separate issues.
1. GDI to other printers.
2. GDI to our Unidrv-based printer.
A solution to either of these would be useful.
Is this a fundamental limitation of GDI printing? (An answer to that would
help me to stop pursuing something with no solution).
-------------------------------------------------------------------------
Hello
From your description, you write a Unidrv by yourself, but you can only
print 86 pages and then EndPage return -1 and not further error code returned
. Based on my
understanding, this is a Printer Driver issue and require debugging into the
printer driver to find out the problem, so I would suggest you post this
question to following
newsgroup:
microsoft.public.development.device.drivers
It is a managed newsgroup. and all DDK issues and driver dev questions are
posted in the newsgroup above.
The reason why we recommend posting appropriately is you will get the most
qualified pool of respondents, and other partners who the newsgroups
regularly can either
share their knowledge or learn from your interaction with us. Also, this is
to make sure that the responders can better track the problem.
Thank you,
Rhett Gong [MSFT]
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp&SD=msdn
This posting is provided "AS IS" with no warranties and confers no rights.
--
You''''re unique, just like everyone else. Tag: Capturing USB port data Tag: 72236
Synchronizing Timers and ISR
I am attempting to synchronize Timer procedures with the ISR. When my
timer expires it should perform operation A. If the ISR runs prior to
that it will perform operation B and cancel the timer. What I am
concerned about is the possiblity that the timer will expire, start
executing, and get interrupted prior to reaching the Critical Section.
In this scenario, Operation B will be performed by the ISR followed by
Operation A by the timer. Is there a method to prevent this from
happening? Thank you. Tag: Capturing USB port data Tag: 72229
sqrt() cos() sin() in kernel mode
Hello All,
I need to perform some calculations in my driver, and I need to call
some advanced math functions like sqrt(), cos() and sin()... I'd like
to know if this is possible ? How to do that ? if these functions
aren't available, can I call them from the user-mode ?
Thanks for your help !
Eric. Tag: Capturing USB port data Tag: 72222
Windows DDK Suite 3.0
hi,, all...
i'm new here...
i'm trying to make an application such as magictune of portrait
displays...
i plant a micro controller in the display.. that is configured i2c
slave device..
connect pin 12, 15 of vga cable to the mcu..
i'm trying to send some simple data to the mcu...
i'm using vc++ 6.0
i found that i need video.h from msdn..
so,, i got windows ddk suite 3.0 and installed it..
the header file, video.h is in
C:\WINDDK\3790\inc\ddk\wxp
and in vc++ 6.0,,
tools -> options..., directories tab..
i put above directory in the list of "include files" section..
then i put
// some header files
#include <video.h>
// some header files
and tried to compile..
then i got 102 errors that all of them came from video.h and videoagp.h
that are newly included headers..
did i do something wrong to configure building environment?
is there some special thing to do in order to compile ddk headers?
thank you very much...
best regards,
/u
---------------
--------------------Configuration: VWCtrl - Win32
Debug--------------------
Compiling...
VWCtrlDlg.cpp
c:\winddk\3790\inc\ddk\wxp\videoagp.h(35) : error C2065:
'PAGP_RESERVE_PHYSICAL' : undeclared identifier
c:\winddk\3790\inc\ddk\wxp\videoagp.h(35) : error C2100: illegal
indirection
c:\winddk\3790\inc\ddk\wxp\videoagp.h(35) : error C2501:
'PHYSICAL_ADDRESS' : missing storage-class or type specifiers
c:\winddk\3790\inc\ddk\wxp\videoagp.h(35) : error C2143: syntax error :
missing ';' before '('
c:\winddk\3790\inc\ddk\wxp\videoagp.h(36) : error C2226: syntax error :
unexpected type 'PVOID'
c:\winddk\3790\inc\ddk\wxp\videoagp.h(40) : error C2059: syntax error :
')'
.
.
.
c:\winddk\3790\inc\ddk\wxp\video.h(1500) : error C2146: syntax error :
missing ';' before identifier 'InterfaceReference'
c:\winddk\3790\inc\ddk\wxp\video.h(1500) : error C2501:
'PINTERFACE_REFERENCE' : missing storage-class or type specifiers
c:\winddk\3790\inc\ddk\wxp\video.h(1500) : fatal error C1003: error
count exceeds 100; stopping compilation
Error executing cl.exe.
VWCtrl.exe - 102 error(s), 0 warning(s)
--------------- Tag: Capturing USB port data Tag: 72220
Correct DDK Windows 2000 SP4
I have Visual Studio 6, my O.S. is Windows 2000 SP4.
According to the MSDN order site the correct DDK for my system is the
Windows Server 2003 SP1 DDK, which I ordered.
My main interest in the DDK was to obtain the Usbview,c source code, however
Usbview.c will not compile on my system, it generates errors.
I have been told by a systems developer that I need the 'Windows 2000 DDK'
in order to compile Usbview.c on my system.
The 'Windows 2000 DDK' is now only available to MSDN subscribers and I am
not yet an MSDN subscriber.
If the above infromation is correct, can anyone here on the forum who has
the Windows 2000 DDK post back with the year(s) and month(s) of the MSDN
subscription CD that included the DDK.
Thank you for your help. Tag: Capturing USB port data Tag: 72217
Migrating from KS1.0 (stream.sys) to AVStream
Hi,
When I have the sources of a driver that currently uses KS1.0 (stream.sys)
is it difficult to rewrite the driver so that it uses AVStream instead?
What would be a good starting point of rewriting the driver?
Does it also effect the application that I'm currently using or do I need to
rewrite the application as well?
Avi Cohen Stuart. Tag: Capturing USB port data Tag: 72214
Problems performing USB Isochronous/Bulk Read/Writes and unplugging device
Hello all, hello Mr. Roberts!
After clearing some general misunderstandings, maybe you could help me
once more with the second part of my former post. I would be very
grateful for your assistance.
I described it as follows:
>Depending on the pipe type I leave the dispatch routine forwarding the
>current Irp and device object to a validation routine for isochronous
>transfers (because they are more complicated) or bulk transfer
>completion routine. Isochronous completion is done as it can be seen
>the original sample. Microsoft did in their samples the validation for
>isochronous and both validation and transaction in the case of bulk
>transfers in the dispatch routine. Although I copied and pasted the
>whole algorithm from their (fine-working [standalone]) drivers, the system
>crashes when I try to perform a bulk/isochronous read or write. What
>rule did I violate?
Moreover I recognized the same crash behaviour when I unplug one or
both devices. I tried to get some debugging messages via DbgView from
Sysinternals, but the system crashes, without storing the information
into the given log file.
I checked the in- and decrements on the stack without result. They seem
okay to me. Since I solely introduced the validation routine for
isochronous transfer and sourced the transfer algorithm of the bulk
transmission out, I assume it must have something to do with the
parameters I forward to these functions. I appreciate your help in
advance, special thanks to Mr. Roberts who helped me this far. Tag: Capturing USB port data Tag: 72211
NDIS driver sample code for SDIO interface
Hi, I am developing a SDIO driver for our chipset. The output from our
chipset is IP datagram carry realtime video. I need to give the IP datagram
to the NDIS protocol stack then pass to Windows CE media player does anybody
have any NDIS example for WinCE I can follow?
I understand how to transfer data via SDIO interface the experience I am
lacking is after I get the data how do I pass to upper layer protocol stack
(NDIS) so when user want to watch live TV using windows media player they
can do it. It should be similar to 802.11 just the out put from our chipset
is IP packets not Ethernet packet Tag: Capturing USB port data Tag: 72209
how do i: import from another loaded driver
I am writing a miniport driver for the SMBus class driver. I need to
call a function defined in SMBClass.sys. The function is defined in
SMB.h, I get link errors, so I thought I could load it dymanically, bu
LoadLibrary dosen't seem to be useable in kernal mode.
How do I call functions in the class driver from my miniport driver?
TIA
Ryan Tag: Capturing USB port data Tag: 72202
NDISProtocol Driver for PPP (WinCE 4.2/5.0)
has anybody developed a NDISProtocol Driver for WinCE 4.2/5.0??? I've done
all the proper step to bind to the PPP but yet when I send the packet to PPP
I never receive the call back... I'm thinking there is issue with the way I
bind or do OpenAdapter... is there specific steps I should take? could
somebody point out a guideline??
would appreciate it... Tag: Capturing USB port data Tag: 72193
Should UsbIntel driver go to D3 or D0 inIdleNotificationRequestComplete
We are making USB image capture device with a driver like UsbIntel.
I added IdleNotification routine to the driver.
A PC pluged in our device wasn't able to suspend sometimes.
My attention is in PoRequestPowerIrp call of
IdleNotificationRequestComplete.
Now our driver code is as below.
powerState.DeviceState = PowerDeviceD0;
PoRequestPowerIrp(
...
IRP_MN_SET_POWER,
powerState,
...
);
When I delete this function call PoRequestPowerIrp,
A PC pluged in our device was able to suspend always.
But My device power is still off.
In IdleNotificationRequestComplete I must know
whether our driver should go to D3 or D0.
Please help me.
Thanks in Advance,
shinji Tag: Capturing USB port data Tag: 72188
Supporting IAMStreamConfig with AVStream
I'm just getting started on an AVStream driver and would like to
support the IAMStreamConfig interface for the purpose of getting and
setting the data format (framerate, size, etc.). Which property set
must be supported for this? Also, will supporting this interface
result in the Video Format tab of the pin properties being activated?
(Don't worry, I'm not going to leave the default property pages in my
final version, but I'd like to get them working for now.) Tag: Capturing USB port data Tag: 72186
Install IFS kit on XP x64
Hi all
I'm trying to install the Windows Server 2003 IFS Dev Kit onto my XP x64
machine, but I keep getting an error when running setup :
"Kitsetup.exe - Entry Point Not Found"
"The procedure entry point ??3@YAXPAX@Z could not be located in the dynamic
link library msvcrt.dll"
I've managed to install the IFS kit on an XP X86 machine without any issues.
Has anyone else come across this problem before ?
Anyone know hot to get around it ?
Cheers
Ged Tag: Capturing USB port data Tag: 72185
oryginal name of the device
Hi.
Can you tell me, please,
how to get device's oryginal name.
The name that is assigned during PnP enumeration.
E.g.:
After I plug FM801 PCI joystick,
I see such in the Device Manager and in the registers.
When I install some driver to it,
I see only new name.
I tried a lot with SetupDi functions
but I could not get the oryginal value.
I thought that getting devices SPDRP_FRIENDLYNAME
property will solve the problem but
in most cases this call fails.
When I was testing WInDriver,
I saw that this tool can see oryginal name
of the device.
Thanks in advance,
Grzegorz Tag: Capturing USB port data Tag: 72181
ICD DDK
Hi all,
I am looking for the ICD DDK. Does someone know where to order or download
it?
best regards
Christian Hartig Tag: Capturing USB port data Tag: 72180
Multiple virtual COM ports.
Hi All,
We use a CDC device implementation( modem), and is making use of
usbser.sys as the communication driver. As per our requirement we need
to emulate multiple virtual COM ports over the usb. (usbser emulates
only 1 com port). Is there a way,by which I could emulate multiple COM
ports,using USBSER.ie can I add an upper filter to usbser,wherein I
create multiple com ports.Does usbser supports this.
Plz help ..................
Thanks in Advance,
Teena. Tag: Capturing USB port data Tag: 72177
Where can I get SMBClass.sys?
I am writing a SMBus miniport driver for the MS SMBus class driver. I
discovered that I don't have the SMBClass.sys file anywhere on my laptop. Any
idea where I can find it and install it?
TIA,
--
Ryan Abrahamson, MCSD.NET
Sr Consultant
Magenic Technologies
MS Gold Certified Partner Tag: Capturing USB port data Tag: 72164
Print a text string that uses True type font
I need to convert True Type Font (TTF) to bitmap and then download it
to the printer. Our printer drivers are a plug-in to minidrivers
(PScript, UniDrv). Is there any documentation available that will help
me accomplish the task?
EngTextOut(...) is one API that I have in my mind but it requires
surface, string, font object, How should I create or get these objects?
Best Regards,
Athar Tag: Capturing USB port data Tag: 72161
One shot capture gives wrong DX GetStatus
When I start capturing in DX with just DSCBSTATUS_CAPTURING (no
|DSCBSTATUS_LOOPING) the GetStatus function is still coming back with the
DSCBSTART_LOOPING state.
I based the driver initially from the MSVAD sample and I am not clear where
this distinction in startup lies. If you have an pointers as to were I could
look to fix this I would greatly appreciate it. Tag: Capturing USB port data Tag: 72159
Help me for driver in Vista Windows
Hello,
thanks for answering to my question :
I installed Windows Vista, but I have two problems, with my sound card,
and with my modem. Both doesn't work by default and I had no problem
with them before in Win XP.. Maybe someone knows, how to install XP
drivers, or where to find drivers for Windows Vista?
My sound card : Creative AudioPCI
My modem: Rockwell HCF V92 56K Speakerphone PCI Modem Tag: Capturing USB port data Tag: 72158
HPET support
1) Does Windows XP provide any support for accessing/using the High
Performace Event Timers (HPET) in the chipset?
2) Will Windoes Vista use the HPET for QueryPerformanceCounter (both uni and
multi-processor HALs)?
3) Does the Windows DDK offer any guidance on writing a driver for the HPET?
I ask these questions because I'm looking for a high resolution timing
solution to monitor performance of a multimedia app. I need a consistant,
reliable timing base to compare against. 1ms resolution is not enough for my
particular application. Tag: Capturing USB port data Tag: 72157
Using NDL/NDIS in winCE driver
Does any one know a documentation describing "NDL" in windows CE?
I am trying to write an NDIS driver for SDIO device.
I have looked at a dll from "Ambicom" and it had the fallowing
exporter functions:
DriverEntry
NDL_Init
NDL_Deinit
NDL_Open
NDL_Close
NDL_Read
NDL_Write
NDL_Seek
NDL_IOControl
NDL_PowerDown
NDL_PowerUp
Does any one know how it is associated to NDIS?
Thanks. Tag: Capturing USB port data Tag: 72153
Slipstreaming Device Drivers into a WIN2K3 installation
I hope this topic is not to far from the purpose of this newsgroup.
I am trying to install WIN2K3 on a new Dell 850 Server. I opted to buy an
Adaptec SATA controller for $100 instead of Dell's for $400, but it may now
be coming back to haunt me. The Dell Server Manager CD does not recognize
the controller and I have been unable to get the drivers for this controller
installed as the 850 does not support a Floppy drive. Can anyone point me in
the direction of a good resource for slipstreaming drivers into a Win2k3
installation?
Thanks Tag: Capturing USB port data Tag: 72152
Bulk and Iso-Transfers in one USB-Driver
Hi all,
I'm searching a reliable way to detect the pipe type of an IRP. I tried
to read this information like Microsoft did in their Bulk Driver Sample
from the DDK.
In the dispatch routine I check for upcoming idle requests. Then I get
the current Irp, the current file object, the pipe information and
that's where I get the current pipe type from. I understood that every
IRP stores information about what transfer type is at hand. Is that
right?
Depending on the pipe type I leave the dispatch routine forwarding the
current Irp and device object to a validation routine for isochronous
transfers (because they are more complicated) or bulk transfer
completion routine. Isochronous completion is done as it can be seen
the original sample. Microsoft did in their samples the validation for
isochronous and both validation and transaction in the case of bulk
transfers in the dispatch routine. Although I copied and pasted the
whole algorithm from their (fine-working single) drivers, the system
crashes when I try to perform a bulk/isochronous read or write. What
rule did I violate?
I'm through with W. Oneys book and the USB specification and the
firmware and the application. Although this work is part of my
internship and I'm (quite) new to this field I'm seriously trying to
get the best out of my work. I appreciate your ideas very, very much! Tag: Capturing USB port data Tag: 72150
DeviceIoControl() in WinCE
Hi,
I am writing a driver which takes in the call to DeviceIoControl() some
structure like below:
stuct someStruct
{
char *in_ptr;
int in_ptr_len;
int num;
char *out_ptr;
int out_ptr_len;
}
where ptr points to some memory. Problem is that DeviceIoControl() just
seems to take a pointer to a buffer (in_ptr and out_ptr), so if now I passed
address of an object of someStruct type, the how can I access data pointed
to by ptr member from inside my driver?
Also is it possible that i allocate memory pointed to by out_ptr in my
driver and still I can access the memory from my application that opens that
driver?
I am using Pocker PC 2003.
Thanks,
Arsalan
Thanks,
Arsalan Tag: Capturing USB port data Tag: 72149
Adding USB to BDA Driver Linking ERROR!
Hi All,
I adding USB interface to BDA Driver but Linking ERROR! Below is my sources
from DDK BDA samples
IF 0
Copyright (C) Microsoft Corporation, 1999 - 1999
Module Name:
sources.
!ENDIF
MAJORCOMP=ntos
MINORCOMP=dd
TARGETNAME=BDACap
TARGETPATH=obj
TARGETTYPE=DRIVER
TARGETLIBS=$(DDK_LIB_PATH)\ks.lib \
$(DDK_LIB_PATH)\usbd.lib
INCLUDES=$(DDK_INC_PATH);$(SDK_PATH)\AMovie\Inc
DRIVERTYPE=WDM
MSC_WARNING_LEVEL=/W3 /WX
C_DEFINES=$(C_DEFINES) -DUNICODE -D_UNICODE -DDEBUG_LEVEL=DEBUGLVL_BLAB
-DDRIVER
BROWSER_INFO=1
USE_MAPSYM=1
LINKER_FLAGS =$(LINKER_FLAGS) -map -merge:PAGECONST=PAGE
SOURCES=\
$(TARGETNAME).rc \
device.cpp \
filter.cpp \
TStream.cpp \
capture.cpp \
hwsim.cpp
MISCFILES=\
bdacap.inf \
BdaSWRcv.inf
I Adding this line <<$(DDK_LIB_PATH)\usbd.lib>> for link USBD_XXX founction
but still appear the unresolved external symbol
USBD_CreateConfigurationRequestEx
Why! Anybody can help me!
Thanks!
Eric Lu
Averlogic Tag: Capturing USB port data Tag: 72145
DriverDateData and others....
Hi,
Where do "DriverDateData" and "DriverDate" come from in my device's registry
key? I see it in
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\xxxx"
Thanks,
Sushrut. Tag: Capturing USB port data Tag: 72141
Possible to write data to SMBIOS from ACPI operation region??
I have been reading the docs on ACPI operation regions and it seems that
these regions are only useful for getting data from the BIOS, is this true?
I have a need to access an SMBIOS interface which requires punching a
physical address into a CPU register directly and then writing an I/O port.
I was wondering if this interface could be converted to an ACPI op region
and avoid all of the non-standard, non-WHQL approved kernel calls that are
necessary to make this work?
I notice that their are two access types listed for these regions "cooked"
and "raw". The latest docs say "raw" access isn't implemented yet. I am
guessing this is what would be needed for this type of interface yes?
Originally, I was hoping that ACPI op region buffers were shared between
BIOS and ACPI op region registrars, but it appears that the data flow is
only one way, yes?
Any pointers on how these op regions work and even better how an SMBIOS
interface such as this could be accessed in a cleaner fashion would be much
appreciated.
BTW, for the sake of discussion assume I can modify the BIOS at will.
Bill M. Tag: Capturing USB port data Tag: 72140
How to use COM in Filter Driver.
Hi,
I want to use COM say IStorage in one of my filter driver, is there
any way of implementing existing COM interfaces in drivers.
Thanks & Regards,
YASH Tag: Capturing USB port data Tag: 72137
CDC interface for Composite (USB) device
Hello Everyone,
We have a composite USB device which contains a Line device (PSTN line)
and Telephone device. Each of these two device have two audio
interfaces.
I want to expose to Windows my composite device as Two communication
class devices - a) Line device (like a Modem) and b) Phone Device (CDC
spec - Telephone control model).
a) I would like to know if Usbser.sys will support this or do I have to
write my own driver?
b) Also what are minimum interfaces required by usbser.sys?
Thank you,
Harish Tag: Capturing USB port data Tag: 72130
Hibernation problem for USB device without ROM firmware
We make use of a USB device that gets its identity changed dynamically after
the firmware is downloaded by our driver. The device has a unique VID and
PID that is used for the two sets of drivers. The first VID & PID are
burned into the ROM and it is not the USB chip manufacturer's VID/PID. I
have searched through the archives and found a similar issue discussed along
with a workaround suggested by Microsoft. (Attached below)
Our device is not quite as schizophrenic since it has our own VID/PID before
the downloading of firmware.
Anyway, I preferred to test the second design for hibernation so I created a
compound device with a hub. I installed a lower filter driver to our hub
and tried to download the firmware during power up, but I found that the
request (IOCTL_INTERNAL_USB_SUBMIT_URB with URB_FUNCTION_VENDOR_DEVICE)
fails with STATUS_DEVICE_POWERED_OFF when I download the firmware before
calling PoCallDriver (this is an experiment and what I expected).
Also I get STATUS_DEVICE_NOT_CONNECTED when I download the firmware after
PoCallDriver and this is not what I expected. It seems to me from my
experimentation that this is not a realizable solution.
I realize this suggestion was made "AS IS", but I was wondering if the
concepts have ever been tested or what I might be missing?
--- the following is the workaround ---
Newsgroups: microsoft.public.development.device.drivers
From: "Eliyas Yakub" <eliy...@microsoft.com> - Find messages by
this author
Date: Wed, 22 May 2002 12:16:04 -0700
Local: Wed, May 22 2002 3:16 pm
Subject: Issues with schizophrenic devices (fyi)
Reply to Author | Forward | Print | Individual Message | Show
original | Report Abuse
I brought to our PNP developer's attention nasty driver design issues
people
are running into with reprogrammable PCI (FPGA/DSP) and USB devices.
We saw
couple of those in recent days (Triggering a PCI bus re-scan) in this
forum. Here is his response:
**********************
Our customer needs to be warned that this type of hardware may not be
productizable.
The design (a reprogammable PCI FPGA chip that disappears and
reappears as
another device) is similar to some of the USB programmable DSP designs
we've
also seen problems with. Both of these designs run into major problems
with
PnP and Power Management.
Problems
--------
Identification
- In its default state, the device usually exposes generic "DSP/FGPA"
IDs.
An INF targets those IDs and specifies a driver that'll transform the
hardware into something else. If two different hardware vendors each
use the
same reprogrammable chip, their INFs will both match against the same
DSP/FGPA IDs. The OS doesn't know which driver to pick. Even better,
insert
a card from each vendor - mayhem ensues as one of the cards will get
the
wrong payload.
Power Management
- During power management operations (hibernation, suspend, etc), all
power
is often removed from the chip. When this happens, the chip typically
loses
its new identity and reverts back to its DSP/FPGA form. To the OS,
this
appears to be a surprise removal (the card disappeared). All the
handles
opened by applications against the device will go dead. The
application
might reestablish contact when the original device appears to be
"reinserted", ie the load sequence has repeated, but there is no
gaurantee
of this.
Plug and Play
- Some Plug and Play operations may result in power loss (rebalance),
leading to the problem above. Updating the driver also temporarily
places
the hardware in D3. Depending on the bus, this may result in a state
loss,
causing the device to "disappear" just as the OS is planning to reload
the
new drivers. A reboot popup may result from this.
How To Make FGPA/Reprogrammable-DSP Designs Work
------------------------------------------------
The best designs simulate a bridge/hub with devices behind it. For
instance,
the following design of a PCI FGPA works properly with Windows: 1. The
PCI
FGPA simulates a PCI-to-PCI bridge. 2. The PCI FGPA logic retrieves
the IDs
for the bridge from an EEPROM, ensuring no possible overlap with other
customers using the same chip (the IHV is expected to contact the PCI
SIG
and retrieve such IDs.) 3. The INF for the FGPA specifies PCI.SYS as
the FDO
(using NEEDS and INCLUDE directives to reference machine.inf as
needed), and
specifies a lower filter driver that will deliver the payload. 4.
During
IRP_MN_START_DEVICE, the filter driver downloads the payload to the
FPGA.
The FPGA now appears as a bridge (same IDs) with a *child* behind it.
The
child represents the IHV's device. 5. After start, the OS enumerates
the
bridge. Since the child is present, the OS loads the next set of
drivers. 6.
During powerup from suspend or hibernation, the OS first powers up the
bridge. The filter driver takes this opportunity to reapply the
payload if
necessary.
Here is a similar design for a reprogrammable USB chip:
1. The USB chip simulates a hub.
2. The USB chip retrieves the Vid/Pid IDs for the hub from an EEPROM
3. The
INF specifies USBHUB.SYS using NEEDS and INCLUDE directives targeting
USB.INF. The INF also specifies a special lower filter driver to
download
the payload. 4. During IRP_MN_START_DEVICE, the filter programs the
USB chip
to appear as a hub with a device behind it. 5. After start, the OS
enumerates the hub and discovers the child.
6. During powerup, the OS always powers up the hub before the child.
The
filter reapplies the payload during hub powerup.
And another USB design:
1. The USB chip simulates a *composite* USB device.
2. The USB chip retrieves the Vid/Pid IDs for the hub from an EEPROM
3. The
INF specifies USBGCCP.SYS via NEEDS and INCLUDE directives (similar to
above).
4. During IRP_MN_START_DEVICE, USBGCCP will read descriptors from the
hardware to determine which functions are exposed by the composite
device.
The driver (a lower filter) would reprogram the hardware to specify
child
during Start, before the IRP reached USBGCCP.
5. During powerup, the driver would reapply the payload as needed.
--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no
rights. Tag: Capturing USB port data Tag: 72127
Supporting IAMStreamConfig with AVStream driver
I'm just getting started on an AVStream driver and would like to
support the IAMStreamConfig interface for the purpose of getting and
setting the data format (framerate, size, etc.). Which property set
must be supported for this? Also, will supporting this interface
result in the Video Format tab of the pin properties being activated?
(Don't worry, I'm not going to leave the default property pages in my
final version, but I'd like to get them working for now.) Tag: Capturing USB port data Tag: 72126
printer port monitor question re: drag-n-drop install
I've got a question about port monitors and drag-n-drop printer installation.
When you drag a printer from a server to a workstation, what happens to the
port monitor that the printer driver(on the server) is using?
Fron the printers folder, clicking on the printer's Properties/Ports tab
shows the printer on the workstation is using the same port as the printer
on the
server is using.
However, if you do File/Server Properties from the printers folder and look
at the ports tab, the port is nowhere to be seen. If it's a non-standard
port monitor (ie, not included with windows), the port TYPE isn't even there.
(and you can't configure the port)
So what port is the workstation printer actually using? Is this documented
anywhere?
I am especially interested in any information regarding user-written port
monitors in this situation.
Thanks,
ScottR
--
Scott Robins Tag: Capturing USB port data Tag: 72120
Q: USB SCSI, announce media change?
Ok, I couldn't find a better place to post this question, so here goes!
I'm writing code for a device that exposes a removeable media drive. So
far, no problems getting Windows to see the drive, notice that there's no
media, etc. - however, when I change media Windows will redisplay the
contents of the old media!
I'm returning a CHECK_CONDITION with a sense code of 0x28 and a qualifier of
0x00 to TEST_UNIT_READY, which based on my reading of the SCSI spec should
tell Windows that the media might have changed.. but Windows won't reread the
device directory. Is there something else I should be returning here?
TIA for any assistance, this is driving me nuts! Tag: Capturing USB port data Tag: 72113
How to translate glyph pathes into other font matrix?
I need to take the path of a glyth and translate it for the current font
matrix (True Type 2048y2048) into an other matix. I have tried some
calculations, but without success. Can someone give an idea where to
look at or what is to do?
Thx Tag: Capturing USB port data Tag: 72111
plug and play hooks
Is there a way to hook the plug and play process? We want to stop the plug
and play dialogs from coming up and instead automatically point the process
to a directory on a server to pull the driver down. Is there any
documentation for doing something like this or is it even possible.
Gary Tag: Capturing USB port data Tag: 72110
Print Authentication
Hi,
I have three printers one HP and two of Epson. I am interested in
coding a print authentication system. The idea is to popup a dialog box
for asking username/password. The problem is that I can use
DrvDocumentEvent for pop-up the dialog. But since it is placed on the
dirver UI code - I dont have access to the proprietary code, So I cant
do any changes into that. Is there any way I can achieve the popup of
the dialog box, no matter what printer is used from which ever
application.
PLease help. Your advise will be helpful for me.
Thanks
Moin Tag: Capturing USB port data Tag: 72109
Driver Signing
Hi,
I'm working on the USB driver which is given to me from a vendor. Its
suppose to work with Virtual com Port. Now when driver signing is required,
is it only the USB driver which is given to me by the Vendor that should
undergo testing or is it along with the VCP . ? Tag: Capturing USB port data Tag: 72103
Using Libraries
I want to create and use a DRIVER_LIBRARY. Note that this is to be a
statically linked library. Do I need to add special declarations on
functions that I intend to export?
Similarly, do I need to add any special declarations to the function
prototypes in the user code?
Thanks in advance,
Dennis
By the way, I've tried this out (without any special declarations), and the
linker kicks out an unresolved external symbol error for all the referenced
library functions. Tag: Capturing USB port data Tag: 72101
Keyboard port 64
I am developing filter keyboard driver for Windows XP.
It shall communicate with keyboard controller via i8042 driver.
Try to write to port 64 and failed.
How should I write to port 64? Tag: Capturing USB port data Tag: 72098
Use of USBD_START_ISO_TRANSFER_ASAP
Could I find out the latest situation re the use of this flag - I've seen
talk of a bug in XP when using it but don't know if it is (a) still present
and (b) also a bug on high-speed as well as full speed devices.
I want to queue up multiple isoch URBs in my driver, but when I use this
ASAP flag approximately every other URB seems to be coming back empty (though
neither the URB itself or the packets within it are indicating any error). If
I try to manually precalculate the start frame for each URB then I get a much
more constant flow of data, albeit with some occasional
USBD_STATUS_ISO_NOT_ACCESSED_BY_HW errors [what causes these?]. I have approx
600 1KB packets in each URB.
Thanks. Tag: Capturing USB port data Tag: 72096
How to an "mobile device"-like driver
Dear all,
I am asking to build a driver for a hardware which communication with PC by
either serial port or USB. In addition, it requires to make an icon on "My
computer" folder and allows user to browse content of the hardware. It just
look like functions of "mobile deivce" in ActiveSync.
I am completely out of idea on it and I wonder if someone can give me a
pointer on how to implement it.
Thanks in advance.
JJ Liu Tag: Capturing USB port data Tag: 72095
CDROM load/eject notification
Hi
I need to get a notification inside my driver about CDROM load/eject
operations.
The previously posts about this matter only say how to do this in user
mode or talk about some king of a media event but without further
details.
So, any idea how to do it on kernel mode?
Thanks Tag: Capturing USB port data Tag: 72094
USB (Camera) Device Driver.
We are working on USB device driver for camera. We are facing problem in
accessing data through video pipe (or Interrupt pipe) using bulk transfer.
URB is built using UsbBuildInterruptOrBulkTransferRequest. All the three
flags InvokeOnSuccess, InvokeOnError and InvokeOnCancel are enabled while
setting callback function using IoSetCompletionRoutine. But USBD is calling
the callback function only on InvokeOnCancel.
In other cases were URBs are built using UsbBuildGetDescriptorRequest,
USBD_CreateConfigurationRequestEx or UsbBuildSelectConfigurationRequest, the
callback function is called on InvokeOnSuccess.
Following observations are made.
1) The return value (NTSTATUS) of IoCallDriver is
STATUS_LICENSE_QUOTA_EXCEEDED (not error), indicating status pending. This
return value is observed in some other cases also but after sometime the
callback function is called on InvokeOnSuccess. But in case of URB created
using UsbBuildInterruptOrBulkTransferRequest, the callback is not called
unless IRP is canceled (InvokeOnCancel).
2) Buffer is filled with some standard data before calling IoCallDriver
and observed that the data is not changed, indicating that no data is
obtained. This observation is made when the callback function is called on
InvokeOnCancel.
Since only while building URB using UsbBuildInterruptOrBulkTransferRequest
we are using pipe details, we concentrated on the pipe details and concluded
the following,
1) Pipe handle is valid.
2) Buffer is valid and is of proper size.
3) Current transfer size is proper.
4) Transfer flag is also proper.
Is there anything we are missing to check? I am confused in concluding where
am I going wrong. Is there anyone, facing the same problem? Any help will be
grateful. Thanking in advance.
Kireeti Kanumolu. Tag: Capturing USB port data Tag: 72093
Win 2K Unidriver CmdXMoveAbsolute,CmdYMoveRelDown problem.
Hi there!
I have been wrriting a Print Driver.
this is work fine on Windows 9x.
therefore i convert win 9x .rc to win 2k .rc that was used Win 2k Mini
driver tool.
and some fonts file .pfm to .ufm, too.
I had inserted some fonts that is barcode and text.
Both text work fine.
but barcodes are incorrect that is printed a text.
i print a data to file:(port) and i check that binary code.
i found some problem.
belowe is correct:
1. send font command(<1Bxx~>)
2. printing data("123456789012")
;output => <1Bxx~3132333435....>
; win 9x print data
but real output data is incorrect.
below incorrect:
1. send font command(<1Bxx~>)
2. CmdXMoveAbsolute(<1Bzz~>)
3. CmdYMoveRelDown(<1Byy~>)
4. Printing data("123456789012")
;output => <1Bxx~1Bzz~1Byy~3132333435....>
i have text data "123456789012". i didn't want this text data.
i'd like to get barcode data.
how to get same output data like windows 9x.
how to solve this problem ? Tag: Capturing USB port data Tag: 72090
Not seeing "cancelled" status when I cancel my URB
I have a (high-speed) USB driver which generates multiple isochronous urb's
and queues them up, one after the other, through IoCallDriver() with a
Completion routine set and all three flags (Success/Error/Cancel) set True.
On certain conditions I need to cancel all these URB's; I happen to have
kept a list of the requests so I can either call IoCancelIrp() on each or
just do a URB_FUNCTION_ABORT_PIPE on the pipe. In either case, I don't see a
STATUS_CANCELLED on the Irp when the completion routine is called on the
outstanding transfers [I do see STATUS_DEVICE_NOT_CONNECTED if I yank the
cable].
These transfers are entirely internally-generated - there's no upper layer
Irp's involved in this.
Now its possible that the 'cancelled' Irp/Urb's have in fact completed
successfully by the time I do the cancel, and that this is why I get zero
status - I'm not sure how to prove/disprove that idea right now. But I
wondered if there was anything else I might have overlooked/misinterpreted?
Thanks. Tag: Capturing USB port data Tag: 72081
Hooking api
In a previous thread I was directed by some gentlemen here how to hook an
api function. Specifically I need to hook the callback waveInProc which is
called by the system in a multimedia event. Here is the waveInOpen function
prototype:
MMRESULT waveInOpen(
LPHWAVEIN phwi,
UINT_PTR uDeviceID,
LPWAVEFORMATEX pwfx,
DWORD_PTR dwCallback,
DWORD_PTR dwCallbackInstance,
DWORD fdwOpen
);
and here is the waveInProc function (which the user should define and
implement):void CALLBACK waveInProc(
HWAVEIN hwi,
UINT uMsg,
DWORD dwInstance,
DWORD dwParam1,
DWORD dwParam2
);Inside my waveInOpen function I modify the callabck paramter from
dwCallback to MywaveInProc.Inside my MywaveInProc, I should call the
original waveInProc(dwCallback) function(which I know only its address). I
never called an address with paramters and I don't know how to do it.My
question:Can someone refer to specific code explaing/demonstrating how to do
it? Thanks in advanceI. Lesher Tag: Capturing USB port data Tag: 72077
softICE syntax error
whenever i try to use:
BMSG XXXXXX WM_CLOSE
i get a syntax error. i know the handle is valid because i've checked
it, i'm entering everything in the correct sequence. i don'tunderstand
what is wrong. Tag: Capturing USB port data Tag: 72076
How can we capture USB interface data in WindowsXP?
I want to verify the data transfered across the device and machine.
If anyone of you have any utility, pls let me know.
"Vishal" <Vishal@discussions.microsoft.com> wrote in message
news:E9C80827-19AF-488B-810D-03593E700F2D@microsoft.com...
> How can we capture USB interface data in WindowsXP?
> I want to verify the data transfered across the device and machine.
> If anyone of you have any utility, pls let me know.
> How can we capture USB interface data in WindowsXP?
> I want to verify the data transfered across the device and machine.
> If anyone of you have any utility, pls let me know.
A low budget solution that may work for you is Snoopy Pro. This is a freeware
software capture program that I've used a bit. I prefer an analyser like the
CATC products, but this can be very expensive.
Sam Robinson
"Vishal" wrote:
> How can we capture USB interface data in WindowsXP?
> I want to verify the data transfered across the device and machine.
> If anyone of you have any utility, pls let me know.