New at this... need direction
Hello,
I have been assigned to write a device driver for 2000 &
XP.
I am a seasoned developer with an M.S. in C.S.
I have zero experiece in writing device drivers.
I have downloaded the DDK.
Are there any web sites by MVP's that help?
Is there a FAQ?
Books?
I was told that I have to have a development tool, that
Visual Studio 6 will not do this. Is this correct?
Help me get started so that I can understand
the "vocabulary" of device drivers and better understand
the posts in this news group and allow me to ask precise
and informed questions.
Thank you,
Gil Tag: Windows Network Drivers course Tag: 34469
Example class installer for Win98
I've been tasked with writing a class installer for a Win98 driver.
Unfortunately, there seems to be a conspiracy of silence on this
subject. I have Googled until my mouse cramped. I have searched the
Knowledge Base. I have searched the Technical Resources. I have read
books (which have said there are no known samples and/or that the task
is "hard" and will not be addressed). I simply cannot believe that there
is not and never has been documentation on how to write a Windows 98
class installer DLL. After all, such installers do, in fact, exist!
I would greatly appreciate any guidance that any of you may have on this
topic. Feel free to email me directly, and I solemnly promise not to
break the sacred layer of secrecy by telling anyone else of your help.
Many thanks in advance.
--
Roy M. Silvernail
rsilvernail@parker.com Tag: Windows Network Drivers course Tag: 34462
PacketCE -> Windows CE.NET
Hi,
Did anyone try to modify PacketCE (version of WinPcap for Windows CE) to
use it under Windows CE.NET / with NDIS 5.1?
Is it a lot of work?
Can you provide me some help with the differences bteween NDIS 3.0 and
NDIS 5.1?
Thanks,
/Marco Tag: Windows Network Drivers course Tag: 34460
need help resolving crash cause
hi all
I have been working on a driver for winXP that emulates a
harddisk, based on hardware that connects to the system
through some General Purpose IO pins. therefore it is not
PnP Enumerable and is "manually" root enumerated using
IoReportDetectedDevice().
the DriverEntry and AddDevice routine load fine, and I can
use it as the current drive in the CMD utility, read,
write and copy from it, until it reports the following
correspondence with the system:
--------8<------------8<-----------
CREATE/CLOSE function issued. major=IRP_MJ_CREATE, minor=0
RemoveLock acquired with tag 80F33330
Unrecognized IOCTL 4D0008h
about to release RemoveLock with tag 80F33330
CREATE/CLOSE function issued. major=IRP_MJ_CLOSE, minor=0
CREATE/CLOSE function issued. major=IRP_MJ_CREATE, minor=0
RemoveLock acquired with tag 80F33330
Unrecognized IOCTL 4D0008h
about to release RemoveLock with tag 80F33330
CREATE/CLOSE function issued. major=IRP_MJ_CLOSE, minor=0
CREATE/CLOSE function issued. major=IRP_MJ_CREATE, minor=0
RemoveLock acquired with tag 80F33330
Unrecognized IOCTL 4D0008h
about to release RemoveLock with tag 80F33330
CREATE/CLOSE function issued. major=IRP_MJ_CLOSE, minor=0
------------8<-----------8<--------------------
which is followed by the shutdown of all the harddrive-
type drivers in the system. my driver is still operable
until other services need the original harddrives and
start crashing the system.
what is the meaning of the above IOCTLs? I can't find this
number in any .h file. it must be the result of some
sinister #define.
I tried to Install the checked version I downloaded from
MSDN, but so far the installation either gets stuck in the
file copying phaze or stops after not finding the license
agreement file (I would appreciate help on this one also).
thanks in advance,
iddan Tag: Windows Network Drivers course Tag: 34457
How to make Serenum sit on the top of virtual serial port driver?
Hello,
We have implemented virtual serial ports based on toaster
sample, but when use serenum instead of the toaster upper
filter driver, the installation is hang up.
Please help. Tag: Windows Network Drivers course Tag: 34454
How to create a driver using only WinDDK
Hello,
I am looking for a procedure or an example to create a
driver using only WinDDK ?
Thank you for advance.
Sincerely yours. Tag: Windows Network Drivers course Tag: 34453
Error during install
I want to install the sample toastmon from XP DDK. In the
corresponding inf file toastmon.inf are the entries
Class=Sample
ClassGUID={78A1C341-4539-11d3-B88D-00C04FAD5171}
Class sample isn't an existing setup interface class. How
shall I proceed? Tag: Windows Network Drivers course Tag: 34452
device reenumeration returns overlapped I/O operation in progress
I used devcon way to "Scan for Hardware changes".
On some XP(SP1) systems, CM_Reenumerate_DevNode_Ex returns
randomly
"Overlapped I/O operation in progress"
In the same time I can trigger a "Scan for Hardware
changes" from Computer Management without any problems.
Thanks in advance,
Daniel Tag: Windows Network Drivers course Tag: 34451
How to install genprint.dll??
Hi~,
I'm newbie in ms-windows and VC programming. :)
I should develop NT service program that prohibit user's printing any
documents.
I tested SetPrinter() and I found a problem.
Using SetPrinter() can't control network printer that attached in
other machine.
('Access denied' error is displayed when calling OpenPrinter() using
DesiredAccess set to PRINTER_ALL_ACCESS)
So I should find another method.
I want to block all printers installed in local machine(local printer
and network printer). But for the network shared printer, another
computer should can print using this network shared printer.
(Only a computer that my program is installed should be influenced by
my program)
Q.1 Can I hook printing event or job or print spooler?
(I think GetJob() also can't filter user's printing job...)
I posted this question to many newsgroups or forums but I didn't get
suitable answer(may be impossible??...)
Now, I'm testing Customized Print Processor using genprint.dll from
ddk.
I built and copy it to C:\WINNT\system32\spool\drivers\w32x86.
And I made its installation program.
int main()
{
...
nResult = GetPrintProcessorDirectory(...,processorPath,...);
_tcscat(processorPath, _T("\\genprint.dll"));
nResult = AddPrintProcessor(
NULL, // server name
NULL, // environment name
processorPath,//processorPath, // path
"My Processor" // ----> what string should I use??
);
}
It returns error string("The specified module could not be found.").
Q.2 Which string should I use in pPrintProcessorName field? and
processorPath string(C:\WINNT\system32\spool\drivers\w32x86\genprint.dll)
is right?
Q.3 If I success AddPrintProcessor(), how can I change Print Processor
to "My Processor" from "WinPrint" of existing printer?
Q.4 I can't change Print Processor property of network printer
manually(Print Processor button is disabled).
That means, using customized print processor also can't control
printing network printer?
Thanks in advance.
And I hope you can understand my poor english :) Tag: Windows Network Drivers course Tag: 34450
PCI sample driver for 2K
Hi,
Is there any place where I can find a sample PCI device driver for Windows 2000. Or can anybody mail me the skeletal driver of the PCI driver. I am a newbie and have to write a device driver for a PCI based device on win 2k.
Can anyone tell me if it is possible to have 2 drivers loaded for the same device?
One more question... Can a user application directly talk to this PCI device without any device driver in between? Somebody was saying something about IOCTLs... Is that the right lead?
Please help!
CSK Tag: Windows Network Drivers course Tag: 34447
handling multiple interrupts??
hello sir,
am working on developing wdm driver for a cpci carrier
board.four independent I/O modules can be mounted on a
carrier.so in a memory map there are four seperate memory
space for each i/o module.
usually in a application i call createevent & send it to
driver inturn driver calls ObReferenceObjectByHandle -
Registers Event in kernal mode.
on interrupt driver calls KeSetEvent to notify the app the
event.
there is a single driver & four different applications
comunicating with driver.
now the question is how do i handle interrupts??
should each application call create event & send to driver?
& how driver notify the different applications correctly
when multiple interrupts are generated?? how to hold each
application handle & notify to it? Tag: Windows Network Drivers course Tag: 34446
How to define the USB vendor specific command in Language monitor
Hello,
I'm trying to use IOCTL_USBPRINT_VENDOR_GET_COMMAND and
IOCTL_USBPRINT_VENDOR_SET_COMMAND to communicate with UsbPrint in my
language monitor but I have no idea how I can set and read the internal irp
packet (Irp->AssociatedIrp.SystemBuffer...)
Is there any way to use these command in GetPrinterDataFromPort function of
language monitor that call Port monitor's GetPrinterDataFromPort with
parameters (inbuffer,inbufferSize, outbuffer, outbufferSize)..
Can I just assume that inbuffer/outBuffer as Irp's Systembuffer?
Thanks
Jeth Tag: Windows Network Drivers course Tag: 34437
network connection properties
Hello,
I would like to add a panel to the Network Connection
Properties (in addition to General, Advanced, etc). Is
there an example of how to do this?
Thanks,
David Tag: Windows Network Drivers course Tag: 34433
Video Card Drivers - Signed Drivers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello,c
1. Is there any place where I can find out (before purchasing)
whether or not a Video Card vendor uses signed drivers?
2. Is there some way I can determine this from examining updated
drivers---without actually having the hardware to attempt an
installation?
This information seems to be lacking from catalog entries and from
the specifications on the packaging.
Background:
I have a Creative GeForce2 Blaster 2 video card. It is about 2 years
old.
I am running Windows 2000 with all patches.
I like to set Windows to reject attempts to install an unsigned
driver. I consider this to be a nice, simple step to increase
security.
Unfortunately, I cannot do this because of my video card.
Thanks,
- -G
-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.2
iQA/AwUBP5Wsz5na0kUWp81LEQJV/gCcD2lUEmUMAF2QEARzRcVJ1jNxVcEAoP3J
K0B3d+k9apo9cNh2R5WPIBDK
=B7eo
-----END PGP SIGNATURE----- Tag: Windows Network Drivers course Tag: 34428
binding intermediate to specific miniport
Hello,
I am using the MUX intermediate driver example in the DDK
source. I would like to make sure that it only binds to
the specific miniport driver (not just via the NDIS_MEDIUM
selection). Is it possible? Do I have to use the notify
object to do this?
Thanks,
David Tag: Windows Network Drivers course Tag: 34425
document on LSP Sample from microsoft
Hi All-
I've downloaded Microsoft SDK, which I'm interested on the
LSP sample code. do you know if there is a documentation
analyzing the sample code? Tag: Windows Network Drivers course Tag: 34419
IPSec Offload capable Gigabit NIC's
Does anyone know of any vendor out there selling Gibabit NIC's capable of
offloading IPSec.
Thanks
Tim Tag: Windows Network Drivers course Tag: 34417
Device Code
I am wondering how I match up a PCI Base Class code with a INF file
class.
I have a device that has an Base Class 07 and Subclass 80, a Simple
Communications Controller, other communications device. I wrote a
driver that works with it, but I get a new device detected message every
time Windows boots up. What entry do I need in my INF file to tell
Windows this is the driver for that device? I am using Windows 2000.
Thanks,
Clint Tag: Windows Network Drivers course Tag: 34415
USB block size
I encountered in my Language Monitor a major difference in data handling
when I use a parallel port vs . a USB port to print to my printer.
The parallel IO is transferring data in blocks of 64K and the USB has only a
block size of 4K. This caused some unexpected behavior at the end of a print
job so I am looking for a way to change the block size for the USB port to
reflect the same size as the parallel.
Does anybody know if I can change the block size when opening the port in
the Language Monitor?
What about the write and read timeouts, can they be changed down in the
Language Monitor as well or is this to be done in an application?
Help with these questions is much appreciated.
/Manfred Tag: Windows Network Drivers course Tag: 34409
Get network adapter disable/enable status thru wmi
Hi All,
Is it possible to determine thru WMI whether a network interface is
either enabled or disabled.
Devcon sample in winddk displays this status but i would like to know
if the same can be obtained from WMI.
"Win32_NetworkAdapter" class has two attributes
string Status;
uint16 StatusInfo;
when i see these values for network interface thru wbemtest.exe values
are null.
According to the description of "StatusInfo" this should be able to
give me enabled or disabled status.
Is there any other way thru WMI to detect enabled/disable status.
Thanxs & Regards,
Vijay Chegu
PS: Plz note i dont want network connection status, i want
enable/disable status which can be altered in "network and dialup
connections" window through right click.
//vijaycheguwmienabledisable Tag: Windows Network Drivers course Tag: 34405
read Flashdisc on Windows PC (newbie)
I have a USB FlashReader from Quatech, PCD-U, which supports a 16Mb
PCMCIA PC Card from SanDisk. The cards that I need to read have NOT
been written as files on discs, but in what I suppose to be a "regular
memory format". The software from Quatech seems to only support "disc
formatted" PC cards, although I am by no means sure of that. I am
running on a Windows XP machine and am also the proud possessor of a
MSDN Universal subscription that seems to include everything from
Microsoft that I would ever need.
My question is - what do I do next? I cannot seem to find any examples
or sample code for reading a flash memory card via USB with whatever
handler/driver combo is necessary.
Any pointers would be greatly appreciated.
TIA
Bill Tag: Windows Network Drivers course Tag: 34404
ksproxy plugin design issues
I am considering design choices about controlling custom aspects of a USB2
camera. This camera driver is based on usbcamd2 and is currently proxied by
ksproxy. The intent is to create ksproxy plug-ins to result in the
following:
1) 1 or more property pages such that amcap, graphedit or the like can set
these custom properties and
2) A way to programmatically set these same properties from a dshow filter
via some method.
Regarding the programmatic control of the filter:
a) Is it better to create a custom interface so that from the client filter
I can QI the base capture filter or is it better to QI the base capture
filter for IKsPropertySet and set the properties directly? The first choice
would seem better as it would introduce a layer of indirection such that
there would not be such a tight coupling between the minidriver and its
usermode clients.
b) If I were to use the custom interface, would it be better to implement it
via IKsPropertySet or via KsGetObjectHandle and issue IOCTL_KS_PROPERTY?
They seem identical.
Regarding ksproxy plugins in general. What is the mechinism linking the
extension COM objects to ksproxy? The examples I have seen all seem to have
an exact correspondence between one propertyset GUID in the minidriver with
one custom interface and one property page. Is this always the case? Are
the following alternatives possible:
1) A custom interface but with no associated property set?
2) Multiple custom property pages associated with a single property set?
3) A single propertyset with any number of interfaces and property pages
hung off it?
These questions reflect uncertainty about my ability to implement my current
thinking which is:
1) Add a one or more propertyset GUIDs to the minidriver to implement the
custom aspects of the camera.
2) Have a single custom COM interface in usermode to permit programatic
access to those aspects.
3) Have one or more property pages to permit amcap etc to access to aspects.
These property sheets would be implemented by using the custom inteface.
Regards,
Tom Udale Tag: Windows Network Drivers course Tag: 34403
Device could not start.
I have a PCI driver for our custom I/O board.
I generated the device driver with Walter's wizard. I
modified the Toaster class installer for our device. I
used a combination of the DDK inf generator and existing
inf files.
It looks like the driver worked just fine for a couple of
months.
Now, when I have one PCI card in the system, the device
manager reports: This device cannot start. (Code 10)
I can power down the machine, add a second card to the
same bus segment, and both cards work fine when I power
the system on.
Where should I start to look? Tag: Windows Network Drivers course Tag: 34398
replacing Unidrv UI dll.
Hi,
I'm developing a printer driver.It doesn't do any
rendering. All it does is displaying the UI to capture
print settings. That UI should have my own property
sheets.
Is it possible to replace Unidrvui.dll with my own ui dll
for Unidrv minidriver?
Or can I have a dummy rendering dll and my own UI dll?
What could be the implications?
Thanks,
Kiran Tag: Windows Network Drivers course Tag: 34397
Rendering Plugin's EnablePDEV
Hello,
I am currently developing a common rendering plugin for 5 serial
printers, In EnablePDEV() I tried using the pPrinterName parameter to
differentiate between my 5 printers so that I can insert customized
code for each printer model. My problem is, when I set the port to
FILE: It seems that the value of pPrinterName is always the default
printer(not the currently selected printer), It works fine when set to
other ports like LPT1.
Is this a specification?
Or maybe I'M doing it all wrong, Can anybody tell me how to get the
currently selected printer during or before EnablePDEV timing.
Thanks in advance
-andrew Tag: Windows Network Drivers course Tag: 34389
Interrupts in PCMCIA device driver
Hi,
I have been struggling with this problem for some time, so any help
from someone who has written a PCMCIA device driver would be greatly
appreciated!
I have written a working Win2K device driver for a PCI device, and am
now writing a device driver for the PCMCIA version of the device (some
code included below). My driver does not receive interrupts although
the call to IoConnectInterrupt() succeeds. I have gone through the
PSCR smartcard device driver code in the DDK samples. I am also
familiar with the DisabeISAToPCIRouting registry setting - didn't make
a difference in my case.
Is there something different one needs to do to receive interrupts in
a PCMCIA device driver as compared to a PCI device driver?
Thanks!
----------------- Some code from the driver ------------------------
GLOBALS Globals;
#ifdef ALLOC_PRAGMA
#pragma alloc_text (INIT, DriverEntry)
#pragma alloc_text (PAGE, PolarisAddDevice)
#pragma alloc_text (PAGE, PolarisCreateClose)
#pragma alloc_text (PAGE, PolarisDispatchIoctl)
#pragma alloc_text (PAGE, PolarisReadWrite)
#pragma alloc_text (PAGE, PolarisDispatchPnp)
#pragma alloc_text (PAGE, PolarisUnload)
#endif
NTSTATUS
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
)
{
// Save the RegistryPath.
Globals.RegistryPath.MaximumLength = RegistryPath->Length +
sizeof(UNICODE_NULL);
Globals.RegistryPath.Length = RegistryPath->Length;
Globals.RegistryPath.Buffer = ExAllocatePoolWithTag (
PagedPool,
Globals.RegistryPath.MaximumLength,
POLARIS_POOL_TAG);
if (Globals.RegistryPath.Buffer) {
RtlCopyUnicodeString(&Globals.RegistryPath, RegistryPath);
} else {
PolarisDebugPrint ((0, "Couldn't allocate pool for registry
path."));
return STATUS_INSUFFICIENT_RESOURCES;
}
// Populate the Dispatch routines
DriverObject->MajorFunction[IRP_MJ_PNP] =
PolarisDispatchPnp;
DriverObject->MajorFunction[IRP_MJ_POWER] =
PolarisDispatchPower;
DriverObject->MajorFunction[IRP_MJ_CREATE] =
PolarisCreateClose;
DriverObject->MajorFunction[IRP_MJ_CLOSE] =
PolarisCreateClose;
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] =
PolarisDispatchIoctl;
DriverObject->MajorFunction[IRP_MJ_READ] =
PolarisReadWrite;
DriverObject->MajorFunction[IRP_MJ_WRITE] =
PolarisReadWrite;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] =
PolarisCleanup;
// Populate AddDevice/DriverUnload
DriverObject->DriverExtension->AddDevice =
PolarisAddDevice;
DriverObject->DriverUnload =
PolarisUnload;
return STATUS_SUCCESS;
}
/*
* This routine adds a device to the system
*/
NTSTATUS
PolarisAddDevice(
IN PDRIVER_OBJECT DriverObject,
IN PDEVICE_OBJECT PhysicalDeviceObject
)
{
NTSTATUS status = STATUS_SUCCESS;
PDEVICE_OBJECT deviceObject = NULL;
PPOLARIS_DEVICE_INFO pDeviceInfo = NULL;
POWER_STATE powerState;
PAGED_CODE();
// Create a device
status = IoCreateDevice (DriverObject,
sizeof (POLARIS_DEVICE_INFO),
NULL,
FILE_DEVICE_NETWORK,
FILE_DEVICE_SECURE_OPEN,
FALSE,
&deviceObject);
if (!POLARIS_SUCCESS (status)) {
return status;
}
// Initialize the device extension.
pDeviceInfo = (PPOLARIS_DEVICE_INFO) deviceObject->DeviceExtension;
// Set the initial state of the FDO
INITIALIZE_PNP_STATE(pDeviceInfo);
// Store the PDO
pDeviceInfo->UnderlyingPDO = PhysicalDeviceObject;
// Set device power state
pDeviceInfo->DevicePowerState = PowerDeviceD0;
// Tell lower driver the power state
powerState.DeviceState = pDeviceInfo->DevicePowerState;
PoSetPowerState ( deviceObject, DevicePowerState, powerState );
// Tell the Plug & Play system that this device will need an
interface
status = IoRegisterDeviceInterface (
PhysicalDeviceObject,
(LPGUID) &GUID_CISCO_AIRO_DEVICE_INTERFACE_CLASS,
NULL,
&pDeviceInfo->InterfaceName);
if (!POLARIS_SUCCESS (status)) {
IoDeleteDevice (deviceObject);
PolarisDebugPrint ((2, "PolarisAddDevice: returning status:
%d\n", status));
return status;
}
// Attach device to the device stack
pDeviceInfo->NextLowerDriver = IoAttachDeviceToDeviceStack(
deviceObject,
PhysicalDeviceObject);
//
// Initialize Remove Lock
//
IoInitializeRemoveLock (&pDeviceInfo->RemoveLock ,
POLARIS_POOL_TAG,
1, // MaxLockedMinutes
5); // HighWatermark, this parameter is used only on checked
build.
// Set the flag if the device is not holding a pagefile
// crashdump file or hibernate file.
// Clear the DO_DEVICE_INITIALIZING flag.
// Note: Do not clear this flag until the driver has set the
// device power state and the power DO flags.
deviceObject->Flags |= DO_BUFFERED_IO;
deviceObject->Flags |= DO_POWER_PAGABLE;
deviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
pDeviceInfo->Self = deviceObject;
pDeviceInfo->Removed = FALSE;
pDeviceInfo->Started = FALSE;
pDeviceInfo->InterruptRegistered = FALSE;
pDeviceInfo->RxBufferLen = 32 * PAGE_SIZE; // Hardcoded ?
#ifdef BLOCKING_READ
pDeviceInfo->ReadEventHandle = NULL;
pDeviceInfo->ReadTimeOut.QuadPart = -(10000 * 2000); // 1 second
timeout, hardcoded
#endif
return status;
}
/*
* This routine handles PnP IRPs
*/
NTSTATUS
PolarisDispatchPnp (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
{
PPOLARIS_DEVICE_INFO pDeviceInfo;
PIO_STACK_LOCATION stack;
PDEVICE_OBJECT attachedPDO;
NTSTATUS status = STATUS_SUCCESS;
BOOLEAN irpSkipped = FALSE;
PolarisDebugPrint((3, "PolarisDispatchPnp called\n"));
PAGED_CODE ();
pDeviceInfo = (PPOLARIS_DEVICE_INFO) DeviceObject->DeviceExtension;
attachedPDO = pDeviceInfo->NextLowerDriver;
stack = IoGetCurrentIrpStackLocation (Irp);
if (Deleted == GET_CURRENT_PNP_STATE(pDeviceInfo)) {
// Since the device is removed, we will not hold any IRPs.
// We just fail it.
Irp->IoStatus.Status = STATUS_DELETE_PENDING;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return STATUS_DELETE_PENDING;
}
// Acquire the remove lock
status = IoAcquireRemoveLock (&pDeviceInfo->RemoveLock, Irp);
if (!POLARIS_SUCCESS (status)) {
Irp->IoStatus.Status = status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
return status;
}
// Print minor function
PolarisDebugPrint((0, "PnP Minor function: %s\n",
PnPMinorFunctionString(stack->MinorFunction)));
// Process IRP
switch (stack->MinorFunction) {
case IRP_MN_START_DEVICE:
if (!pDeviceInfo->Started) {
// We have to call the underlying driver first
status = PolarisCallLowerDriver(attachedPDO, Irp);
if (status == STATUS_SUCCESS) {
// The device is starting.
status = PolarisStartDevice(DeviceObject, Irp);
if(POLARIS_SUCCESS(status))
{
status =
IoSetDeviceInterfaceState(&pDeviceInfo->InterfaceName, TRUE);
if (!POLARIS_SUCCESS (status)){
PolarisDebugPrint((0, "IoSetDeviceInterfaceState
failed: 0x%x\n", status));
Irp->IoStatus.Status = status;
IoCompleteRequest (Irp, IO_NO_INCREMENT);
// Release the remove lock
IoReleaseRemoveLock(&pDeviceInfo->RemoveLock, Irp);
return status;
}
// Set the PnP state to Started
SET_NEW_PNP_STATE(pDeviceInfo, Started);
pDeviceInfo->Started = TRUE;
pDeviceInfo->Removed = FALSE;
HardwareEnableInterrupts(pDeviceInfo);
}
}
}
break;
case IRP_MN_QUERY_REMOVE_DEVICE:
status = PolarisCanRemoveDevice(DeviceObject);
if(POLARIS_SUCCESS(status))
{
SET_NEW_PNP_STATE(pDeviceInfo, RemovePending);
status = PolarisCallLowerDriver(attachedPDO, Irp);
}
break;
case IRP_MN_SURPRISE_REMOVAL:
// The device has been unexpectedly removed from the machine
// and is no longer available for I/O. Stop all access to the
device.
// Release any resources associated with the device, but leave
the
// device object attached to the device stack until the PnP
Manager
// sends a subsequent IRP_MN_REMOVE_DEVICE request.
// You should fail any outstanding I/O to the device. You will
// not get a remove until all the handles open to the device
// have been closed.
pDeviceInfo->Removed = TRUE;
pDeviceInfo->Started = FALSE;
// Release system resources
status = PolarisReleaseResources(DeviceObject);
if(POLARIS_SUCCESS(status))
{
// Set the PnP state to SurpriseRemovePending
SET_NEW_PNP_STATE(pDeviceInfo, SurpriseRemovePending);
}
break;
case IRP_MN_REMOVE_DEVICE:
// Relinquish all resources here.
// Detach and delete the device object so that
// your driver can be unloaded. You get remove
// either after query_remove or surprise_remove.
if(!pDeviceInfo->Removed)
{
pDeviceInfo->Removed = TRUE;
pDeviceInfo->Started = FALSE;
// Stop the Adapter
HardwareStopAdapter(pDeviceInfo);
// Release system resources
status = PolarisReleaseResources(DeviceObject);
if(POLARIS_SUCCESS(status))
{
// Set the PnP state to SurpriseRemovePending
SET_NEW_PNP_STATE(pDeviceInfo, RemovePending);
}
status = PolarisCallLowerDriver(attachedPDO, Irp);
}
if(POLARIS_SUCCESS(status))
{
// Set the PnP state to Deleted
SET_NEW_PNP_STATE(pDeviceInfo, Deleted);
// Disable the interface
IoSetDeviceInterfaceState(&pDeviceInfo->InterfaceName,
FALSE);
// Remove the device and all references
IoDeleteSymbolicLink(&pDeviceInfo->InterfaceName);
IoDetachDevice(pDeviceInfo->NextLowerDriver);
IoDeleteDevice(DeviceObject);
}
break;
case IRP_MN_QUERY_STOP_DEVICE:
status = PolarisCanStopDevice(DeviceObject);
if(POLARIS_SUCCESS(status))
{
SET_NEW_PNP_STATE(pDeviceInfo, StopPending);
status = PolarisCallLowerDriver(attachedPDO, Irp);
}
break;
case IRP_MN_STOP_DEVICE:
if(pDeviceInfo->Started) {
// Stop the Adapter
HardwareStopAdapter(pDeviceInfo);
// Release system resources
status = PolarisReleaseResources(DeviceObject);
if(POLARIS_SUCCESS(status))
{
// Mark the device as stopped.
IoSetDeviceInterfaceState(&pDeviceInfo->InterfaceName,
FALSE);
SET_NEW_PNP_STATE(pDeviceInfo, Stopped);
}
pDeviceInfo->Started = FALSE;
status = PolarisCallLowerDriver(attachedPDO, Irp);
}
break;
default:
// This is an Irp that is only useful for underlying drivers
status = PolarisCallLowerDriver(attachedPDO, Irp);
irpSkipped = TRUE;
break;
}
if (irpSkipped == FALSE) {
// Don't touch the status field of irps we don't process
Irp->IoStatus.Status = status;
}
PolarisDebugPrint((3, "PolarisDispatchPnp status: 0x%x\n",
status));
IoCompleteRequest(Irp, IO_NO_INCREMENT);
// Release the remove lock
IoReleaseRemoveLock(&pDeviceInfo->RemoveLock, Irp);
return status;
}
NTSTATUS
PolarisStartDevice (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp
)
{
PCM_RESOURCE_LIST resourcesTranslated;
PCM_RESOURCE_LIST resources;
PCM_PARTIAL_RESOURCE_DESCRIPTOR resource;
PCM_PARTIAL_RESOURCE_DESCRIPTOR resourceTranslated;
PCM_PARTIAL_RESOURCE_LIST partialResourceList;
PCM_PARTIAL_RESOURCE_LIST partialResourceListTranslated;
PCM_FULL_RESOURCE_DESCRIPTOR fullListTranslated;
PIO_STACK_LOCATION stack;
PPOLARIS_DEVICE_INFO pDeviceInfo;
NTSTATUS status = STATUS_SUCCESS;
ULONG index;
BOOLEAN foundInterruptResource = FALSE;
int count = 0;
PAGED_CODE();
// PolarisDebugPrint((3, "PolarisStartDevice called\n"));
pDeviceInfo = (PPOLARIS_DEVICE_INFO) DeviceObject->DeviceExtension;
stack = IoGetCurrentIrpStackLocation (Irp);
//
// Do whatever initialization needed when starting the device:
// gather information about it, update the registry, etc.
//
if ((NULL != stack->Parameters.StartDevice.AllocatedResources) &&
(NULL != stack->Parameters.StartDevice.AllocatedResourcesTranslated))
{
//
// Set up the resource information that we will use to access
the
// controller hardware. We always expect only 1 full set of
resources.
// In that list we expect a DMA channel, an Interrupt vector,
and 2 I/O Port
// ranges. If we don't see all the required resources we will
woof.
//
resourcesTranslated =
stack->Parameters.StartDevice.AllocatedResourcesTranslated;
partialResourceListTranslated =
&resourcesTranslated->List[0].PartialResourceList;
resourceTranslated =
&partialResourceListTranslated->PartialDescriptors[0];
resources =
stack->Parameters.StartDevice.AllocatedResources;
partialResourceList =
&resources->List[0].PartialResourceList;
resource =
&partialResourceList->PartialDescriptors[0];
ASSERT( resourcesTranslated->Count == 1 );
fullListTranslated = &resourcesTranslated->List[0];
// Set up the bus information
pDeviceInfo->BusType = fullListTranslated->InterfaceType;
pDeviceInfo->BusNumber = fullListTranslated->BusNumber;
PolarisDebugPrint((0, "PolarisStartDevice: BusType = %d\n",
pDeviceInfo->BusType));
//
// Parameters.StartDevice.AllocatedResources points to a
// CM_RESOURCE_LIST describing the hardware resources that
// the PnP Manager assigned to the device. This list contains
// the resources in raw form. Use the raw resources to program
// the device.
//
// Parameters.StartDevice.AllocatedResourcesTranslated points
// to a CM_RESOURCE_LIST describing the hardware resources that
// the PnP Manager assigned to the device. This list contains
// the resources in translated form. Use the translated
resources
// to connect the interrupt vector, map I/O space, and map
memory.
//
// If it is a PCI card, do 16-bit I/O operations
if (pDeviceInfo->BusType == PCIBus) {
do8bitIO = 0;
}
for (index = 0; index < partialResourceList->Count; index++,
resource++, resourceTranslated++) {
switch (resource->Type) {
case CmResourceTypePort:
{
// use the second port, device dependent condition
if (pDeviceInfo->BusType == PCIBus) {
if (count == 0 ) {
count ++;
break;
}
}
switch (resourceTranslated->Type) {
case CmResourceTypePort:
// PolarisDebugPrint((2, "Resource
RAW Port: (%x) Length: (%d)\n",
// resource->u.Port.Start.LowPart,
resource->u.Port.Length));
//
// PolarisDebugPrint((2,
// "Resource Translated
Port: (%x) Length: (%d)\n",
//
resourceTranslated->u.Port.Start.LowPart,
//
resourceTranslated->u.Port.Length));
// Set the base I/O address of the device
pDeviceInfo->DeviceBaseIO = (UCHAR
*)resourceTranslated->u.Port.Start.u.LowPart;
break;
case CmResourceTypeMemory:
PolarisDebugPrint((2,
"Resource Translated Memory: (%x) Length:
(%d)\n",
resourceTranslated->u.Memory.Start.LowPart,
resourceTranslated->u.Memory.Length));
//
// Perform memory mapping here.
//
break;
default:
// PolarisDebugPrint((0,
"PolarisStartDevice: Unhandled resource_type (0x%x)\n",
//
resourceTranslated->Type));
TRAP ();
break;
}
}
break;
case CmResourceTypeDma:
{
DEVICE_DESCRIPTION deviceDesc;
PolarisDebugPrint((0, "PolarisStartDevice: DMA -
%04x\n", resourceTranslated->u.Dma.Channel) );
// Call PolarisSetupDMA() here if DMA is needed
}
break;
case CmResourceTypeMemory:
// PolarisDebugPrint((2, "Resource RAW
Memory: (%x) Length: (%d)\n",
// resource->u.Memory.Start.LowPart,
resource->u.Memory.Length));
// PolarisDebugPrint((2, "Resource
Translated Memory: (%x) Length: (%d)\n",
//
resourceTranslated->u.Memory.Start.LowPart,
resourceTranslated->u.Memory.Length));
// Perform memory address mapping with
PolarisMapDeviceAddress().
break;
case CmResourceTypeInterrupt:
// PolarisDebugPrint((0,
"PolarisStartDevice: CmResourceTypeInterrupt\n"));
if ( resourceTranslated->Flags &
CM_RESOURCE_INTERRUPT_LATCHED) {
pDeviceInfo->InterruptMode = Latched;
} else {
pDeviceInfo->InterruptMode = LevelSensitive;
}
pDeviceInfo->ControllerVector =
resourceTranslated->u.Interrupt.Vector;
pDeviceInfo->ProcessorMask =
resourceTranslated->u.Interrupt.Affinity;
pDeviceInfo->ControllerIrql =
(KIRQL)resourceTranslated->u.Interrupt.Level;
pDeviceInfo->SharableVector = TRUE;
pDeviceInfo->SaveFloatState = FALSE;
foundInterruptResource = TRUE;
break;
default:
// PolarisDebugPrint((0, "Unhandled
resource type (0x%x)\n", resource->Type));
break;
}
}
if (foundInterruptResource == TRUE) {
// PolarisDebugPrint((0, "PolarisStartDevice:
Connecting Interrupt\n"));
// Initialize the spin lock
KeInitializeSpinLock(&pDeviceInfo->IntrSpinLock);
// Connect the interrupt
status = IoConnectInterrupt( &pDeviceInfo->InterruptObject,
PolarisISR,
pDeviceInfo,
&pDeviceInfo->IntrSpinLock,
pDeviceInfo->ControllerVector,
pDeviceInfo->ControllerIrql,
pDeviceInfo->ControllerIrql,
pDeviceInfo->InterruptMode,
pDeviceInfo->SharableVector,
pDeviceInfo->ProcessorMask,
pDeviceInfo->SaveFloatState );
if ( POLARIS_SUCCESS(status) ) {
pDeviceInfo->InterruptRegistered = TRUE;
} else {
return status;
}
}
// If successful and got memory/IO space, initialize the H/W
if ( POLARIS_SUCCESS(status) &&
((pDeviceInfo->DeviceVirtualAddress) ||
(pDeviceInfo->DeviceBaseIO)) ) {
// Initialize the Hardware
status = HardwareInitializeAdapter(pDeviceInfo,
pDeviceInfo->DeviceBaseIO);
if (!POLARIS_SUCCESS(status)) {
return STATUS_UNSUCCESSFUL;
}
}
}
// PolarisDebugPrint((0, "PolarisStartDevice: returning status:
0x%x\n", status));
return status;
}
void HardwareEnableInterrupts(PPOLARIS_DEVICE_INFO pDeviceInfo)
{
airo_info *ai = &(pDeviceInfo->ai);
USHORT status;
/* Reset the status register */
status = IN4500( ai, EVSTAT );
OUT4500( ai, EVACK, status );
/* Enable the interrupts */
if (!ai->interruptEnabled) {
OUT4500( ai, EVINTEN, STATUS_INTS );
ai->interruptEnabled = TRUE;
}
} Tag: Windows Network Drivers course Tag: 34387
a question about win2000 ddk PORTIO sample!!!!!!
I use win2k DDK to build the PORTIO sample in DDK successfully. But
something is wrong when I use the gpdread and gpdwrite to test the driver.
I use command line "GpdWrite -b 1 2" to write the number 2 to assigned 'base
port address + 1', and then "GpdRead -b 1 "to read out. But the number read
out is always 0xFF.
I also tested writing a number every 1000 milliseconds and reading every 600
millisecond, but the read-out number kept 0xFF.
what does the sample mean?
could you tell me why?
Softice driver suite(driverworks) contains similar sample, things are same.
____________________________________________________________________________
_________________________
Test OS: win2000 server
Develop Environment: win2k ddk, visual studio 6.0 sp5 Tag: Windows Network Drivers course Tag: 34386
Loading filter driver during OS install
I have a upper device filter driver that I need to load during install
(ie. Hit F6 for scsi drivers). I was wondering if this has been done
(I'm sure it has) and how to do it.
I wonder about whether the txtsetup.oem actually loads and parses the
inf early in the setup or not, and how you would actually code up the
txtsetup.oem.
Do you need to need to include a copy of the driver that your
filtering (and it's inf) on your driver disk as well, or will this
land from the media in time to be present when the filter driver's inf
is parsed.
-Dan Tag: Windows Network Drivers course Tag: 34383
Palettes and kernel-streaming driver (USBCAMD2)
Hello,
I am writing a USB camera mini-driver using
USBCAMD2. I have the basic driver working, but need to
get the video into the desired format for proper viewing
in DirectShow. The video is 8-bit grayscale, and is
interlaced (I receive two fields in one "frame" from the
camera and interlace them in the CamProcessRawVideoFrameEx
() function in my minidriver. They are displayed on the
screen using RGB8 (8-bit color.)
I would like to know how I can describe (or set
somehow) the color palette as a grayscale palette. I've
tried converting to RGB24 in the minidriver and
replicating the 8-bit pixel value that I receive from the
camera in the RGB fields. This works, but is so slow
that I'm dropping frames. Any suggestions or hints would
be appreciated.
Sincerely,
Howard M. Harte
========================
Harte Technologies, LLC.
(925) 551-0120 (voice)
(925) 551-0125 (fax)
http://www.hartetechnologies.com/ Tag: Windows Network Drivers course Tag: 34379
Custom USB Driver Development
Hi All
I'm a newbie at this, so apologies in advance for any
wrong information.
I'm trying to write custom usb drivers for one of the usb
products. I have win ddk and visual studio installed. Can
somone explain me/give me a link on how to approach this
problem. I'm quite lost at the moment and need serious
help in getting started.
pls advice
Regards Tag: Windows Network Drivers course Tag: 34376
USB Driver development
Hi All
I'm trying to generate custom drivers for one of our usb
devices. I have windows DDK and Visual Studio Installed.
Has anyone got a link that demonstrates how to proceed in
generating custom drivers. I'm a beginner at this and
kinda lost.
Pls advice
Regards Tag: Windows Network Drivers course Tag: 34375
How to detect Network Cable Unplugged?
Hi,
For a netwrok card (ie. ethernet), how does windows know
if the network cable is unplugged? Does the driver handle
any polling routine?
The reason I am asking is because I am trying to a virtual
network driver which drives the traffic to an
application. I need to find some way to determine if that
application is running.
Thanks,
Billy. Tag: Windows Network Drivers course Tag: 34368
HP deskjet on Windows XP
The driver for this printer is included in WinXP and
installs okay when plugging in the printers USB cable.
My problem is that on the paper size list there is
no "custom" size as refered to in the manual. I want to
print on 3X5 index cards which is also not on the list.
Even if I select a larger card like 4X6 and set margins
to reduce it to 3X5 size it prints outside the margins.
HP says I will have to wait for them to update the driver.
Anyone know of a quicker fix for this??? Tag: Windows Network Drivers course Tag: 34362
Driver to install a Digital Camera
I followed all the instructions and when I connect the
camera shows a note saying the driver for this harware is
not installed. Then ask me to use the Windows
MilleniumEdition disk which I don't have. How or where can
I get the disk. I need the answer as fast as you can.
Thanks Tag: Windows Network Drivers course Tag: 34361
How does windows handle PCMCIA
Ok, I really need to know how windows 2000/XP handles the insertion of a
PCMCIA card. What I have discovered with my card is that occasionally
(4-5%) of the time it works (I have found that in this case card enable is
activated) and the rest of the time it fails (card enable is not activated).
This only occures though within the VideoMiniport drivers. The PnP
Functional Driver I wrote does not seem to have this problem. So if anyone
can tell me/point me how exactly windows handles insertion or how the
Videominiport deals with it, I wolud greatly appreciate it.
--
Brian V. Minier
Interactive Imaging Systems, Inc
www.iisvr.com Tag: Windows Network Drivers course Tag: 34355
Visual Studio library path size limit
I have a project which takes quite a lot of library paths, due to our
environment setup. The problem now is that the line in the *.dsp filefor the
linker is more than 4Kb long. Is there a limit on how long the line may be?
I mean the
# ADD LINKER32 <linkeroptions>
in the dsp file.
When I paste in the project file all the library paths then Visual Studio can
compile it, but when I exit the project VC asks me to safe the changes to the
project file and when I try to reload the project the line is crippled.
Any ideas how to circumvent this size limit?
I tried to spread the line over several lines which worked, but as soon as I
change something in the settings Visual Studio will rewrite the dsp file and
create the long line again.
--
Gerhard Gruber
Für jedes menschliche Problem gibt es immer eine einfache Lösung:
Klar, einleuchtend und falsch. (Henry Louis Mencken) Tag: Windows Network Drivers course Tag: 34354
IoCancelIrp
Step 1. We create IRP: IoBuildDeviceIoControlRequest
Step 2. We pass IRP to other driver: IoCallDriver
Step 3. We want to cancel this IRP: can we call IoCancelIrp ?
The IRP can be already deleted by I/O Manager...
How long IRP leaves and when we can use pIrp pointer obtained in the
step 1?
Thanks, Vitaly Kravtsov
mailto:VitalyKravtsov@mail.ru Tag: Windows Network Drivers course Tag: 34339
VideoDriver and PCMCIA Function Configuration Registers
Is there a way to access the Function Configuration Registers is a
VideoMiniport driver. I can access (somewhat) I/O memory (given to me
through VideoPortGetAccessRanges) but nothing comes for the FCR's. Of
course, given that the card gets mapped to ISA (determined from the
VIDEO_PORT_CONFIG_INFO) I may not need to access the Registers. Also, any
one who is famialar with the internal workings of the VideoPort functions,
what PCMCIA Configuration Registers are needed for successful operation.
Currently we only support a subset of the registers PC-Card requires because
we are a CF-Card, could this cause a problem?
Thanks in advance, yet again.
--
Brian V. Minier
Interactive Imaging Systems, Inc
www.iisvr.com Tag: Windows Network Drivers course Tag: 34338
How can I get selected option items from property sheet page?
Hi.
I am developing a printer driver which prints any document to an image
file.
I am using Unidrv.dll and Win2000 DDK sample Oemui.dll. There is one
more
component, rendering plug-in. I added a new property sheet page and a
option
item using a method in Oemui.dll like below.
// source code //
HRESULT hrOEMDocumentPropertySheets(PPROPSHEETUI_INFO pPSUIInfo,
LPARAM lParam,
IPrintOemDriverUI* pOEMHelp)
{
LONG_PTR lResult;
............
// Do action.
switch(pPSUIInfo->Reason)
{
case PROPSHEETUI_REASON_INIT:
{
DWORD dwSheets = 0;
PCBUSERDATA pUserData;
POEMUIPSPARAM pOEMUIParam = (POEMUIPSPARAM)
pPSUIInfo->lParamInit;
HANDLE hHeap = pOEMUIParam->hOEMHeap;
POEMDEV pOEMDev = (POEMDEV)
pOEMUIParam->pOEMDM;
COMPROPSHEETUI Sheet;
DLGPAGE PageProp;
// Init property page.
memset(&Sheet, 0, sizeof(COMPROPSHEETUI));
Sheet.cbSize = sizeof(COMPROPSHEETUI);
Sheet.Flags = CPSUIF_UPDATE_PERMISSION;
Sheet.hInstCaller = ghInstance;
Sheet.pCallerName = GetStringResource(hHeap,
ghInstance, IDS_NAME);
Sheet.pHelpFile = NULL;
Sheet.pfnCallBack = OEMDocUICallBack;
Sheet.pDlgPage = CPSUI_PDLGPAGE_ADVDOCPROP;
Sheet.cOptItem = 1;
Sheet.IconID = IDI_CPSUI_PRINTER;
Sheet.pOptItemName = GetStringResource(hHeap,
ghInstance, IDS_SECTION);
Sheet.CallerVersion = 0x100;
Sheet.OptItemVersion = 0x100;
// Init user data.
pUserData = (PCBUSERDATA) HeapAlloc(hHeap,
HEAP_ZERO_MEMORY, sizeof(CBUSERDATA));
pUserData->hComPropSheet = pPSUIInfo->hComPropSheet;
pUserData->pfnComPropSheet =
pPSUIInfo->pfnComPropSheet;
pUserData->pOEMUIParam = pOEMUIParam;
Sheet.UserData = (ULONG_PTR) pUserData;
// Create OptItems for page.
Sheet.pOptItem = CreateOptItems(hHeap,
Sheet.cOptItem);
// Initialize OptItems
Sheet.pOptItem[0].cbSize = sizeof(OPTITEM);
Sheet.pOptItem[0].Level = 1;
Sheet.pOptItem[0].Flags = OPTIF_COLLAPSE;
Sheet.pOptItem[0].pName = GetStringResource(hHeap,
ghInstance, IDS_SECTION);
Sheet.pOptItem[0].Sel = pOEMDev->dwDriverData;
Sheet.pOptItem[0].pOptType = CreateOptType(hHeap, 3);
Sheet.pOptItem[0].pOptType->Type = TVOT_3STATES;
Sheet.pOptItem[0].pOptType->pOptParam[0].pData =
GetStringResource(hHeap, ghInstance, IDS_TIF);
Sheet.pOptItem[0].pOptType->pOptParam[1].pData =
GetStringResource(hHeap, ghInstance, IDS_JPG);
Sheet.pOptItem[0].pOptType->pOptParam[2].pData =
GetStringResource(hHeap, ghInstance, IDS_BMP);
Sheet.pOptItem[0].pOptType->pOptParam[0].IconID = IDS_TIF;
Sheet.pOptItem[0].pOptType->pOptParam[1].IconID = IDS_JPG;
Sheet.pOptItem[0].pOptType->pOptParam[2].IconID = IDS_BMP;
Sheet.pOptItem[0].pOptType->Count = 3;
// Add property sheets.
lResult =
pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet,
CPSFUNC_ADD_PCOMPROPSHEETUI,
(LPARAM)&Sheet,
(LPARAM)&dwSheets);
}
break;
............
}
pPSUIInfo->Result = lResult;
return S_OK;
}
And it works well. There was a newly added property sheet page in
printing dialog.
I'd like to let the user select an output file format(bmp, tif, etc.)
through
the property sheet page(using TVOT_3STATES in above source code) and
add some
more option items in the same sheet page.
The problem is that I don't have any idea how I can get the results of
what user selected through the option items in the property sheet
page.
There are some answers to similar question but not enough to
understand
how and what.
I'd like to use the selected options in rendering plug-in module.
Does anyone know the solution to this question? If possible, please
show me some sample source codes. Or explain in detail.
Thanks in advance. Tag: Windows Network Drivers course Tag: 34333
Multiple IRP requests from one driver to another
Hi All,
My driver uses standard serial port driver.
It set RTS signal and wait for CTS signal change.
1. Driver send IRP to serial port driver with control code
IOCTL_SERIAL_WAIT_ON_MASK
and doesn't wait for it.
2. Driver send IRP to serial port driver with control code
IOCTL_SERIAL_SET_RTS and wait for it.
3. Driver wait for first IRP through the Event, passed to
IoBuildDeviceIoControlRequest.
This approach does not work. User mode application is locked and driver can
not be unloaded.
May be the IoSetCompletionRoutine is solution ?
Thanks.
VitalyKravtsov
mailto:vitalykravtsov@mail.ru Tag: Windows Network Drivers course Tag: 34332
Protocol driver, don't understand
Hi,
I try to understand how to write my protocol driver for a WLAN adapter.
I read a sample in the PocketPC Platform Builder (Passthru). I don't
understand everything, and there's still one thing that I don't get: how
should I use this "driver" in my application to retrieve the packets?
Can you give me some information to better understand a protocol driver
and how to use it in an application.
Thank you
/Marco Tag: Windows Network Drivers course Tag: 34326
PrintProcessor Installation problems on Win98SE/Me
Hello All,
I developed a minidriver and relative Print Processor for
our Pos printer product on Win98Se and Me.
Then I wrote a .INF file for install the package.
The printer is installed correctly, but it doesn't catch
my PrintProcessor.
All the files (minidriver + printproc.) are copied in
C:\WINDOWS\SYSTEM.
But when I go to check with 'Regedit', what the
installation has written into registry, I can see that no
subkeys for my printprocess are been made in:
HKLM\System\CurrentControlSet\Control\Print\Environments\Wi
ndows 4.0\Print Processors; while the subkey of my
printer is present, and into it the field "Print
Processor" has "WinPrint" as value.
By the way, I started to develop my PrintProcessor from
Win98 DDK , modifing the Winprint sample included in
src\printers\spooler' subdirectory.
And, I took infos for insert printprocess from W98 DDK
documentation.
Where is my mistake? Somebody have any idea?
Please, Help me.
Below I inserted my INF file.
TIA Giandomenico.
[Version]
Signature=$CHICAGO$
ver=01.00.03
Class=Printer
Provider=%OLIVETTI%
LayoutFile=layout.inf,layout1.inf,layout2.inf
[SourceDisksNames]
1="PRT100 Res(180x180) PrinterDriver Disk",,0001
[Manufacturer]
"OLIVETTI"
[OLIVETTI]
"PRT100 Res(180x180) Receipt" = PRT100EP.DRV,PRT100 Res
(180x180) Receipt
"PRT100_180x180 ReduceA4" = PRT100RE.DRV,PRT100_180x180
ReduceA4
;
; Installer Sections
;
[PRT100EP.DRV]
CopyFiles=PRT100EP_COPY,UNI
DataSection=UNI_DATA,PRT_PROCESS
[PRT100RE.DRV]
CopyFiles=PRT100RE_COPY,UNI
DataSection=UNI_DATA,PRT_PROCESS
; Copy Sections
;
[PRT100EP_COPY]
PRT100EP.DRV
POSPRINT.DLL
[PRT100RE_COPY]
PRT100Re.DRV
POSPRINT.DLL
[UNI]
UNIDRV.DLL
UNIDRV.HLP
ICONLIB.DLL
;
; Data Sections
;
[UNI_DATA]
HelpFile=UNIDRV.HLP
DefaultDataType=RAW
[PRT_PROCESS]
PrintProcessor=%POS_PrintProcess%
[DestinationDirs]
DefaultDestDir=11
[SourceDiskeFiles]
PRT100EP.DRV=1,WIN98
PRT100Re.DRV=1,WIN98
POSPRINT.DLL=1,WIN98
;
; Localizable Strings
;
[Strings]
OLIVETTI="OLIVETTI"
CLASSNAME="Printer"
POS_PrintProcess="POSPrintPROCESS,POSPRINT.DLL" Tag: Windows Network Drivers course Tag: 34324
How can I get the results from newly added property sheet page?
Hi.
I am developing a printer driver which prints any document to an image
file.
I am using Unidrv.dll and Win2000 DDK sample Oemui.dll. There is one
more
component, rendering plug-in. I added a new property sheet page and a
option
item using a method in Oemui.dll like below.
// source code //
HRESULT hrOEMDocumentPropertySheets(PPROPSHEETUI_INFO pPSUIInfo,
LPARAM lParam,
IPrintOemDriverUI* pOEMHelp)
{
LONG_PTR lResult;
............
// Do action.
switch(pPSUIInfo->Reason)
{
case PROPSHEETUI_REASON_INIT:
{
DWORD dwSheets = 0;
PCBUSERDATA pUserData;
POEMUIPSPARAM pOEMUIParam = (POEMUIPSPARAM)
pPSUIInfo->lParamInit;
HANDLE hHeap = pOEMUIParam->hOEMHeap;
POEMDEV pOEMDev = (POEMDEV)
pOEMUIParam->pOEMDM;
COMPROPSHEETUI Sheet;
DLGPAGE PageProp;
// Init property page.
memset(&Sheet, 0, sizeof(COMPROPSHEETUI));
Sheet.cbSize = sizeof(COMPROPSHEETUI);
Sheet.Flags = CPSUIF_UPDATE_PERMISSION;
Sheet.hInstCaller = ghInstance;
Sheet.pCallerName = GetStringResource(hHeap,
ghInstance, IDS_NAME);
Sheet.pHelpFile = NULL;
Sheet.pfnCallBack = OEMDocUICallBack;
Sheet.pDlgPage = CPSUI_PDLGPAGE_ADVDOCPROP;
Sheet.cOptItem = 1;
Sheet.IconID = IDI_CPSUI_PRINTER;
Sheet.pOptItemName = GetStringResource(hHeap,
ghInstance, IDS_SECTION);
Sheet.CallerVersion = 0x100;
Sheet.OptItemVersion = 0x100;
// Init user data.
pUserData = (PCBUSERDATA) HeapAlloc(hHeap,
HEAP_ZERO_MEMORY, sizeof(CBUSERDATA));
pUserData->hComPropSheet = pPSUIInfo->hComPropSheet;
pUserData->pfnComPropSheet =
pPSUIInfo->pfnComPropSheet;
pUserData->pOEMUIParam = pOEMUIParam;
Sheet.UserData = (ULONG_PTR) pUserData;
// Create OptItems for page.
Sheet.pOptItem = CreateOptItems(hHeap,
Sheet.cOptItem);
// Initialize OptItems
Sheet.pOptItem[0].cbSize = sizeof(OPTITEM);
Sheet.pOptItem[0].Level = 1;
Sheet.pOptItem[0].Flags = OPTIF_COLLAPSE;
Sheet.pOptItem[0].pName = GetStringResource(hHeap,
ghInstance, IDS_SECTION);
Sheet.pOptItem[0].Sel = pOEMDev->dwDriverData;
Sheet.pOptItem[0].pOptType = CreateOptType(hHeap, 3);
Sheet.pOptItem[0].pOptType->Type = TVOT_3STATES;
Sheet.pOptItem[0].pOptType->pOptParam[0].pData =
GetStringResource(hHeap, ghInstance, IDS_TIF);
Sheet.pOptItem[0].pOptType->pOptParam[1].pData =
GetStringResource(hHeap, ghInstance, IDS_JPG);
Sheet.pOptItem[0].pOptType->pOptParam[2].pData =
GetStringResource(hHeap, ghInstance, IDS_BMP);
Sheet.pOptItem[0].pOptType->pOptParam[0].IconID = IDS_TIF;
Sheet.pOptItem[0].pOptType->pOptParam[1].IconID = IDS_JPG;
Sheet.pOptItem[0].pOptType->pOptParam[2].IconID = IDS_BMP;
Sheet.pOptItem[0].pOptType->Count = 3;
// Add property sheets.
lResult =
pPSUIInfo->pfnComPropSheet(pPSUIInfo->hComPropSheet,
CPSFUNC_ADD_PCOMPROPSHEETUI,
(LPARAM)&Sheet,
(LPARAM)&dwSheets);
}
break;
............
}
pPSUIInfo->Result = lResult;
return S_OK;
}
And it works well. There was a newly added property sheet page in
printing dialog.
I'd like to let the user select an output file format(bmp, tif, etc.)
through
the property sheet page(using TVOT_3STATES in above source code) and
add some
more option items in the same sheet page.
The problem is that I don't have any idea how I can get the results of
what user selected through the option items in the property sheet
page.
There are some answers to similar question but not enough to
understand how and
what.
I'd like to use the selected options in rendering plug-in module.
Does anyone know the solution to this question? If possible, please
show me some sample source codes. Or explain in detail.
Thanks in advance. Tag: Windows Network Drivers course Tag: 34322
linux's hdparm command equivalent in windows ??
Hi,
When I issue the hdparm -S command on western digital
hard disk, it does not sleep during inactivity.
I would like to know :
1. if there is any equivalent command of hdparm in windows.
2. if western digital hard disk does not sleep under
windwos too.
rgds
Shankar Tag: Windows Network Drivers course Tag: 34317
How to compiling Ndis 5.0 NDIS_WDM sample for Win98se/ windows 2000?
Dear sirs,
I have build ndis 5.0 driver(NDIS_WDM) running windows 2000 well, how can
I porting it to windows 98se/windows me? when I installed with windows 2000
version driver,got a problem as "NDIS.VXD,NTKERN.VXD could not be loaded".
How to solve this problem.
thanks.
lonely Tag: Windows Network Drivers course Tag: 34313
NDIS_WDM for Windows 2000 and Win98se/Me
I'm trying to load my working Windows 2000 NDIS 5.0 driver on Windows ME.
I've compiled using the BINARY_COMPATBLE switch, got a problem as "NDIS.VXD,
NTKERN.VXD could not be loaded", Why? Tag: Windows Network Drivers course Tag: 34312
About virtual serial setup problem
Hi,
I install virtual serial in win2k,it receive IRP_MN_QUERY_DEVICE_RELATIONS
and remove last serial port i added ,then new serial port replace it ,
Does anyone know why it is?
Thanks in advance
Fzcat Tag: Windows Network Drivers course Tag: 34310
Scheduled WorkItem takes two mintes to execute
Hi,
I experience long delays between the time I call NdisScheduleWorkItem
to the time the WorkItem is executed.
I have an NDIS miniport driver. When windows is shutting down it sends
me a managment request to filter all incoming packets.
I schedule this request with a work item.
It takes windows from 10 seconds to two minute! to execute the
workitem.
Does anyone know why it takes windows so long?
The OS i'm relating to is Win89SE. I have the shutdown patches
installed.
Thanks in advance,
Yoni Baron,
Conexant Systems. Tag: Windows Network Drivers course Tag: 34306
Using system DMA in PCI Device
I have a PCI Device and I want to write driver for it. The PCI bridge on the board is not busmaster and i can't use busmaster dma for dma operations. I want to know if i can use Syatem Dma to do Dma operations. and if i can, how may i add Dma Resource to PnP Resource list. Tag: Windows Network Drivers course Tag: 34301
Does the vender can disable any property page of the printer??
Hello all,
There are many property pages in the printer,
like the "General", "Sharing", "Ports", "Advanced",
and "Color Managment".
Can I disable one of them (Ex: disable "Advance" page), or
to disable all the radio buttons of one page(Ex: disable
all the radio buttons of "Advance" page)?
Thanks. Tag: Windows Network Drivers course Tag: 34300
Does anybody offers the above course in Silicon Valley? The couse fee
should be around $500.