--*/
#include "classp.h"
-#include "debug.h"
-
-
#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, ClassGetDeviceParameter)
#pragma alloc_text(PAGE, ClassSetDeviceParameter)
#endif
-
-
// custom string match -- careful!
-BOOLEAN ClasspMyStringMatches(IN PCHAR StringToMatch OPTIONAL, IN PCHAR TargetString)
+BOOLEAN NTAPI ClasspMyStringMatches(IN PCSTR StringToMatch OPTIONAL, IN PCSTR TargetString)
{
ULONG length; // strlen returns an int, not size_t (!)
PAGED_CODE();
return (strncmp(StringToMatch, TargetString, length) == 0);
}
-
-VOID ClassGetDeviceParameter(
+VOID NTAPI ClassGetDeviceParameter(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
IN PWSTR SubkeyName OPTIONAL,
IN PWSTR ParameterName,
} // end ClassGetDeviceParameter()
-
-NTSTATUS ClassSetDeviceParameter(
+NTSTATUS NTAPI ClassSetDeviceParameter(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
IN PWSTR SubkeyName OPTIONAL,
IN PWSTR ParameterName,
} // end ClassSetDeviceParameter()
-
/*
* ClassScanForSpecial
*
* hardware based upon id strings. it does not check the registry.
*/
-VOID ClassScanForSpecial(
+VOID NTAPI ClassScanForSpecial(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension,
IN CLASSPNP_SCAN_FOR_SPECIAL_INFO DeviceList[],
IN PCLASS_SCAN_FOR_SPECIAL_HANDLER Function)
{
PSTORAGE_DEVICE_DESCRIPTOR deviceDescriptor;
- PUCHAR vendorId;
- PUCHAR productId;
- PUCHAR productRevision;
- UCHAR nullString[] = "";
- ULONG j;
+ PCSTR vendorId;
+ PCSTR productId;
+ PCSTR productRevision;
+ CHAR nullString[] = "";
+ //ULONG j;
PAGED_CODE();
ASSERT(DeviceList);
if (deviceDescriptor->VendorIdOffset != 0 &&
deviceDescriptor->VendorIdOffset != -1) {
- vendorId = ((PUCHAR)deviceDescriptor);
+ vendorId = ((PCSTR)deviceDescriptor);
vendorId += deviceDescriptor->VendorIdOffset;
} else {
vendorId = nullString;
}
if (deviceDescriptor->ProductIdOffset != 0 &&
deviceDescriptor->ProductIdOffset != -1) {
- productId = ((PUCHAR)deviceDescriptor);
+ productId = ((PCSTR)deviceDescriptor);
productId += deviceDescriptor->ProductIdOffset;
} else {
productId = nullString;
}
if (deviceDescriptor->VendorIdOffset != 0 &&
deviceDescriptor->VendorIdOffset != -1) {
- productRevision = ((PUCHAR)deviceDescriptor);
+ productRevision = ((PCSTR)deviceDescriptor);
productRevision += deviceDescriptor->ProductRevisionOffset;
} else {
productRevision = nullString;
} // end ClasspScanForSpecialByInquiry()
-
//
// In order to provide better performance without the need to reboot,
// we need to implement a self-adjusting method to set and clear the
//
VOID
+NTAPI
ClasspPerfIncrementErrorCount(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension
)
KeAcquireSpinLock(&fdoData->SpinLock, &oldIrql);
fdoData->Perf.SuccessfulIO = 0; // implicit interlock
- errors = InterlockedIncrement(&FdoExtension->ErrorCount);
+ errors = InterlockedIncrement((PLONG)&FdoExtension->ErrorCount);
if (errors >= CLASS_ERROR_LEVEL_1) {
}
VOID
+NTAPI
ClasspPerfIncrementSuccessfulIo(
IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension
)
return;
}
- succeeded = InterlockedIncrement(&fdoData->Perf.SuccessfulIO);
+ succeeded = InterlockedIncrement((PLONG)&fdoData->Perf.SuccessfulIO);
if (succeeded < fdoData->Perf.ReEnableThreshhold) {
return;
}
fdoData->Perf.SuccessfulIO = 0; // implicit interlock
ASSERT(FdoExtension->ErrorCount > 0);
- errors = InterlockedDecrement(&FdoExtension->ErrorCount);
+ errors = InterlockedDecrement((PLONG)&FdoExtension->ErrorCount);
//
// note: do in reverse order of the sets "just in case"
return;
}
-
-PMDL BuildDeviceInputMdl(PVOID Buffer, ULONG BufferLen)
+PMDL NTAPI BuildDeviceInputMdl(PVOID Buffer, ULONG BufferLen)
{
PMDL mdl;
return mdl;
}
-
-VOID FreeDeviceInputMdl(PMDL Mdl)
+VOID NTAPI FreeDeviceInputMdl(PMDL Mdl)
{
MmUnlockPages(Mdl);
IoFreeMdl(Mdl);
}
-
#if 0
VOID
ClasspPerfResetCounters(
return;
}
#endif
-
-