ReactOS 0.4.16-dev-136-g52192f1
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 PartList)
 Create a list of available NT OS installations on the computer, by searching for recognized ones on each recognized storage volume.
 
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  PartList)

Create a list of available NT OS installations on the computer, by searching for recognized ones on each recognized storage volume.

Definition at line 763 of file osdetect.c.

765{
770
772 if (!List)
773 return NULL;
774
775 /* Loop each available volume */
776 for (Entry = PartList->VolumesList.Flink;
777 Entry != &PartList->VolumesList;
778 Entry = Entry->Flink)
779 {
780 Volume = CONTAINING_RECORD(Entry, VOLENTRY, ListEntry);
781 /* Valid OS installations can be found only on basic volumes */
782 if (!Volume->PartEntry) // TODO: In the future: (!Volume->IsSimpleVolume)
783 continue;
784
785 CheckVolume = (!Volume->New && (Volume->FormatState == Formatted));
786
787#ifndef NDEBUG
788 {
789 PPARTENTRY PartEntry = Volume->PartEntry;
790 ASSERT(PartEntry->Volume == Volume);
791 DPRINT("Volume %S (%c%c) on Disk #%d, Partition #%d (%s), "
792 "index %d - Type 0x%02x, IsVolNew = %s, FormatState = %lu -- Should I check it? %s\n",
793 Volume->Info.DeviceName,
794 !Volume->Info.DriveLetter ? '-' : (CHAR)Volume->Info.DriveLetter,
795 !Volume->Info.DriveLetter ? '-' : ':',
796 PartEntry->DiskEntry->DiskNumber,
797 PartEntry->PartitionNumber,
798 PartEntry->LogicalPartition ? "Logical" : "Primary",
799 PartEntry->PartitionIndex,
800 PartEntry->PartitionType,
801 Volume->New ? "Yes" : "No",
802 Volume->FormatState,
803 CheckVolume ? "YES!" : "NO!");
804 }
805#endif
806
807 if (CheckVolume)
809 }
810
811#ifndef NDEBUG
812 /**** Debugging: List all the collected installations ****/
813 DumpNTOSInstalls(List);
814#endif
815
816 return List;
817}
unsigned char BOOLEAN
static NTSTATUS CheckVolume(IN PCWSTR VolumePath, IN LONG TimeOut, IN BOOLEAN CheckOnlyIfDirty)
Definition: autochk.c:391
#define NULL
Definition: types.h:112
PGENERIC_LIST CreateGenericList(VOID)
Definition: genlist.c:20
@ Formatted
Definition: partlist.h:37
UNICODE_STRING Volume
Definition: fltkernel.h:1172
#define ASSERT(a)
Definition: mode.c:44
static VOID FindNTOSInstallations(_Inout_ PGENERIC_LIST List, _In_ PPARTLIST PartList, _In_ PVOLENTRY Volume)
Definition: osdetect.c:679
#define DPRINT
Definition: sndvol32.h:73
base of all file and directory entries
Definition: entries.h:83
Definition: typedefs.h:120
UCHAR PartitionType
Definition: partlist.h:73
PVOLENTRY Volume
Definition: partlist.h:95
struct _DISKENTRY * DiskEntry
Definition: partlist.h:66
BOOLEAN LogicalPartition
Definition: partlist.h:79
ULONG PartitionNumber
Definition: partlist.h:75
ULONG PartitionIndex
Definition: partlist.h:76
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
char CHAR
Definition: xmlstorage.h:175

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().