454{
459 ULONG Length = 0, Level1Length = 0, Level2Length = 0, Level3Length = 0;
460 SIZE_T HardwareIdsLength = 0;
461 SIZE_T VendorIdentifierLength;
465
466 DPRINT(
"GetProcessorInformation()\n");
467
468
470 L"\\Registry\\Machine\\Hardware\\Description\\System\\CentralProcessor\\0",
472 &ProcessorHandle);
474 {
475 DPRINT1(
"Failed to open CentralProcessor registry key: 0x%lx\n",
Status);
476 goto done;
477 }
478
479
486 {
487 DPRINT1(
"Failed to query Identifier value: 0x%lx\n",
Status);
488 goto done;
489 }
490
491
492 Level1Length = Level2Length = Level3Length =
Length;
493
494
497 if (ProcessorIdentifier ==
NULL)
498 {
501 goto done;
502 }
503
504
508 ProcessorIdentifier,
511 {
512 DPRINT1(
"Failed to query Identifier value: 0x%lx\n",
Status);
513 goto done;
514 }
515
516
519 L"ProcessorNameString",
524 {
525
529 {
532 goto done;
533 }
534
535
537 L"ProcessorNameString",
542 {
543 DPRINT1(
"Failed to query ProcessorNameString value: 0x%lx\n",
Status);
544 goto done;
545 }
546 }
547
548
556 {
557 DPRINT1(
"Failed to query VendorIdentifier value: 0x%lx\n",
Status);
558 goto done;
559 }
560
561
564 if (ProcessorVendorIdentifier ==
NULL)
565 {
568 goto done;
569 }
570
571
575 ProcessorVendorIdentifier,
578 {
579 DPRINT1(
"Failed to query VendorIdentifier value: 0x%lx\n",
Status);
580 goto done;
581 }
582
583
584 for (
i = 0;
i <
wcslen(ProcessorIdentifier);
i++)
585 {
586 if (ProcessorIdentifier[
i] ==
L' ')
587 ProcessorIdentifier[
i] =
L'_';
588 }
589
590 Ptr =
wcsstr(ProcessorIdentifier,
L"Stepping");
592 {
594 Level1Length = (
ULONG)(
Ptr - ProcessorIdentifier);
595 }
596
599 {
601 Level2Length = (
ULONG)(
Ptr - ProcessorIdentifier);
602 }
603
606 {
608 Level3Length = (
ULONG)(
Ptr - ProcessorIdentifier);
609 }
610
611 VendorIdentifierLength = (
USHORT)
wcslen(ProcessorVendorIdentifier);
612
613
614 HardwareIdsLength = (5 + VendorIdentifierLength + 3 + Level1Length + 1 +
615 1 + VendorIdentifierLength + 3 + Level1Length + 1 +
616 5 + VendorIdentifierLength + 3 + Level2Length + 1 +
617 1 + VendorIdentifierLength + 3 + Level2Length + 1 +
618 5 + VendorIdentifierLength + 3 + Level3Length + 1 +
619 1 + VendorIdentifierLength + 3 + Level3Length + 1 +
621
622
624 if (HardwareIdsBuffer ==
NULL)
625 {
627 goto done;
628 }
629
631 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier);
633
634 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"*%s_-_%.*s", ProcessorVendorIdentifier, Level1Length, ProcessorIdentifier);
636
637 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier);
639
640 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"*%s_-_%.*s", ProcessorVendorIdentifier, Level2Length, ProcessorIdentifier);
642
643 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"ACPI\\%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier);
645
646 Length +=
swprintf(&HardwareIdsBuffer[
Length],
L"*%s_-_%.*s", ProcessorVendorIdentifier, Level3Length, ProcessorIdentifier);
649
650
652
656
657 Length = (5 + VendorIdentifierLength + 3 + Level1Length + 1) *
sizeof(
WCHAR);
660 {
664 }
665
666done:
667 if (ProcessorHandle !=
NULL)
669
670 if (ProcessorIdentifier !=
NULL)
672
673 if (ProcessorVendorIdentifier !=
NULL)
675
677 {
678 if (HardwareIdsBuffer !=
NULL)
680 }
681
683}
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