480{
485 ULONG Length = 0, Level1Length = 0, Level2Length = 0, Level3Length = 0;
486 SIZE_T HardwareIdsLength = 0;
487 SIZE_T VendorIdentifierLength;
491
492 DPRINT(
"GetProcessorInformation()\n");
493
494
496 L"\\Registry\\Machine\\Hardware\\Description\\System\\CentralProcessor\\0",
498 &ProcessorHandle);
500 {
501 DPRINT1(
"Failed to open CentralProcessor registry key: 0x%lx\n",
Status);
502 goto done;
503 }
504
505
512 {
513 DPRINT1(
"Failed to query Identifier value: 0x%lx\n",
Status);
514 goto done;
515 }
516
517
518 Level1Length = Level2Length = Level3Length =
Length;
519
520
523 if (ProcessorIdentifier ==
NULL)
524 {
527 goto done;
528 }
529
530
534 ProcessorIdentifier,
537 {
538 DPRINT1(
"Failed to query Identifier value: 0x%lx\n",
Status);
539 goto done;
540 }
541
542
545 L"ProcessorNameString",
550 {
551
555 {
558 goto done;
559 }
560
561
563 L"ProcessorNameString",
568 {
569 DPRINT1(
"Failed to query ProcessorNameString value: 0x%lx\n",
Status);
570 goto done;
571 }
572 }
573
574
582 {
583 DPRINT1(
"Failed to query VendorIdentifier value: 0x%lx\n",
Status);
584 goto done;
585 }
586
587
590 if (ProcessorVendorIdentifier ==
NULL)
591 {
594 goto done;
595 }
596
597
601 ProcessorVendorIdentifier,
604 {
605 DPRINT1(
"Failed to query VendorIdentifier value: 0x%lx\n",
Status);
606 goto done;
607 }
608
609
610 for (
i = 0;
i <
wcslen(ProcessorIdentifier);
i++)
611 {
612 if (ProcessorIdentifier[
i] ==
L' ')
613 ProcessorIdentifier[
i] =
L'_';
614 }
615
616 Ptr =
wcsstr(ProcessorIdentifier,
L"Stepping");
618 {
620 Level1Length = (
ULONG)(
Ptr - ProcessorIdentifier);
621 }
622
625 {
627 Level2Length = (
ULONG)(
Ptr - ProcessorIdentifier);
628 }
629
632 {
634 Level3Length = (
ULONG)(
Ptr - ProcessorIdentifier);
635 }
636
637 VendorIdentifierLength = (
USHORT)
wcslen(ProcessorVendorIdentifier);
638
639
640 HardwareIdsLength = (5 + VendorIdentifierLength + 3 + Level1Length + 1 +
641 1 + VendorIdentifierLength + 3 + Level1Length + 1 +
642 5 + VendorIdentifierLength + 3 + Level2Length + 1 +
643 1 + VendorIdentifierLength + 3 + Level2Length + 1 +
644 5 + VendorIdentifierLength + 3 + Level3Length + 1 +
645 1 + VendorIdentifierLength + 3 + Level3Length + 1 +
647
648
650 if (HardwareIdsBuffer ==
NULL)
651 {
653 goto done;
654 }
655
657 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier);
659
660 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"*%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier);
662
663 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier);
665
666 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"*%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier);
668
669 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier);
671
672 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"*%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier);
675
676
678
682
683 Length = (5 + VendorIdentifierLength + 3 + Level1Length + 1) *
sizeof(
WCHAR);
686 {
690 }
691
692done:
693 if (ProcessorHandle !=
NULL)
695
696 if (ProcessorIdentifier !=
NULL)
698
699 if (ProcessorVendorIdentifier !=
NULL)
701
703 {
704 if (HardwareIdsBuffer !=
NULL)
706 }
707
709}
static NTSTATUS AcpiRegQueryValue(IN HANDLE KeyHandle, IN LPWSTR ValueName, OUT PULONG Type OPTIONAL, OUT PVOID Data OPTIONAL, IN OUT PULONG DataLength OPTIONAL)
static NTSTATUS AcpiRegOpenKey(IN HANDLE ParentKeyHandle, IN LPCWSTR KeyName, IN ACCESS_MASK DesiredAccess, OUT HANDLE KeyHandle)
UNICODE_STRING ProcessorHardwareIds
LPWSTR ProcessorNameString
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_In_ ULONG _In_ ULONG _In_ ULONG Length