DDKBUILD Release 3.11.31
DDKBUILD Bugfix Release 3.11.31
This is release 3.11.31 of DDKBUILD
Bugs fixed:
DDK W2k3 SP1 Build 1289 support. WDF build 1.00.5033 aupport.
New features:
Prefast view window opens after prefast build completes.
No command line options have changed.
W2k3 SP1 DDK introduced mysterious bscmake option to setenv.bat,
ddkbuild now detects if setenv.bat supports this option and provides it
so that visual studio browsing works.
Hannes Sternerson suggested that perfast view ought to run
after a prefast build, and I thought, why not? So Hannes' excellent
suggestion has been incorporated into the ever more hideous ddkbuild.
Free download available at http://www.hollistech.com
--
=====================
Mark Roddy DDK MVP
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com Tag: PCL6 and postscript3 manual Tag: 59239
Multiple named filters
Hello:
I have upper filter above "serenum".
In Filter.AddDevice(...) I created named object "NamedFilter_1".
I can open/close and read/write to "NamedFilter_1"
from user-mode appl
In Filter.DriverEntry(...) I created named object "NamedFilter_2".
Using the same user-mode appl I can open/close this object.
But when I try to write to "NamedFilter_2" IRP_MJ_WRITE arrives with
stack->Parameters.Write.Length = 0 and
Irp->AssociatedIrp.SystemBuffer = NULL
Thank you,
dave Tag: PCL6 and postscript3 manual Tag: 59235
Log JOB_INFO_2 and DEVMODE info to a SQL database using a port mon
I need to log the information found in JOB_INFO_2 and DEVMODE structs for
each print job to a SQL database, before they are sent to the printer via LPR
or RAW(port 9100). I may even need to delete print jobs that contain certain
undesired information (such as too high of a copy count) before they are sent
to the printer. I believe this could be accomplished by writing a custom
port monitor. However, I have never done this before. I found the Local
port monitor source code in the src\print\monitors\localmon and
src\print\monitors\localui directories of the Windows 2003 Server DDK. Does
anyone know where I can get source code for either the Standard TCP/IP port
monitor or the LPR port monitor? Tag: PCL6 and postscript3 manual Tag: 59228
Can the W2K3 SP1 RC1 DDK be used for shipping products today
We're having an internal debate about which DDK version is appropriate for a
driver we plan to ship shortly.
I believe the W2K3 SP1 RC1 DDK is the one to use. Some people here are
uncomfortable with the RC1 designation and feel we should use the two year
old W2K3 DDK. One of the arguments against the RC1 DDK seem to be drivers
built with the old W2K3 kit are supported, but drivers build with the SP1
RC1 kit are not. Another argument, in favor of the RC1 DDK is it's the
compiler/headers being used right now at Microsoft for OS's/patches/drivers,
and has bugs fixed that may still be in the old W2K3 kit.
Can someone from Microsoft comment?
Thanks.
Jan Tag: PCL6 and postscript3 manual Tag: 59215
Accessing Information in the PPD file
Hello,
Are there any methods in .NET (or COM API's) to access the information in a
PPD file. I need to get a list of the installable options and items in the
OpenUI tags. I can pars through the file manually, but I was wondering if
there is sample code or API's that will do this for me. Any help would be
greatly appreciated.
Thanks!
Chris Tag: PCL6 and postscript3 manual Tag: 59214
HCT 12.0 script debugging tools (Sucess?)
Does anyone in this forum have any success with stopping or setting breakpoints in
HCT 12.0 scripts? (XP SP2)
We had script debugging running on HCT 11.2 and SP1 but it all broke for
SP2. What do you use?
Thanks -Ron- Tag: PCL6 and postscript3 manual Tag: 59213
Registry Cleanup
Hi!
I'm currently writing a dynamic device driver for Win9x/ME that utilizes the
windows registry to become accessible to some win32 applications. The problem
is that if you restart the computer without exiting windows (e.g. by reseting
the computer) the driver doesn't get a chanse to clean up in the registry.
The information will thus remain in the registry in the next windows session,
and win32 applications will believe there's resources available that aren't
actually available, since the driver isn't even loaded.
So; how can I get rid of registry keys I've added from the driver even if
the computer is reseted? My best idea so far is to add a runonce-value that
is removed when the driver is unloaded, but remains if windows isn't
terminated properly. But I don't want to distribute a win32 program whose
only purpose is to clean the registry. Is there any other way to accomplish
it? Is it, for instance, possible to do something like this (conceptual
example only):
HKLM
|- Software
|--- Microsoft
|----- Windows
|------- CurrentVersion
|--------- RunOnce
|----------- CleanUpResource1 = "regedit -remove HKLM/Hardware/bla/bla"
i.e. utilize an existing application to do the cleanup.
The driver is designed for Windows 95/98/ME.
Please help!
Nille Tag: PCL6 and postscript3 manual Tag: 59208
rs232
hello,
I need an driver for rs232 port in real time.
my pc is connected with n-terminals using polling tecnology.
I develop with VS 2003, but response time is very slow. can I create an
driver with access direct io port? how?
thanks Tag: PCL6 and postscript3 manual Tag: 59205
Multiport PCI driver under WDM
I have written a NT driver for a custom developed PCI card, it's a
multi-port serial adapter. Under NT when DriverEntry() was called, I
used the HAL functions to find the presence of our adapter on the bus.
Knowing beforehand how many serial ports are on the adapter I could
simply create X instances of the device. As all ports share the same
resources, I allocated interrupts and common buffer areas in
DriverEntry. Each device never assigned any resources, they all share
the same common resources.
Now I have to port this driver to the WDM model. My problem is that the
HAL functions I used to scan the bus is not available anymore.
When OnStartDevice is called, the I/O manager passes you a resource
list.
Problem is I want to create more than one device and I can't seeing as
the only time I will know what hardware resources I have been assigned
is when the device object is already created!
How can I create a device object per port for the adapter and still
assign the PCI resources? How else can I open these ports from
user-mode, if not by calling CreateFile() and using the symbolic link
of each port? That can only happen if each port is its own device
object even though there is only one physical PCI adapter.
The adapter doesn't fit into the multifunction specification.
The adapter has X logical ports in a CPU not X UARTs, but they all
share the same hardware resources. There is a common buffer and an
interrupt line. A message is then passed to and fro using this common
buffer and signalled with the interrupt. Each message in its header,
contains port information.
I wish to have X devices ( and X symbolics links ). As far as I could
find this type of driver is called a multiport driver, where there are
more than one
logical function on a device. A multifunction device is when each
function uses non-overlapping hardware resources, my adapter doesn't
fit that description. I can't find any examples for multiport drivers
however.
What structure should my driver contain? Do I need a bus driver for the
adapter and then a function driver per port? Or is there a INF section
that I am missing? Tag: PCL6 and postscript3 manual Tag: 59189
Video memory mapping - HOWTO?
Hello
I'm trying to map the video memory in order to display text from a boot
driver. i know the memory for color display starts at 0xA0000 but for
some reason this isn't working:
#define BUFFERSIZE 8192
PHYSICAL_ADDRESS paVideoMem;
PUCHAR pVideoMem = NULL;
paVideoMem.LowPart = 0xA0000;
pVideoMem = MmMapIoSpace(paVideoMem,BUFFERSIZE,FALSE);
*pVideoMem = 0x07690748 // should print H in the upper left corner
Any suggestions ?
Thanx. Tag: PCL6 and postscript3 manual Tag: 59188
Develop a printer driver with DDK
Hello,
I would like to develop a printer driver using the DDK.
I have the DDK installed and looked through, but at
this time I have no idea how to start.
Is there a tutorial for developing printer drivers or a
good book which can help?
Thx for help.
AF Tag: PCL6 and postscript3 manual Tag: 59185
Ndis IM driver PnpCapabilities.
Hi
Thanks for any help.
I have an NDIS IM driver under Pocket PC 2003.
Its giving me couple of problems for Built-In Wifi medium.
Sorry, I know its a painful question.
Hope some one helps me.
External WiFi cards work fine.
When I have Built-In WiFi on, it has couple of options to turn it
ON/OFF.
1. Thru a WiFi utility that comes with the device.
2. Connectivity icon at the top of the machine. When clicked it shows
"Turn Wi-Fi ON/OFF". Also this option is different in some machines
"Turn Flight mode ON/OFF".
Code:
1. I return ndis status SUCCESS in
ProtocolPnpHandler(NetEventSetPower). I maintain the power state in the
driver.
2. In the PnpCapabilties Query I tried to return ndis status NOT
SUPPORTED or SUPPORTED (with Wakeup capabilities set to
"NdisDeviceStateUnspecified". Also I tried simply return the statuses
without filling these wakeupcapability buffers.
The problem is
Both the WiFi options to Turn on and off the medium works as such when
the device in ON.
When I switch off the power and back on, One of them works and other
doesn't. (Wi-Fi was on when powered down.)
Example. If I set STATUS NOT SUPPORTED in pnpcapabilities, Power and
flight mode works. If I set SUPPORTED, Utility and power works.
The other is broken, Meaning, when the power is back its frozen or if
you click to switch off the Wi-Fi, its frozen.
Mostly in "NdisIMDeInitializeDeviceInstance".
Could some please give me some direction here? some how the protocol
stacks on top seem to hang.
Is there away to disable(remove) this flight mode option thru the
pnpcapabilites?.
Note: PNPCapabities query will be called twice. I don't know the
individual meanings but it looks we can specify different capabilities
in both cases to make it work.
The code is based on passthru sample that comes with CE 4.2.
Thanks for any help.
Ganesan Tag: PCL6 and postscript3 manual Tag: 59178
DDK Integration with VS
Hello,
I just installed the Server 2003 DDK. Am I incorrect in assuming that it is
supposed to integrate with Visual Studio? It can't be that I must write my
code with notepad and then compile and link at the command line, can it?
Please forgive my ignorance, but how does one integrate the DDK with Visual
Studio? Or can you point me to an article that tells how?
Thank you very much,
Rich Tag: PCL6 and postscript3 manual Tag: 59171
File caching
Hello,
We are building a device that captures data from a number of external
sources and organizes them for collection. The device connects to a PC
via USB.
Our device presents itself to the system as a FAT mass storage device.
The data is organized as a set of text files. The user would open the
files to see the current settings/data or could use our logging tool
which manages the periodic collection of the data if that is what they want.
Everything works pretty well except that the 'files' provided by the
device change without Windows knowledge of it. Since Windows appears to
cache the first image of the file we are not able to see the new values
without unmounting and remounting the device. This is obviously not
optimal. Everything works correctly when we mount it to Linux (which
does not cache the files or root directory).
Is there any adjustment we can make to our device that will allow it to
tell Windows not to cache anything regarding the filesystem...say,
during the device mounting process?
Thanks in advance,
Kevin Tag: PCL6 and postscript3 manual Tag: 59163
Print preview application
i need to write a print preview application that is tied into our printer
driver. that
is, after the user prints to our driver, we will display a preview of the
print job
that the user can scroll through. typical printing features will be
displayed in the
image for each page such as orientation, N-up, etc.
development for the actual printer driver is being done as Unidrv plug-ins.
from the preview application the user can decide as to whether they really
want
to print out to the physical printer or to cancel the job.
QUESTION 1
is there a preferred point in the printing process that a preview
application should
be kicked off from such as from the rendering plug-in or from a custom print
processor?
i was looking into microsoft's sample print processor in their DDK however
all
of the GDI functions in Print Processors seem to just replay the EMF into
the
printers DC.
QUESTION 2
is it possible to use these GDI functions (e.g. GdiPlayPageEMF) to play back
EMF
in a preview application into the applications device context?
i've seen mention of the function gdiPlaySpoolStream in this newsgroup
however
there is no current documentation on it. it does appear in GDI32.DLL and
there
is documentation on it in the Windows 98 DDK. interestingly, Microsoft has
stated
in some newsgroup articles that this function should be used.
QUESTION 3
is the gdiPlaySpoolStream function valid (i.e. will be support in later
OSes, etc.)
for Windows 2000/XP?
can it be used to play back a page at a time (for previewing)?
Microsoft reiterates in numerous articles that EMF data that ends up in the
Spooler
is not the same as EMF generated by an application thus you can not rely on
this
format for playing back using normal EMF API functions.
QUESTION 4
if this is the case how are other printers displaying their Print Preview
applications
or are they just relying (i.e. hoping) that the format does not change. Tag: PCL6 and postscript3 manual Tag: 59161
Problem with installing stupid driver on win 2K/XP - Oney WDM 2nd
Hello,
I am trying to install 'stupid' driver on W2k/xp and system can't do it.
I did this back then more than a year ago on win98 and it worked great.
On win2k or XP f I right click on 'stupid.inf' file -> install, nothing
changes.
On WinXP I tried something different. That is install using the hardware
wizzard. Things appear to be fine (provided I had to compile a release
version of samclass.dll referenced in stupid.inf). But after rebooting (as it
asks me to) driver class are shown but the an exclamation mark appears on the
driver display from which the properties window says "This device is not
working properly because Windows cannot load the drivers required for this
device [codd 31]. Anyone have any idea to solve this? Thank you. Tag: PCL6 and postscript3 manual Tag: 59158
AVStream Physical Memory Mapping
Hi!,
In Stream.sys there was a PORT_CONFIGURATION structure available, that
pointed out mappings from physical to virtual memory.
My PCI card has a large memory range, and I want to access last 256
bytes of it (not using DMA, I just want to map this memory into virtual
address - those my PCI card registers).
I'm trying to use MmMapIoSpace, this supposed to look like this:
PHYSICAL_ADDRESS physAddress;
Memory resource address received from >>TranslatedResourceList<<.
physAddress.LowPart += 0x100000L;
virtualAddress = (PUCHAR) MmMapIoSpace(physAddress, 256, MmNonCached);
But this does not works as I expect it to work - I could make a simple
mistake - and If this is only way to implement this I'll try it, but:
Is there some other way of receiving those addresses?
I remember, I had similar problem with Stream.sys and I have found
mapped physical onto virtual addresses in PORT_CONFIGURATION structure.
That was very comfortable in Stream.sys.
Pawel
ps
Maybe there are also function simmilar to StreamClassGetPhysicalAddress
in AVStream model? Tag: PCL6 and postscript3 manual Tag: 59152
How to set up IoRequestPacket in ClientEventReceiveDatagram?
Dear all:
Recently I developed a TDI client driver. It is a very simple project which
receives UDP packets from particular IP address and port.
I tried two methods to achieve the goal.
One is to allocate Irp/Mdl and TdiBuildReceiveDatagram to obtain data
directly from underlying transport. It works fine! Another is to register
ClientEventReceiveDatagram handler, and in the handler I also receive UDP
data.
However, in the case that the input parameter BytesIndicated !=
BytesAvailable, I wanted to build a Irp returned to underlying transport for
the remainder of the TSDU. It failed!
In this handler, I tried two ways to build the Irp, IoAllocateIrp and
TdiBuildInternalDeviceControlIrp. As mentioned by DDK documentation,
"Callers of TdiBuildInternalDeviceControlIrp must be running at IRQL =
PASSIVE_LEVEL".So I pre-call the function to build Irp and in other thread,
such as dispatch_IoControl.
But both of them failed. OS crashed,and the message is
"DRIVER_NO_LESS_OR_EQUAL_IRQL". I don't know how to set up the Irp as
*IoRequestPacket for the remainder data.
Any idea is appreciated, thanks in advance.
Regards,
Zhou Tag: PCL6 and postscript3 manual Tag: 59151
Kernel-Mode Basics
Hello all,
>From the link:
http://www.microsoft.com/whdc/driver/tips/km-basics.mspx#EAAA
under "Getting your driver to handle more than one I/O request at a
time"
Second paragraph:
"Even if your application uses multiple threads, only one
request at a time (per file handle) will get through."
I am doubtful about the "per file handle" part.
I tried the following thing:
>From 2 threads (in an application) i opened the device (created
in a simple driver) using CreateFile (and verified that the
handles are different). One thread called ReadFile in a
loop and the other one called WriteFile in a loop.
But i noticed that driver is handling the request 1
at a time.
So even though the handles are different the calls are serialized.
So what does the "per file handle" mean ?
...Mani Tag: PCL6 and postscript3 manual Tag: 59140
XML JSP c++: Device Driver UI
Hi i am looking at an application developed by the panel of experts and
it is a dll made to show the user interface for the application. With
the dll(which is made in c++) there are two more files accompnying it:
one XML file and one JSP file
=B7 An XML document containing the features, options and constraints,
and
=B7 A Java Script file for controlling the behavior of the controls,
menus, bitmaps and tabs on the UI.
Could any one explain me why someone like to do so.
Respects,
Saurabh Aggrawal Tag: PCL6 and postscript3 manual Tag: 59139
Reasons for USB Device Reinstall
What are the reasons, other than the USB serial number, that would cause a
USB device to be reinstalled when moved to a new USB port? We are in the
process of developing a USB device and even though we are specifying a serial
number, the Add New Hardware wizard pops up whenever the device is moved to a
new port. We are specifying a string descriptor index in the device
descriptor and the value of the serial number is the Unicode string
â??0123456789â??. This is a temporary value for development purposes, when the
device goes into production, each will have its own serial number. Even so,
shouldnâ??t this value be sufficient to qualify as a valid USB serial number?
Mike Tag: PCL6 and postscript3 manual Tag: 59128
Read data from a printer when its driver is installed on a serial
Hello,
I want to read data from a printer that is connected to a serial port while
its driver is installed.
I cannot access the serial port directly. And ReadPrinter() doesn't work.
Is there a way to read the data from the printer, even if I have to modify
the sample port monitor in the DDK? Or maybe some other way?
I could not find the part that limits access to the serial port.
Thanks. Tag: PCL6 and postscript3 manual Tag: 59119
network interfaces
i wanted to support ip multicast (ipv6). when i receive the multicast list
addresses from ndis, i should go and create interfaces as i would do for any
primary network interfaces? Tag: PCL6 and postscript3 manual Tag: 59118
About the Filter in Audio Capture Sources Category
Dear All:
I have written an audio AVStream driver.
It registers successfully an audio capture filter into two different
categories, Audio Capture Sources and WDM Streaming Capture Devices.
The capture filter, which is in WDM Streaming Capture Devices folder, is
workable well for any operations.
However, when I use the corresponded filter within Audio Capture Sources,
there is serious problem below:
I can listen the sound from this filter, but I can't stop it.
When I push the "stop" button, the graphedit will be blocked!!
The OnPinClose function cannot be called by directshow in my driver.
Can you help me?
Best Regards,
H.P. Tag: PCL6 and postscript3 manual Tag: 59117
Relative open with a volume handle ?
Is it possible to use the relative open with NtCreateFile and a volume
handle; or is this strictly a file system concept? I want to reopen a
volume handle with different access permissions.
Regards,
George. Tag: PCL6 and postscript3 manual Tag: 59116
Printer Icon
Hi Folks,
I'd like to know if it is possible, and if yes how, to change the Icon of a
printer in the "printer and faxes" page.
Thanks in advance, Lela Tag: PCL6 and postscript3 manual Tag: 59112
CM_Request_Device_Eject problem
Win 2000 SP4
I use a service application to call CM_Request_Device_Eject on an USB
stick as soon as the WM_DEVICECHANGE DBT_DEVICE_ARRIVAL was received.
CM_Request_Device_Eject returns CR_ACCESS_DENIED with an empty veto
buffer. GetLastError talks about an overlapped IO in progress.
Trying repeatedly for 40 secs sleeping 200 msecs each time does not
change anything.
It works fine for a normal application. Tag: PCL6 and postscript3 manual Tag: 59111
$Directory metafile
In a filemon log I see some entries like this:
189 10:15:46 myapp.exe:1616 WRITE C:\$Directory
SUCCESS Offset: 0 Length: 4096
I assume that $Directory is a meta-file object used by the cache manager and
similar to $ConvertToNonresident, which I also sometimes see.
http://www.osronline.com/lists_archive/ntfsd/thread5467.html. But can
someone confirm this.
Thanks,
George. Tag: PCL6 and postscript3 manual Tag: 59100
Where is the CHS-LBA translation done?
Hi:
It seems that the TaskFile in ATA_PASS_THROUGH_EX uses CHS representation.
In the ATA/ATAPI standard actually uses LBA representation. Can somebody tell
me, where the translation is done? Is it in BIOS or port driver? How the
mapping is done? I guess in either case those are logical index, right?
Thanks, Tag: PCL6 and postscript3 manual Tag: 59096
Device name for a disk or partition
What is the format of the device name for a disk or a partition?
I know that in Microsoft Cluster, one example is in the form of
"Disk##Partition##" for a partition of a physical disk resource, if the drive
letter is not assigned to the partition. I also saw that sometimes the volume
number is included in the device name.
My question is, as far as Microsoft Cluster is concerned, are there other
formats (except for "Disk##Partition##") of device name can be used for a
disk partition or a volume?
Thanks for any help!
Michelle Tag: PCL6 and postscript3 manual Tag: 59087
Device Name of a disk or partition
Does anyone know the format of a device name for a disk or a partition?
I know in Microsoft Cluster, one example is in the form of
"Disk##Partition##" for a partition of a physical disk resource, if the
partition is not assigned with a drive letter. But I also saw sometimes the
volume number becomes part of a device name (not in microsoft cluster).
My question is, as far as Microsoft cluster is concerned, are there any
other formats (except for "Disk##Partition##" ) of device name used for a
disk partition or a volume when the drive letter is not assigned?
Any advice will be appreciated!
Michelle Tag: PCL6 and postscript3 manual Tag: 59086
Comminicating config and control data to an RNDIS device
Hi Folks,
So my RNDIS device is working great. Thanks to everyone, and Bryan, for
helping me out. In the end it turns out a lot of confusion was caused by
a USB interface device that has some, er, odd interface requirements.
(Beware the READY line on the Cypress SX2 device, it doesn't do what you
think, or even what the Cypress app notes might imply. It is in no way
compatible with the READY input to any processor I'm aware of.)
Anyway, my particular RNDIS device is a radio that has a lot of
configuration parameters. Some of the parameters are fairly large arrays
of numbers and the custom parameter interface provided by RNDIS through
the "Advanced" tab of the device seems inadequate for handling such a
large amount of data. Plus, it would be nice to be able to re-flash the
device from the host.
So my question is this: Is there any provision for a host application to
send and receive out of band data to and from the RNDIS attached device?
I know there's OOB data that can be transported with the data packets,
but that doesn't seem like what I'm looking for. But I'm looking into
that further to see if there's some way to make it work.
One thought I've had is to write a filter driver to insert my own
commands into the EP0 stream. But it would be so much easier if
something already exists, like maybe an OID that can get set/read from
the host that's passed by RNDIS to the device.
Anybody have any ideas?
Thanks
-brian Tag: PCL6 and postscript3 manual Tag: 59081
Knowing when Reset Devmode is called
Hi all,
I'm lauching the printting of a Word document (using ShellExecute) this
creates a spl/emf file. And I wish to know (for each page) when their's a
reset devmode is callin order to skip it.
Thanks for your help. Tag: PCL6 and postscript3 manual Tag: 59073
silent install of unsigned driver
I would like to know how I can set programmaticaly the group policy for the
unsigned driver instalation?
I found two ways of setting this policy to ignore the warning manually
1. in the System control panel
http://www.microsoft.com/resources/documentation/Windows/XP/all/reskit/en-us/Default.asp?url=/resources/documentation/Windows/XP/all/reskit/en-us/prdh_dmt_qrxm.asp
2. in the group policy editor
but when I can't do it manually how can I do it programmatical?
\Manfred Tag: PCL6 and postscript3 manual Tag: 59072
multicast
would ndis issue set OID_802_3_MULTICAST_LIST even if a host join as a
SEND_ONLY MEMBER?
thanks
sophia Tag: PCL6 and postscript3 manual Tag: 59067
Originator of an IRP
Hi all,
is there a way to identify the originator of a kernel-mode initiated IRP.
Regards,
Andreas Winter. Tag: PCL6 and postscript3 manual Tag: 59059
query admin privilege from file system filter
Hi,
I have a file system filter. I want to block all file access except for
users belong to admin group. How i can know whether a particular user
has administrator privilege
Regards
John Tag: PCL6 and postscript3 manual Tag: 59057
Inheritance
Hi,
I trying to derived two different struct from the base one.
typedef struct _COMMON_BASE_
{
.....
}BASE_ONE, *PBASE_ONE;
typedef struct _DERIVED_ONE_ : public _COMMON_BASE_
{
.....
}DERIVED_ONE, *PDERIVED_ONE;
typedef struct _DERIVED_TWO_ : public _COMMON_BASE_
{
.....
}DERIVED_TWO, *PDERIVED_TWO;
and when I run "build" i have error complaining about ":".
I built the same code in VS with no problem.
Could you point what I'm doing wrong ?
thank you Tag: PCL6 and postscript3 manual Tag: 59049
Null driver WHQL signing
Is it possible to obtain WHQL certification for a null driver? I
have created an ?inf? file modeled after the form specified in the
following MSDN webpage:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/install/hh/install/specinst_3d0749f4-1498-49d5-8e53-804c65f16cd1.xml.asp
This ?null? driver can only install with administrative permission. I
would like to obtain WHQL signing for my ?inf? file so that it will
install unattended. Is this possible? What steps do I need to take to
proceed? Tag: PCL6 and postscript3 manual Tag: 59046
Yet Another PNP Notification Question
Do I have to do anything special in my USB driver, other than calling
IoSetDeviceInterfaceState(), to receive notifications in a user-mode program?
I ask because the only notification I seem to be getting is the
DBT_DEVNODES_CHANGED notification when I attach or remove my device. My
user-mode (MFC) app uses RegisterDeviceNotification() and specifies the guid
of my driver-defined interface.
Thanks for your help.
Mike Tag: PCL6 and postscript3 manual Tag: 59043
Re: IRP Buffer Overflow
I tried to change wMaxPacketSize and the size of the transfer data in my
firmware but there is no luck.
I look into the IRP packet that sends DEVICE_CONTROL to low layer.
IRP information:
Transfer Type : METHOD_NEITHER
Required Access : ANY_ACCESS
Function Code :0
There is a structure within the IRP call packet:
struct DeviceIoControl
ULONG OutputBufferLength = 0x28
ULONG InputBufferLength = 0x18
ULONG IoControlCode = 0x2f0003
PVOID Type3InputBuffer = 0x22e214
In the "Success" case, OutputBufferLength is non-zero. This number can be
0x10, 0x28, 0x80.
In the "Buffer Overflow" case, it is 0.
Is there any way I can trace what framing parameters that IRP receives? Are
they in the device
descriptors or in the probe/commit messages between our device and Windows
XP?
-Albert
"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:e8j7gb5CFHA.4020@TK2MSFTNGP14.phx.gbl...
> You have provided some wrong allocator framing properties (frame
> shorter
> then your hardware provides) to the upper layers, so, the upper layers
> send you
> too short IRPs.
>
> Then your driver convert the "too short" IRP to URB and sends it to the
> USB
> stack. USB stack receives the device data, which is longer then the IRP,
> and
> completes with STATUS_BUFFER_OVERFLOW.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
> "Albert Fu" <invalidaccount@hotmail.com> wrote in message
> news:OG2rVvyCFHA.3504@TK2MSFTNGP12.phx.gbl...
>> Hi,
>>
>> I am new to the Windows video driver and applications.
>>
>> I am working on a USB video device for Windows XP.
>> I can use AMCAP to select my usb device with a black
>> screen. I traced the data going into Windows through
>> URB layer but I see a lot of buffer overflow (ntstatus code)
>> messages coming from the lower layer using IRPTracker.
>> It seems to me that video data is lost in the layer below IRP.
>>
>> I have the following questions:
>> 1)Where should I start to look at the buffer overflow problem?
>> 2) Where is the place that the video data is putting together as a
>> video frame and then passing up to the next layer? Is it in the USB video
>> class driver?
>>
>> Best regards,
>>
>> Albert
>>
>>
>
> Tag: PCL6 and postscript3 manual Tag: 59041
Print Port Monitor - garbled port name
Hi all
I have recent written a cluster aware Portmonitor that works fine
except when adding multiple monitors the port names become garbled,
either with none printerble characters or characters from the next port
added. Has anyone got a solution to this problem?
I have added my enumports function to this post to see if anyone can
see what I am doing wrong!!!!
Any pointers would be gratefully recived.
Cheers
J
int OMEnumPorts(HANDLE monitor,
LPWSTR server_name,
DWORD level,
LPBYTE ports,
DWORD buff_size,
LPDWORD buff_needed,
LPDWORD no_ports)
{
HANDLE reg_key_handle;
DWORD max_port_name_chars, rc;
MONITORREG *monitorreg;
MONITORINIT *monitorinit;
struct ommonitor_str *ommonitor;
DWORD nports;
int struct_bytes;
int string_bytes;
LPWSTR *SourceStrings, *pSourceStrings;
WCHAR *strings, reg_subkey[64];
FILETIME ftLastAccess;
DWORD subkey_buff_len;
PORT_INFO_1 *pPortInfo1;
PORT_INFO_2 *pPortInfo2;
ommonitor = monitor;
monitorinit = ommonitor->monitorinit;
monitorreg = ommonitor->monitorinit->pMonitorReg;
*buff_needed = 0;
wcscpy(reg_subkey, L"");
if ((rc = monitorreg->fpOpenKey(monitorinit->hckRegistryRoot,
reg_subkey,
KEY_READ,
®_key_handle,
monitorinit->hSpooler)) !=
ERROR_SUCCESS)
{
fwprintf(ommonitor->lfp, L"Init %d: Failed to open registry at
root\n");
fflush(ommonitor->lfp);
return FALSE;
}
// find out how many sub-keys (ports) we've got
nports = 0;
max_port_name_chars = 0;
if ((rc = monitorreg->fpQueryInfoKey(reg_key_handle,
&nports,
&max_port_name_chars,
NULL, NULL, NULL, NULL, NULL,
monitorinit->hSpooler)) !=
ERROR_SUCCESS)
{
monitorreg->fpCloseKey(reg_key_handle, monitorinit->hSpooler);
fwprintf(ommonitor->lfp,
L"OMEnumPorts: Failed to read registry info to enumerate
ports\n");
fflush(ommonitor->lfp);
return FALSE;
}
fprintf(ommonitor->lfp, "%d ports to enumerate, largest %d\n",
nports, max_port_name_chars);
fflush(ommonitor->lfp);
// are there any ports to enumerate?
if (nports == 0)
{
monitorreg->fpCloseKey(reg_key_handle, monitorinit->hSpooler);
fwprintf(ommonitor->lfp, L"OMEnumPorts: No ports defined (key has
no sub-keys)\n");
fflush(ommonitor->lfp);
return TRUE;
}
max_port_name_chars++;
// each returned structure is a struct with the associated string(s)
struct_bytes = 0;
string_bytes = 0;
if (level == 1)
{
struct_bytes = sizeof (PORT_INFO_1);
string_bytes = max_port_name_chars * sizeof(WCHAR);
}
else
{
if (level == 2)
{
struct_bytes = sizeof(PORT_INFO_2);
string_bytes = max_port_name_chars * sizeof(WCHAR);
string_bytes += (wcslen(MONITOR_NAME) + 1) * sizeof(WCHAR);
string_bytes += (wcslen(MONITOR_PORT_NAME) + 1) *
sizeof(WCHAR);
}
else
{
fprintf(ommonitor->lfp, "OMEnumPorts: Info level %ld is not
supported", level);
monitorreg->fpCloseKey(reg_key_handle, monitorinit->hSpooler);
return FALSE;
}
}
// get total for all the ports
*buff_needed = nports * (struct_bytes + string_bytes);
// has the caller allocated enough space?
if (buff_size < *buff_needed || ports == NULL)
{
SetLastError(ERROR_INSUFFICIENT_BUFFER);
monitorreg->fpCloseKey(reg_key_handle, monitorinit->hSpooler);
return FALSE;
}
memset(ports, '\0', buff_size);
// set ptr to work from end of struct(s) to end of buffer
strings = (WCHAR *) (ports + buff_size - (nports * string_bytes));
// copy each port's details over to the supplied buffer
// (we're using strings as a pointer)
subkey_buff_len = (ports + buff_size) - (byte *) strings;
*no_ports = 0;
while ((rc = monitorreg->fpEnumKey(reg_key_handle,
*no_ports,
strings,
&subkey_buff_len,
&ftLastAccess,
monitorinit->hSpooler)) ==
ERROR_SUCCESS)
{
// copy info over for requested info level
switch (level)
{
case 1:
pPortInfo1 = (PORT_INFO_1 *) ports;
pPortInfo1[*no_ports].pName = strings;
strings += (wcslen(strings) + sizeof(WCHAR));
break;
case 2:
pPortInfo2 = (PORT_INFO_2 *) ports;
pPortInfo2[*no_ports].pPortName = strings;
strings += (wcslen(strings) + sizeof(WCHAR));
wcscpy(strings, MONITOR_NAME);
pPortInfo2[*no_ports].pMonitorName = strings;
strings += (wcslen(strings) + sizeof(WCHAR));
wcscpy(strings, MONITOR_PORT_NAME);
pPortInfo2[*no_ports].pDescription = strings;
strings += (wcslen(strings) + sizeof(WCHAR));
pPortInfo2[*no_ports].fPortType = PORT_TYPE_WRITE;
pPortInfo2[*no_ports].Reserved = 0;
break;
default:
fprintf(ommonitor->lfp,
"OMEnumPorts: Called with unsupported info level
%ld\n", level);
monitorreg->fpCloseKey(reg_key_handle,
monitorinit->hSpooler);
return FALSE;
break;
}
// increment count of ports
(*no_ports)++;
subkey_buff_len = (ports + buff_size) - (byte *) strings;
}
monitorreg->fpCloseKey(reg_key_handle, monitorinit->hSpooler);
return TRUE;
} Tag: PCL6 and postscript3 manual Tag: 59027
capture shutdown event from lower filter driver of disk driver
I am writing a driver which is a lower filter of disk class driver. My
driver needs to save its state to the physical disk when the shutdown occurs.
How do I capture the shutdown event in a driver at such a level? I actually
tried the IoRegisterShutdownNotification() and tried to handle the
IRP_MJ_SHUTDOWN. Although I can successfully registered for this event, I
couldn't receive the IRP_MJ_SHUTDOWN irp. I also tried the
SRB_FUNCTION_SHUTDOWN. although I can capture it I don't know what's the
difference between this command and IRP_MJ_SHUTDOWN irp and whether it is
save for my drive to conduct some block level write when handling
SRB_FUNCTION_SHUTDOWN.
thanks for any coming help
Paris Tag: PCL6 and postscript3 manual Tag: 59016
Can we load a .sys file from another .sys file
Hi,
Can we load a ".sys" file from kernal mode driver.
We have one driver with .sys extension, I am trying to write some other
driver with more functionalities. In order to reduce reusability I like to
load the previous .sys driver and use some of its functionalities.
P.S : I know that we can load ".dl"l but I don't know how to load .sys and
use its functionalities.
Thanks in advance.
Thanks
Santhosh. Tag: PCL6 and postscript3 manual Tag: 59014
how to detect media connect/disconnect asynchronously at NDIS level
I am reading data directly from a network interface using a modified
NDISPROT protocol driver. When somebody pulls the network cable the
ProtocolStatus routine triggers within the driver. From the user level
I can actively poll the miniport using OID_GEN_MEDIA_CONNECT_STATUS,
but is there a way to get notified asynchronously? If not, is checking
the miniport via the OID the best way or should I implement an
IoControl in NDISPROT instead?
Thanks for your help! Tag: PCL6 and postscript3 manual Tag: 59012
How to Virtual Serial Port Driver in Win98SE?
Hi,
Can anyone suggest me on how to implement virtual serial port driver in
98SE? I heard about ccport.sys and found out in the news group that a
bit buggy. Is there anyother way to implement virtual serial port in
win98SE? I'm trying to WDM virtual serial port driver into 98SE.
Or should I write a new Vxd virtual serial port driver to interact with
WDM USB driver?
thank you very much,
Bandu Tag: PCL6 and postscript3 manual Tag: 59005
this is regarding rebooting system after driver install or uninstall
hi all,
i am very new to the windows device driver development.
now i am learning how to write a driver .
in this process i have created a sample driver having only these
functions i.e DriverEntry , AddDevice and Unload.
so with this code i am able to install the driver.
now my question is every time i install driver or uninstall driver
,system is asking for reboot.so,can any one give me a solution such
that i can avoid rebooting the system and still be able to
install/uninstall driver.
what i want is i don't want to restart my system once driver is
installed or uninstalled.my OS is WIN2000 and the DDK i am using is
WINDDK .so ,tell me what all changes i need to make.
the code i have written is as follows:
#include <wdm.h>
NTSTATUS myAddDevice(IN PDRIVER_OBJECT DriverObject, IN
PDEVICE_OBJECT pdo);
VOID DriverUnload(IN PDRIVER_OBJECT fdo)
///Driver Entery
NTSTATUS DriverEntry( IN PDRIVER_OBJECT DriverObject, IN
PUNICODE_STRING RegistryPath )
{
DbgPrint ("Drv: Entered Driver Entry\n");
// Initialize Function Pointers
DriverObject->DriverUnload =3D DriverUnload;
DriverObject->DriverExtension->AddDevice =3D myAddDevice;
return STATUS_SUCCESS;
}
// DriverUnload
VOID DriverUnload(IN PDRIVER_OBJECT DriverObject)
{
DbgPrint ("Drv: Entered Driver unload\n");
} // DriverUnload
NTSTATUS myAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT
DeviceObject)
{
NTSTATUS status;
UNICODE_STRING ntDeviceName;
PDEVICE_OBJECT DeviceObject1 =3D NULL;
// Create a functional device object to represent the hardware
we're
managing.
DbgPrint ("Drv: Entered Add Device\n");
RtlInitUnicodeString(&ntDeviceName, L"\\Device\\myDummy");
status =3D IoCreateDevice(DriverObject,
1,
&ntDeviceName,
FILE_DEVICE_UNKNOWN,
0,
FALSE,
&DeviceObject1
);
if(!NT_SUCCESS(status))
DbgPrint ("Drv: IoCreateDevice() fails %x \n",status);
else
DbgPrint ("Drv: IoCreateDevice() success\n");
return status;}
and the .inf file i am using as follows:
; Driver.inf
;
; Installation file (.inf) for the Example Driver to Test device.
;
; (c) Copyright 2005 ESN Tech
;
[Version]
Signature=3D"$Windows NT$"
Provider=3D%ESN%
ClassGUID=3D{4d36e978-e325-11ce-bfc1-08002be10213}
Class=3D%ESN%
CatalogFile=3DDriver.cat
DriverVer=3D02/08/2005
[DestinationDirs]
DefaultDestDir =3D 12
;
; Driver information
;
[Manufacturer]
%ESN% =3D ESN.Mfg
[ESN.Mfg]
%ESN.DeviceDesc0% =3D Driver,
;
; General installation section
;
[Driver]
;
; File sections
;
;
; Service Installation
;
[Driver.Services]
AddService =3D Driver, 0x00000002 , Driver_Service_Inst,
Driver_EventLog_Inst
[Driver_Service_Inst]
ServiceType =3D 1 ; SERVICE_KERNEL_DRIVER
StartType =3D 3 ; SERVICE_DEMAND_START
ErrorControl =3D 0 ; SERVICE_ERROR_IGNORE
LoadOrderGroup =3D Pointer Port
ServiceBinary =3D %12%\Driver.sys
[Driver_EventLog_Inst]
AddReg =3D Driver_EventLog_AddReg
[Driver_EventLog_AddReg]
HKR,,EventMessageFile,0x00020000,"%SystemRoot%\System32\IoLo=ADgMsg.dll;%Sy=
stemRoot%\System32\drivers\Driver.sys"
HKR,,TypesSupported,0x00010001,7
[ClassInstall32]
AddReg=3DESN_addreg
[ESN_addreg]
HKR,,,,%ESN%
HKR,,Installer32,,"Desk.Cpl,DisplayClassInstaller"
HKR,,Icon,,"-1"
;
; Source file information
;
[SourceDisksNames.x86]
1 =3D %DiskId1%,,,""
[SourceDisksFiles]
; Files for disk ESN Tech Installation Disk #1 (Ports)
Driver.sys =3D 1,objchk_wxp_x86\i386,
[Driver]
CopyFil...@Driver.sys
[Strings]
;
; Non-Localizable Strings
;
REG_SZ =3D 0x00000000
REG_MULTI_SZ =3D 0x00010000
REG_EXPAND_SZ =3D 0x00020000
REG_BINARY =3D 0x00000001
REG_DWORD =3D 0x00010001
SERVICEROOT =3D "System\CurrentControlSet\Services"
;
; Localizable Strings
;
ESN.DeviceDesc0 =3D "Example Driver to Test"
DiskId1 =3D "ESN Tech Installation Disk #1 (ESN)"
ESN =3D "ESN Tech"
so i am expecting to provide me all the options that are available.
thanks for your replay=20
regards,=20
bharati. Tag: PCL6 and postscript3 manual Tag: 59003
AVstream Clock
Hi,
I have written a AVStream driver which exposes a Playback Filter and acts
like a renderer. This filter has a Video In pin for rendering the Video. This
Pin is supposed to support a clock to return the current Stream time.
I set the flag KSPIN_FLAG_IMPLEMENT_CLOCK in the KSPIN_DESCRIPTOR_EX for
this Pin. And declared a KSCLOCK_DISPATCH structure and included in the
KSPIN_DISPATCH structure for this pin.
My KSCLOCK_DISPATCH is like this.
const KSCLOCK_DISPATCH VideoInClockDispatch = {
NULL,
NULL,
(PFNKSPINCORRELATEDTIME)VideoInCorrelatedTime,
(PFNKSPINRESOLUTION)VideoInResolution
};
The function VideoInCorrelatedTime is defined like this
LONGLONG VideoInCorrelatedTime(IN PKSPIN Pin,
OUT PLONGLONG SystemTime);
Now when I render the Pin, the VideoInCorrelatedTime gets called. But the
parameter Pin is coming as some invalid Pointer. And after returning from
this funtion, I get a Page Fault in some unknown location ( not in driver ).
Could anyone let me know what could be going wrong.
What is the exact steps to support a clock on a Pin ?
Thanks a Lot.
Arun Tag: PCL6 and postscript3 manual Tag: 59002
64 bit SDK/DDK
Will NTDDK and 2KDDK (for kernel and user mode) still work for 64-bit? Or
should I use Windows 2003 Server DDK for 64-bit? Tag: PCL6 and postscript3 manual Tag: 58999
1394 talk/listen DMA buffer alignment requirements?
Hello. Since I could not find any definitive answer in the archive or the
docs, I'll ask here: for the cases of 1394 talk using equal sized packets
and listen (both using packet based DMA, i.e. RESOURCE_USE_PACKET_BASED),
are there any restrictions on alignment, size and/or straddling a page
boundary? I found some mention of this in the DDK, but only for the case of
DESCRIPTOR_HEADER_SCATTER_GATHER (which I stopped using). Are there any
descriptor buffer alignment/size/page_boundary_straddling restrictions for
the more general cases (i.e. no DESCRIPTOR_HEADER_SCATTER_GATHER and no
RESOURCE_VARIABLE_ISOCH_PAYLOAD for talk, plain listen, both packet based)?
thanks for your time,
Philip Lukidis Tag: PCL6 and postscript3 manual Tag: 58992