ReactOS 0.4.15-dev-7674-gc0b4db1
osdetect.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _NTOS_INSTALLATION
 

Macros

#define VENDOR_REACTOS   L"ReactOS"
 
#define VENDOR_MICROSOFT   L"Microsoft"
 

Typedefs

typedef struct _NTOS_INSTALLATION NTOS_INSTALLATION
 
typedef struct _NTOS_INSTALLATIONPNTOS_INSTALLATION
 

Functions

PGENERIC_LIST CreateNTOSInstallationsList (IN PPARTLIST List)
 
PCWSTR FindSubStrI (PCWSTR str, PCWSTR strSearch)
 

Macro Definition Documentation

◆ VENDOR_MICROSOFT

#define VENDOR_MICROSOFT   L"Microsoft"

Definition at line 13 of file osdetect.h.

◆ VENDOR_REACTOS

#define VENDOR_REACTOS   L"ReactOS"

Definition at line 12 of file osdetect.h.

Typedef Documentation

◆ NTOS_INSTALLATION

◆ PNTOS_INSTALLATION

Function Documentation

◆ CreateNTOSInstallationsList()

PGENERIC_LIST CreateNTOSInstallationsList ( IN PPARTLIST  List)

Definition at line 777 of file osdetect.c.

779{
781 PLIST_ENTRY Entry, Entry2;
782 PDISKENTRY DiskEntry;
783 PPARTENTRY PartEntry;
784
786 if (List == NULL)
787 return NULL;
788
789 /* Loop each available disk ... */
790 Entry = PartList->DiskListHead.Flink;
791 while (Entry != &PartList->DiskListHead)
792 {
793 DiskEntry = CONTAINING_RECORD(Entry, DISKENTRY, ListEntry);
794 Entry = Entry->Flink;
795
796 DPRINT("Disk #%d\n", DiskEntry->DiskNumber);
797
798 /* ... and for each disk, loop each available partition */
799
800 /* First, the primary partitions */
801 Entry2 = DiskEntry->PrimaryPartListHead.Flink;
802 while (Entry2 != &DiskEntry->PrimaryPartListHead)
803 {
804 PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry);
805 Entry2 = Entry2->Flink;
806
807 ASSERT(PartEntry->DiskEntry == DiskEntry);
808
809 DPRINT(" Primary Partition #%d, index %d - Type 0x%02x, IsLogical = %s, IsPartitioned = %s, IsNew = %s, FormatState = %lu -- Should I check it? %s\n",
810 PartEntry->PartitionNumber, PartEntry->PartitionIndex,
811 PartEntry->PartitionType, PartEntry->LogicalPartition ? "TRUE" : "FALSE",
812 PartEntry->IsPartitioned ? "TRUE" : "FALSE",
813 PartEntry->New ? "Yes" : "No",
814 PartEntry->FormatState,
815 ShouldICheckThisPartition(PartEntry) ? "YES!" : "NO!");
816
817 if (ShouldICheckThisPartition(PartEntry))
818 FindNTOSInstallations(List, PartList, PartEntry);
819 }
820
821 /* Then, the logical partitions (present in the extended partition) */
822 Entry2 = DiskEntry->LogicalPartListHead.Flink;
823 while (Entry2 != &DiskEntry->LogicalPartListHead)
824 {
825 PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry);
826 Entry2 = Entry2->Flink;
827
828 ASSERT(PartEntry->DiskEntry == DiskEntry);
829
830 DPRINT(" Logical Partition #%d, index %d - Type 0x%02x, IsLogical = %s, IsPartitioned = %s, IsNew = %s, FormatState = %lu -- Should I check it? %s\n",
831 PartEntry->PartitionNumber, PartEntry->PartitionIndex,
832 PartEntry->PartitionType, PartEntry->LogicalPartition ? "TRUE" : "FALSE",
833 PartEntry->IsPartitioned ? "TRUE" : "FALSE",
834 PartEntry->New ? "Yes" : "No",
835 PartEntry->FormatState,
836 ShouldICheckThisPartition(PartEntry) ? "YES!" : "NO!");
837
838 if (ShouldICheckThisPartition(PartEntry))
839 FindNTOSInstallations(List, PartList, PartEntry);
840 }
841 }
842
843#ifndef NDEBUG
844 /**** Debugging: List all the collected installations ****/
845 DumpNTOSInstalls(List);
846#endif
847
848 return List;
849}
#define NULL
Definition: types.h:112
PGENERIC_LIST CreateGenericList(VOID)
Definition: genlist.c:20
#define ASSERT(a)
Definition: mode.c:44
FORCEINLINE BOOLEAN ShouldICheckThisPartition(IN PPARTENTRY PartEntry)
Definition: osdetect.c:763
static VOID FindNTOSInstallations(IN OUT PGENERIC_LIST List, IN PPARTLIST PartList, IN PPARTENTRY PartEntry)
Definition: osdetect.c:682
#define DPRINT
Definition: sndvol32.h:71
base of all file and directory entries
Definition: entries.h:83
LIST_ENTRY LogicalPartListHead
Definition: partlist.h:129
ULONG DiskNumber
Definition: partlist.h:108
LIST_ENTRY PrimaryPartListHead
Definition: partlist.h:128
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
BOOLEAN IsPartitioned
Definition: partlist.h:66
UCHAR PartitionType
Definition: partlist.h:53
BOOLEAN New
Definition: partlist.h:71
struct _DISKENTRY * DiskEntry
Definition: partlist.h:46
BOOLEAN LogicalPartition
Definition: partlist.h:63
FORMATSTATE FormatState
Definition: partlist.h:61
ULONG PartitionNumber
Definition: partlist.h:55
ULONG PartitionIndex
Definition: partlist.h:56
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550

Referenced by LoadSetupData(), and UpgradeRepairPage().

◆ FindSubStrI()

PCWSTR FindSubStrI ( PCWSTR  str,
PCWSTR  strSearch 
)

Definition at line 217 of file osdetect.c.

218{
219 PCWSTR cp = str;
220 PCWSTR s1, s2;
221
222 if (!*strSearch)
223 return str;
224
225 while (*cp)
226 {
227 s1 = cp;
228 s2 = strSearch;
229
230 while (*s1 && *s2 && (towupper(*s1) == towupper(*s2)))
231 ++s1, ++s2;
232
233 if (!*s2)
234 return cp;
235
236 ++cp;
237 }
238
239 return NULL;
240}
POINT cp
Definition: magnifier.c:59
struct S1 s1
struct S2 s2
const WCHAR * str
#define towupper(c)
Definition: wctype.h:99
const uint16_t * PCWSTR
Definition: typedefs.h:57

Referenced by IsValidNTOSInstallationByHandle().