ReactOS 0.4.15-dev-6073-g59e7458
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, AutoCreate = %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->AutoCreate ? "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, AutoCreate = %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->AutoCreate ? "Yes" : "No",
837 PartEntry->FormatState,
838 ShouldICheckThisPartition(PartEntry) ? "YES!" : "NO!");
839
840 if (ShouldICheckThisPartition(PartEntry))
841 FindNTOSInstallations(List, PartList, PartEntry);
842 }
843 }
844
845#ifndef NDEBUG
846 /**** Debugging: List all the collected installations ****/
847 DumpNTOSInstalls(List);
848#endif
849
850 return List;
851}
#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:132
ULONG DiskNumber
Definition: partlist.h:111
LIST_ENTRY PrimaryPartListHead
Definition: partlist.h:131
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 AutoCreate
Definition: partlist.h:74
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().