460{
465 ULONG Length = 0, Level1Length = 0, Level2Length = 0, Level3Length = 0;
466 SIZE_T HardwareIdsLength = 0;
467 SIZE_T VendorIdentifierLength;
471
472 DPRINT(
"GetProcessorInformation()\n");
473
474
476 L"\\Registry\\Machine\\Hardware\\Description\\System\\CentralProcessor\\0",
478 &ProcessorHandle);
480 {
481 DPRINT1(
"Failed to open CentralProcessor registry key: 0x%lx\n",
Status);
482 goto done;
483 }
484
485
492 {
493 DPRINT1(
"Failed to query Identifier value: 0x%lx\n",
Status);
494 goto done;
495 }
496
497
498 Level1Length = Level2Length = Level3Length =
Length;
499
500
503 if (ProcessorIdentifier ==
NULL)
504 {
507 goto done;
508 }
509
510
514 ProcessorIdentifier,
517 {
518 DPRINT1(
"Failed to query Identifier value: 0x%lx\n",
Status);
519 goto done;
520 }
521
522
525 L"ProcessorNameString",
530 {
531
535 {
538 goto done;
539 }
540
541
543 L"ProcessorNameString",
548 {
549 DPRINT1(
"Failed to query ProcessorNameString value: 0x%lx\n",
Status);
550 goto done;
551 }
552 }
553
554
562 {
563 DPRINT1(
"Failed to query VendorIdentifier value: 0x%lx\n",
Status);
564 goto done;
565 }
566
567
570 if (ProcessorVendorIdentifier ==
NULL)
571 {
574 goto done;
575 }
576
577
581 ProcessorVendorIdentifier,
584 {
585 DPRINT1(
"Failed to query VendorIdentifier value: 0x%lx\n",
Status);
586 goto done;
587 }
588
589
590 for (
i = 0;
i <
wcslen(ProcessorIdentifier);
i++)
591 {
592 if (ProcessorIdentifier[
i] ==
L' ')
593 ProcessorIdentifier[
i] =
L'_';
594 }
595
596 Ptr =
wcsstr(ProcessorIdentifier,
L"Stepping");
598 {
600 Level1Length = (
ULONG)(
Ptr - ProcessorIdentifier);
601 }
602
605 {
607 Level2Length = (
ULONG)(
Ptr - ProcessorIdentifier);
608 }
609
612 {
614 Level3Length = (
ULONG)(
Ptr - ProcessorIdentifier);
615 }
616
617 VendorIdentifierLength = (
USHORT)
wcslen(ProcessorVendorIdentifier);
618
619
620 HardwareIdsLength = (5 + VendorIdentifierLength + 3 + Level1Length + 1 +
621 1 + VendorIdentifierLength + 3 + Level1Length + 1 +
622 5 + VendorIdentifierLength + 3 + Level2Length + 1 +
623 1 + VendorIdentifierLength + 3 + Level2Length + 1 +
624 5 + VendorIdentifierLength + 3 + Level3Length + 1 +
625 1 + VendorIdentifierLength + 3 + Level3Length + 1 +
627
628
630 if (HardwareIdsBuffer ==
NULL)
631 {
633 goto done;
634 }
635
637 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier);
639
640 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"*%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier);
642
643 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier);
645
646 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"*%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier);
648
649 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier);
651
652 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"*%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier);
655
656
658
662
663 Length = (5 + VendorIdentifierLength + 3 + Level1Length + 1) *
sizeof(
WCHAR);
666 {
670 }
671
672done:
673 if (ProcessorHandle !=
NULL)
675
676 if (ProcessorIdentifier !=
NULL)
678
679 if (ProcessorVendorIdentifier !=
NULL)
681
683 {
684 if (HardwareIdsBuffer !=
NULL)
686 }
687
689}
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