Re: no static functions in WDK examples;
- From: pradeep bisht <pradeep_bisht@xxxxxxxxx>
- Date: Sat, 14 Jun 2008 21:32:24 -0700 (PDT)
Thanks Don for replying even though I just realized that I posted to
the wrong list instead of posting to the driver's list :(.
So it is OK to use static.
On Jun 14, 1:29 pm, "Don Burn" <b...@xxxxxxxxxxxxxxxxxxxx> wrote:
Comments inline:
"pradeep bisht" <pradeep_bi...@xxxxxxxxx> wrote in message
news:b2b4c37c-b61c-4ef7-8a2f-00c014eff55e@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I don;t see any "static" functions in WDK examples. Even though there
are functions which are used inside only one file. Generally if a 'c'
function local to a file is declared static. Is there a technical
reason for not using static?
[I'm new to driver development so may this question is stupid.]
There is no technical reason not to. Personally, I hve always found this
frustratng since there is no reason not to make things static.
Are there any general guidelines for writing drivers (disk filter
drivers, to be more specific). Thanks.
Also how can I compare two MULTI_REG_SZ buffers returned by
IoGetDeviceProperty when called for DevicePropertyHardwareID?
Currently I'm just comparing each character (in a for loop) upto
ResultLength returned by IoGetDeviceProperty.
for (i = 0; i < propertyLength; i++) {
if (myHardWareID[i] != propertyBuffer[i]) {
break;
}
}
if (i != propertyLength) {
DebugPrint ("Not matched");
}
For the compare use:
if ( propertyLength != RtlCompareMemory( myHardWareID, propertyBuffer,
propertyLength) ) {
DebugPrint ("Not matched");
}
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website:http://www.windrvr.com
Blog:http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
.
- Follow-Ups:
- Re: no static functions in WDK examples;
- From: David Craig
- Re: no static functions in WDK examples;
- References:
- no static functions in WDK examples;
- From: pradeep bisht
- Re: no static functions in WDK examples;
- From: Don Burn
- no static functions in WDK examples;
- Prev by Date: Re: no static functions in WDK examples;
- Next by Date: Re: no static functions in WDK examples;
- Previous by thread: Re: no static functions in WDK examples;
- Next by thread: Re: no static functions in WDK examples;
- Index(es):
Relevant Pages
|