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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon Tag: 59072
Originator of an IRP
Hi all,
is there a way to identify the originator of a kernel-mode initiated IRP.
Regards,
Andreas Winter. Tag: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon 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: Printer Icon Tag: 58992
USB Drive / Key's drive letter assignment
I apologize in advance if I am posting this in the wrong newsgroup but I
cannot seem to find the appropriate one for this question. I am trying to
figure out a way I can create a script that will change the default drive
letter a USB drive / key device grabs when it is initially inserted. We have
over 1500 machines and cannot go to each one of them for each USB device and
manually assign a letter. If we leave windows to it's own "devices" it will
assign a letter to the USB drive that is already mapped to a network
resource. Unfortunately in our environment it is not possible to change the
network drive mappings. I have done some research on this and haven't come up
with anything that isn't a very dirty fix to this problem. If anyone has any
insight or solution it would be greatly appreciated.
Thank you
COHDNP... Tag: Printer Icon Tag: 58982
How to remove the INF files after uninstall the passthru IM driver
I have a question about the passthru IM driver installation.
After uninstall the pssthru driver, the two INF files (copied and renamed to
OEM*.inf under c:\windows\inf) are not removed.
My question is: What's the proper way to delete these two files when
uninstall? I could do a search in the c:\windows\inf directory, find the
files and delete them manually, but it doesn't seem to be the proper way.
Thanks for your help,
Jinhai Tag: Printer Icon Tag: 58979
NDIS VMINI MiniportSend() WindowsCE .NET
I produced the NDIS vmini example of the platform builder using emVC++ with
some modifications and installed the driver on the target PC.
The VMiniMSend() function will be called from the NDIS protocol driver to
send some data.
Question - How can I access the IP parameters (e.g. sent port) and the
actual data from the input parameters
NDIS_HANDLE MiniportAdapterContext
PNDIS_PACKET packet
provided by the NDIS protocol driver? Tag: Printer Icon Tag: 58977
printing ip addresses
Hi all, i am trying to print out IP addresses from IP header structures.
I know that they in format w.x.y.z were each represents one byte.
But Ip_src and Ip_dst are Ulong and a subscript requires a pointer.
Any help pls.
abiola. Tag: Printer Icon Tag: 58975
OT: Books for independent consultant?
When people asking for books on driver programming, the answer would
be Oney's WDM book.
Can anyone here suggest some good books for freelance programmer? I
found some of them on the web but don't know which one is really good
for dummy.
Thanks,
Calvin Tag: Printer Icon Tag: 58972
Linking HidD_GetPreparsedData
Hello,
I am writing a user-mode application that try to read the HID
descriptors from HID devices.
I have 2 questions :
- Is it possible to read the data in a "raw mode" (i.e. I give a
buffer and it is filled with the full descriptors)
- I try to get the info with the HidD_* functions
(HidD_GetPreparsedData etc...) so I added hid.lib to the linked
libraries. But the compiler ignores it and displays :
<code>
error LNK2001: unresolved external symbol "unsigned char __stdcall
HidD_GetPreparsedData(void *,struct _HIDP_PREPARSED_DATA * *)"
</code>
Thanks !
Eric. Tag: Printer Icon Tag: 58970
How to create a softice like startup menu from Boot Driver?
Hello
How can i get user input and display strings from a Boot Driver like
softice does while windows starts ?
All the methods i saw in this list work for System drivers - drivers
that were loaded after the windows keyboard driver and 8042 port driver
were loaded.
When i tried to use ZwCreateFile to access Device\KeyboardClass0, it
again worked only when i loaded the driver as system and not as boot.
how do the guys from numega does that ?
thanks for any help. Tag: Printer Icon Tag: 58961
Status monitor query
Hi,
I am writing a printer driver and status monitor on Windows-XP. I tried to
get the printer status through IBidiSpl and IBidiRequest Bidi interfaces.
The BindDevice function is failing and the error message says "Printer name
is invalid", but when I call OpenPrinter API with the same printer name, it
returns the printer handle successfully.
If anybody have any idea why BindDevice API call fails, please let me know.
Thanks,
Nitin Tag: Printer Icon Tag: 58958
Making a device read only
We have discovered that under Win2K (and WinXP+SP1) NTFS becomes
unstable if the media the volume is on is silently discarding write
requests. After a short while both Win2K and WinXP will blue screen.
Unfortunately we need to find a solution to this. Redesigning the
hardware side would be expensive and time consuming so we are also
looking into a software solution.
Presumably this would require us to write a device driver that could
fit into the storage driver stack at some point. The simplest way would
probably be for us to monitor SCSI commands and modify the result of a
Mode Sense so that it indicated that the media was write protected.
None of our development team have looked at working with the DDK (we
are all application developers) and from my investigations it looks
like such a project would be a very big undertaking - probably as big
as the hardware solution. Not a lot of code, perhaps, but a steep
learning curve.
So I guess my question is:Does this sound like a major software project
or is there some other solution we can go for? At present just being
able to turn off plug-and-play volume mounting would suffice. We only
need SCSI pass through access to the write protected volume. Tag: Printer Icon Tag: 58953
IRQ, device driver development.
I'm starting developing a device driver, and have some questions:
1. How can I get address from which IRQ was invoked??
2. If I know such address, how can I get binary file (process id or
something which helps me to identify binary file)which was mapped for
this particular address??
Best
Darek Tag: Printer Icon Tag: 58951
Disabling windows file protection
Hi,
I was trying to replace a system file( classpnp.sys) in
windows/system32/drivers directory. But I am not able to , It gets replaced
with the system file every time I replace it. I tried disabling windows
file protection by setting SFCDisable in the registry to ffffff9d ( Referred
the link http://www.winguides.com/registry/display.php/790/ ).
But even then I am not able to replace the file. The system has the Win2K3 OS.
What can be the problem?
Thanks in Advance.
Sareena. Tag: Printer Icon Tag: 58950
How to handle DIF_NEWDEVCEWIZARD_PRESELECT?
Hi to all,
I took sample of toaster from DDK as a prototype Class Installer. My
installer supports only DIF_ADDPROPERTYPAGE_ADVANCED request. It returns
ERROR_DI_DO_DEFAULT for all rest DIF codes.
Unfortunetly, it's not enough for correct work Hardware Wizard and Device
Manager. If I delete Installer32 registry entry Hardware Wizard uses
manually installation scenario. If I add Installer32 registry entry my
installer receives DIF_NEWDEVCEWIZARD_PRESELECT request. It's happened
"After the user has selected the class for the device but before Setup
displays the "Select a Device Driver" page." After installer returns
ERROR_DI_DO_DEFAULT, hdwdiz.cpl crashes.
What is the reason of this behavior Hardware Wizard?
Thank in advance
Andrei Souvalski Tag: Printer Icon Tag: 58946
How does a laptop's Fn key work?
I'm trying to write a program that captures when a user presses a laptop's Fn
key and another key simultaneously, ie Fn+F6. However, I've been unable to
figure out how to do this. I've tried using a keyboard hook then checking
for keyboard events and GetKeyState() to figure out if the key combination
has been pressed. To no avail. When the Fn key and another key are pressed
together, no keyboard event is triggered.
Could someone be so kind to explain how the Fn key works and how it works
when it is pressed simultaneously with another key? Can anyone help me figure
out how to do this?
Thanks in advance. Tag: Printer Icon Tag: 58937
Passthru Installation Popups
On installing Passthru i get the driver sign popups.
On some machine i see "X" popups the 1st time and on
the same machine i see "Y" popups the next time. The
number of popups vary from machine to machine also.
On what does the number of popups depend ?
...Mani
PS:
I know that to avoid popups one must get the driver
signed :) Tag: Printer Icon Tag: 58933
IoAttachDeviceToDeviceStack related
Can anyone clarify the foll paragraph from
DDK under IoAttachDeviceToDeviceStack:
A driver writer must take care to call this
routine before any drivers that must layer
on top of their driver.
IoAttachDeviceToDeviceStack attaches
SourceDevice to the highest device object
currently layered in the chain and has no
way to determine whether drivers are being
layered in the correct order.
...Mani Tag: Printer Icon Tag: 58932
NDIS IM driver DriverEntry called repeatedly with Window 2003
We have developed an NDIS intermedoate driver and also notify object to
support our driver.
In build prior to 1289
==============
When the first virtual adapter is created the Driver Entry is called.
Thereafter the Driver Entry is not called even if more vritual adapter are
created.
Build 1289 and 1421
=============
The driver entry is being called when each virtual component is being created.
With reference to notify object after 'ApplyRegistryChanges' and before
'ApplyPnpChanges' the IM driver gets triggered.
For some reason with build 1289 and 1421 the halt routine is being called
which triggers the driver being unloaded even though there are some VLAN
already on the adapter. Thereafter DriverEntry is being called once again.
This behaviour is not seen in earlier builds of Windows 2003
MUX behaviour
==========
I observed the same behaviour even with the mux sample in DDK.
Please advice as what is the change due to which the halt is being called in
1289 and above causing the driver Entry being called with each VLAN creation.
- Sriram. Tag: Printer Icon Tag: 58924
TDI driver event queueing
Hello,
I can save IRP requests, and complete/cancel them later successfully.
But I want to queue events, set by TDI_SET_EVENT_HANDLER as well.
Could anybody clarify how this can be done?
Thanks!
Best regards,
Serge. Tag: Printer Icon Tag: 58919
printer driver and nonsquare pixels
Hello,
I have a monolithic usermode printer driver under development and I have two
questions:
1.) Is there any way to inform GDI that the device has nonsquare pixels?
2.) Will this make any difference for calls to EngTextOut()?
Thanks.
--
Matt Kane
mkane@zebra.orange.com minus fruit Tag: Printer Icon Tag: 58913
Unidrv and CommandCallback inconsistencies
Often times, when implementing a callback or other custom functionality in
UniDrv, UniDrv's overall behavior changes rather than simply calling my
callback or running my function.
The help implies that the CallBack is instead of sending the "*Cmd" command.
Is there any way to stop this?? It's hard to code this way :|
Example 1: CommandCallback for CmdYMoveAbsolute
Result: UniDrv calls my callback to send Y coordinates for EVERY scanline
(even "*b0W") as if "*CursorYAfterSendBlockData" was set to NO_MOVE and not
AUTO_INCREMENT.
Replace the CallbackID with a "*Cmd: " string and it works as documented.
Example 2: Implement IPrintOemUni::FilterGraphics
Result: UniDrv no longer compresses the scan line data blocks as if there
weren't any compression entries defined (including OEMCompression).
Wouldn't I simply not include the compression entries if I didn't want the
data compressed or wanted to do it myself?
Can someone PLEASE help this make sense?
CodeSkunk
Sr. Propeller Head Tag: Printer Icon Tag: 58912
Unidrv and CommandCallback inconsistencies
Often times, when implementing a callback or other custom functionality in
UniDrv, UniDrv's overall behavior changes rather than simply calling my
callback or running my function.
The help implies that the CallBack is instead of sending the "*Cmd" command.
Is there any way to stop this?? It's hard to code this way :|
Example 1: CommandCallback for CmdYMoveAbsolute
Result: UniDrv calls my callback to send Y coordinates for EVERY scanline
(even "*b0W") as if "*CursorYAfterSendBlockData" was set to NO_MOVE and not
AUTO_INCREMENT.
Replace the CallbackID with a "*Cmd: " string and it works as documented.
Example 2: Implement IPrintOemUni::FilterGraphics
Result: UniDrv no longer compresses the scan line data blocks as if there
weren't any compression entries defined (including OEMCompression).
Wouldn't I simply not include the compression entries if I didn't want the
data compressed or wanted to do it myself?
Can someone PLEASE help this make sense?
CodeSkunk
Sr. Propeller Head Tag: Printer Icon Tag: 58910
Unattended null driver installation
I have an interesting device driver installation problem that I
can't seem to make any headway on. Basically I am trying to make it so
a normal user (non-administrator) can install a null driver.
My company makes custom PCI hardware. We are moving to XP and have a
legacy non-plug and play driver that runs our cards. This driver works
fine. However, XP still thinks that each of our cards needs a driver
installed and pops up the "Found New Hardware" wizard when the system
comes up.
I have come across the solution of a null driver. Apparently this
is a .inf file that is just a placeholder for the legacy devices.
Putting this inf file into the system32\inf directory allows the system
to install the null devices correclty. I have created an .inf file like
the following:
---------------------------------------
[Version]
Signature="$Windows NT$"
Class=Unknown
ClassGUID={4d36e97e-e325-11ce-bfc1-08002be10318}
Provider=%Company%
DriverVer=02/08/2005,3.72
; Install the device class
[ClassInstall32]
AddReg=ClassAddReg
[ClassAddReg]
HKR,,,,%ClassName%
HKR,,Icon,,"-11"
HKR,,SilentInstall,,1
HKR,,NoInstallClass,,1
; List of devices
[Manufacturer]
%Company%=Company
[Company]
%Device1%=NullInstallSection, PCI\ . . .
%Device2%=NullInstallSection, PCI\ . . .
[NullInstallSection]
; Nothing needed here
[NullInstallSection.Services]
AddService = ,2 ;no service name
[Strings]
ClassName="Devices"
Device1="Device1"
Device2="Device2"
-------------------------------------------
Here's where I run into my problem. Since the driver isn't WHQL
certified, XP won't install the null devices without displaying the
"Found New Hardware" wizard. This is fine as an administrator, but we
have machines in the field running as a normal user. As a normal user
XP pops up an error that says, "You must be a member of the
Administrators group on this computer to install this hardware." In my
research I've found that a normal user can install drivers if they are
signed correctly. However, I'm don't think that WHQL will sign a null
driver. So, I seem to be stuck.
Is there any way to get around this problem?
Is there a way to allow normal users the rights to install unsigned drivers?
Can I somehow get a null driver signed?
I would be very appreciative of any feedback.
Andrew Webber Tag: Printer Icon Tag: 58909
Printer driver device fonts bold/italic/underline
Hi,
I have been updating a previously written monolithic (non-minidriver)
printer driver.
The printer has its own fonts that it can render as bold, italic, and
underline. Do I have to implement an IFIMETRIC structure (via DrvQueryFont)
for every possible combination of device font style? For example, lets say
the printer has a 16 CPI font and that font (via printer commands) can be
represented in bold, underlined, italics and a combination of all 3. So,
there can be:
16 CPI Normal,
16 CPI Bold,
16 CPI Italic,
16 CPI Bold AND Italic,
etc.
Do have to set up this many IFIMETRIC structures that only have the
fsSelection member as a difference? Once you add up other printer fonts (14
CPI, 12 CPI, etc) there ends up being an astronomical amount of fonts.
There has to be a way to just have one a IFIMETRIC structure for the 16 CPI
font and have DrvTextOut receive some indication that the font needs to be
bold, italic or underlined somewhere. Or am I dreaming?
Thanks! Tag: Printer Icon Tag: 58905
I need suggestion on how to implement a barcode reader for win2k
I have an old barcode reader that can connect to a serial port on my windows
2k computer. I would like to scan any barcode and it would appear on the
console where ever the application is; sort of like a keyboard. How do I go
about doing this. I got the MSDN DDK subscription but as read thru this forum
I still am undecided of what to do for what I want. Can someone suggest
something please? Thank you. Tag: Printer Icon Tag: 58904
Is the Driver Verifier available for Embedded XP?
I would like to use the Driver Verifier to test a device driver we have
developed for Embedded XP. Is this possible, or will I have to move the
driver to XP Professional to run the Driver Verifier? Tag: Printer Icon Tag: 58898
Unhandled Exception in ExpWorkerThread
I have a very intermittent (4 times in one month) BSOD that tracks back
to ExpWorkerThread calling ObpProcessRemoveObjectQueue and hitting an
exception at address 00000098 [Eax+98].
How can I find out what ExpWorkerThread thought it should be doing ? Tag: Printer Icon Tag: 58889
Help, i wanna look at routing protocol development
I have doubt on what to use to develop a routing protocol for wireless
LAN.
I wanna loop for routing protocol development, write an algorithm for
wireless LAN card let say AODV(an ad hoc routing protocol RFC 3561
so that it behaves like what i specified.
i wanna write the driver(is tat consider as driver?) for win XP, what
should i look at? Do i need to look at DDR? have any reference,
tutorial or guildeline available? Tag: Printer Icon Tag: 58887
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.