ReactOS 0.4.15-dev-8393-g61b7fb9
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 778 of file osdetect.c.

780{
782 PLIST_ENTRY Entry, Entry2;
783 PDISKENTRY DiskEntry;
784 PPARTENTRY PartEntry;
785
787 if (List == NULL)
788 return NULL;
789
790 /* Loop each available disk ... */
791 Entry = PartList->DiskListHead.Flink;
792 while (Entry != &PartList->DiskListHead)
793 {
794 DiskEntry = CONTAINING_RECORD(Entry, DISKENTRY, ListEntry);
795 Entry = Entry->Flink;
796
797 DPRINT("Disk #%d\n", DiskEntry->DiskNumber);
798
799 /* ... and for each disk, loop each available partition */
800
801 /* First, the primary partitions */
802 Entry2 = DiskEntry->PrimaryPartListHead.Flink;
803 while (Entry2 != &DiskEntry->PrimaryPartListHead)
804 {
805 PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry);
806 Entry2 = Entry2->Flink;
807
808 ASSERT(PartEntry->DiskEntry == DiskEntry);
809
810 DPRINT(" Primary Partition #%d, index %d - Type 0x%02x, IsLogical = %s, IsPartitioned = %s, IsNew = %s, FormatState = %lu -- Should I check it? %s\n",
811 PartEntry->PartitionNumber, PartEntry->PartitionIndex,
812 PartEntry->PartitionType, PartEntry->LogicalPartition ? "TRUE" : "FALSE",
813 PartEntry->IsPartitioned ? "TRUE" : "FALSE",
814 PartEntry->New ? "Yes" : "No",
815 PartEntry->FormatState,
816 ShouldICheckThisPartition(PartEntry) ? "YES!" : "NO!");
817
818 if (ShouldICheckThisPartition(PartEntry))
819 FindNTOSInstallations(List, PartList, PartEntry);
820 }
821
822 /* Then, the logical partitions (present in the extended partition) */
823 Entry2 = DiskEntry->LogicalPartListHead.Flink;
824 while (Entry2 != &DiskEntry->LogicalPartListHead)
825 {
826 PartEntry = CONTAINING_RECORD(Entry2, PARTENTRY, ListEntry);
827 Entry2 = Entry2->Flink;
828
829 ASSERT(PartEntry->DiskEntry == DiskEntry);
830
831 DPRINT(" Logical Partition #%d, index %d - Type 0x%02x, IsLogical = %s, IsPartitioned = %s, IsNew = %s, FormatState = %lu -- Should I check it? %s\n",
832 PartEntry->PartitionNumber, PartEntry->PartitionIndex,
833 PartEntry->PartitionType, PartEntry->LogicalPartition ? "TRUE" : "FALSE",
834 PartEntry->IsPartitioned ? "TRUE" : "FALSE",
835 PartEntry->New ? "Yes" : "No",
836 PartEntry->FormatState,
837 ShouldICheckThisPartition(PartEntry) ? "YES!" : "NO!");
838
839 if (ShouldICheckThisPartition(PartEntry))
840 FindNTOSInstallations(List, PartList, PartEntry);
841 }
842 }
843
844#ifndef NDEBUG
845 /**** Debugging: List all the collected installations ****/
846 DumpNTOSInstalls(List);
847#endif
848
849 return List;
850}
#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:764
static VOID FindNTOSInstallations(IN OUT PGENERIC_LIST List, IN PPARTLIST PartList, IN PPARTENTRY PartEntry)
Definition: osdetect.c:682
#define DPRINT
Definition: sndvol32.h:73
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().