阅读:926回复:0
新手上路
我是刚刚开始看WIN驱动开发的
我在看DDK中的串口例子代码时遇到了一点问题 那位大虾能告诉我下面代码的注释中\"Jensen\"是什么意思啊? if (!(jensenBuffer = ExAllocatePool( PagedPool, 512 ))) { // // We couldn\'t allocate 512 bytes of paged pool. If that\'s // so, then it\'s likely that the least of this machine\'s problems // is that it\'s a Jensen. // jensenDetected = FALSE; } else { // // Check to see if this is a Jensen alpha. If it is, then // we\'ll have to change the way we enable and disable interrupts // jensenData.Length = 0; jensenData.MaximumLength = 512; jensenData.Buffer = (PWCHAR)&jensenBuffer[0]; RtlInitUnicodeString( &jensenValue, L\"Jensen\" ); jensenTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT | RTL_QUERY_REGISTRY_REQUIRED; jensenTable[0].Name = L\"Identifier\"; jensenTable[0].EntryContext = &jensenData; if (!NT_SUCCESS(RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE | RTL_REGISTRY_OPTIONAL, L\"\\\\REGISTRY\\\\MACHINE\\\\HARDWARE\" L\"\\\\DESCRIPTION\\\\SYSTEM\", &jensenTable[0], NULL, NULL))) { // // How odd, no identifer string! We\'ll it\'s probably not a jensen. // jensenDetected = FALSE; } else { // // Skip past the DEC-XX Portion of the name string. // Be carful and make sure we have at least that much data. // if (jensenData.Length <= (sizeof(WCHAR)*6)) { jensenDetected = FALSE; } else { jensenData.Length -= (sizeof(WCHAR)*6); jensenData.MaximumLength -= (sizeof(WCHAR)*6); jensenData.Buffer = (PWCHAR)&jensenBuffer[sizeof(WCHAR)*6]; jensenDetected = RtlEqualUnicodeString( &jensenData, &jensenValue, FALSE ); } } ExFreePool(jensenBuffer); } if (jensenDetected) { SerialDump( SERDIAG1, (\"SERIAL: Jensen Detected\\n\") ); } driverDefaults.JensenDetected = jensenDetected; |
|