niceboy
驱动牛犊
驱动牛犊
  • 注册日期2003-04-23
  • 最后登录2010-03-12
  • 粉丝0
  • 关注0
  • 积分107分
  • 威望103点
  • 贡献值0点
  • 好评度6点
  • 原创分0分
  • 专家分0分
阅读:926回复:0

新手上路

楼主#
更多 发布于:2004-05-16 14:30
我是刚刚开始看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;
游客

返回顶部