ReactOS  0.4.14-dev-114-gc8cbd56
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 }
LIST_ENTRY PrimaryPartListHead
Definition: partlist.h:124
ULONG PartitionNumber
Definition: partlist.h:48
struct _Entry Entry
Definition: kefuncs.h:640
ULONG DiskNumber
Definition: partlist.h:104
static VOID FindNTOSInstallations(IN OUT PGENERIC_LIST List, IN PPARTLIST PartList, IN PPARTENTRY PartEntry)
Definition: osdetect.c:682
BOOLEAN LogicalPartition
Definition: partlist.h:56
FORMATSTATE FormatState
Definition: partlist.h:54
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
BOOLEAN AutoCreate
Definition: partlist.h:67
PGENERIC_LIST CreateGenericList(VOID)
Definition: genlist.c:20
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
UCHAR PartitionType
Definition: partlist.h:46
struct _DISKENTRY * DiskEntry
Definition: partlist.h:39
LIST_ENTRY List
Definition: psmgr.c:57
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
Definition: typedefs.h:117
BOOLEAN New
Definition: partlist.h:64
FORCEINLINE BOOLEAN ShouldICheckThisPartition(IN PPARTENTRY PartEntry)
Definition: osdetect.c:763
LIST_ENTRY LogicalPartListHead
Definition: partlist.h:125
base of all file and directory entries
Definition: entries.h:82
BOOLEAN IsPartitioned
Definition: partlist.h:59
ULONG PartitionIndex
Definition: partlist.h:49

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 }
const uint16_t * PCWSTR
Definition: typedefs.h:55
struct S2 s2
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
struct S1 s1
POINT cp
Definition: magnifier.c:59
#define towupper(c)
Definition: wctype.h:99

Referenced by IsValidNTOSInstallationByHandle().