ReactOS 0.4.15-dev-6679-g945ee4b
reactos.h File Reference
#include <stdlib.h>
#include <stdarg.h>
#include <tchar.h>
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
#include <wingdi.h>
#include <winuser.h>
#include <strsafe.h>
#include <commctrl.h>
#include <windowsx.h>
#include "treelist.h"
#include <setupapi.h>
#include <devguid.h>
#include <ndk/cmtypes.h>
#include <ndk/iofuncs.h>
#include <ndk/rtlfuncs.h>
#include <../lib/setuplib.h>
Include dependency graph for reactos.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _NT_WIN32_PATH_MAPPING
 
struct  _NT_WIN32_PATH_MAPPING_LIST
 
struct  _SETUPDATA
 

Macros

#define WIN32_NO_STATUS
 
#define IDC_TAB_CONTROL   0x3020
 
#define ID_APPLY_NOW   0x3021
 
#define ID_WIZBACK   0x3023
 
#define ID_WIZNEXT   0x3024
 
#define ID_WIZFINISH   0x3025
 
#define NTOS_MODE_USER
 

Typedefs

typedef struct _NT_WIN32_PATH_MAPPING NT_WIN32_PATH_MAPPING
 
typedef struct _NT_WIN32_PATH_MAPPINGPNT_WIN32_PATH_MAPPING
 
typedef struct _NT_WIN32_PATH_MAPPING_LIST NT_WIN32_PATH_MAPPING_LIST
 
typedef struct _NT_WIN32_PATH_MAPPING_LISTPNT_WIN32_PATH_MAPPING_LIST
 
typedef struct _SETUPDATA SETUPDATA
 
typedef struct _SETUPDATAPSETUPDATA
 

Functions

BOOL ConvertNtPathToWin32Path (IN OUT PNT_WIN32_PATH_MAPPING_LIST MappingList, OUT PWSTR pwszPath, IN DWORD cchPathMax, IN PCWSTR pwszNTPath)
 
BOOL CreateListViewColumns (IN HINSTANCE hInstance, IN HWND hWndListView, IN const UINT *pIDs, IN const INT *pColsWidth, IN const INT *pColsAlign, IN UINT nNumOfColumns)
 
INT_PTR CALLBACK DriveDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

HANDLE ProcessHeap
 
BOOLEAN IsUnattendedSetup
 
SETUPDATA SetupData
 

Macro Definition Documentation

◆ ID_APPLY_NOW

#define ID_APPLY_NOW   0x3021

Definition at line 51 of file reactos.h.

◆ ID_WIZBACK

#define ID_WIZBACK   0x3023

Definition at line 52 of file reactos.h.

◆ ID_WIZFINISH

#define ID_WIZFINISH   0x3025

Definition at line 54 of file reactos.h.

◆ ID_WIZNEXT

#define ID_WIZNEXT   0x3024

Definition at line 53 of file reactos.h.

◆ IDC_TAB_CONTROL

#define IDC_TAB_CONTROL   0x3020

Definition at line 50 of file reactos.h.

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 62 of file reactos.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 36 of file reactos.h.

Typedef Documentation

◆ NT_WIN32_PATH_MAPPING

◆ NT_WIN32_PATH_MAPPING_LIST

◆ PNT_WIN32_PATH_MAPPING

◆ PNT_WIN32_PATH_MAPPING_LIST

◆ PSETUPDATA

◆ SETUPDATA

Function Documentation

◆ ConvertNtPathToWin32Path()

BOOL ConvertNtPathToWin32Path ( IN OUT PNT_WIN32_PATH_MAPPING_LIST  MappingList,
OUT PWSTR  pwszPath,
IN DWORD  cchPathMax,
IN PCWSTR  pwszNTPath 
)

Definition at line 1498 of file reactos.c.

1503{
1504 BOOL FoundDrive = FALSE, RetryOnce = FALSE;
1505 PLIST_ENTRY ListEntry;
1507 PCWSTR pwszNtPathToMap = pwszNTPath;
1508 PCWSTR pwszRemaining = NULL;
1509 DWORD cchDrives;
1510 PWCHAR pwszDrive;
1511 WCHAR wszDrives[512];
1512 WCHAR wszNTPath[MAX_PATH];
1513 WCHAR TargetPath[MAX_PATH];
1514
1515 *pwszPath = UNICODE_NULL;
1516
1517 /*
1518 * We find first a mapping inside the MappingList. If one is found, use it
1519 * to build the Win32 path. If there is none, we need to create one by
1520 * checking the Win32 drives (and possibly NT symlinks too).
1521 * In case of success, add the newly found mapping to the list and use it
1522 * to build the Win32 path.
1523 */
1524
1525 for (ListEntry = MappingList->List.Flink;
1526 ListEntry != &MappingList->List;
1527 ListEntry = ListEntry->Flink)
1528 {
1529 Entry = CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
1530
1531 DPRINT("Testing '%S' --> '%S'\n", Entry->Win32Path, Entry->NtPath);
1532
1533 /* Check whether the queried NT path prefixes the user-provided NT path */
1534 FoundDrive = !_wcsnicmp(pwszNtPathToMap, Entry->NtPath, wcslen(Entry->NtPath));
1535 if (FoundDrive)
1536 {
1537 /* Found it! */
1538
1539 /* Set the pointers and go build the Win32 path */
1540 pwszDrive = Entry->Win32Path;
1541 pwszRemaining = pwszNTPath + wcslen(Entry->NtPath);
1542 goto Quit;
1543 }
1544 }
1545
1546 /*
1547 * No mapping exists for this path yet: try to find one now.
1548 */
1549
1550 /* Retrieve the mounted drives (available drive letters) */
1551 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
1552 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
1553 {
1554 /* Buffer too small or failure */
1555 DPRINT1("ConvertNtPathToWin32Path: GetLogicalDriveStringsW failed\n");
1556 return FALSE;
1557 }
1558
1559/* We go back there once if RetryOnce == TRUE */
1560Retry:
1561
1562 /* Enumerate the mounted drives */
1563 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
1564 {
1565 /* Retrieve the NT path corresponding to the current Win32 DOS path */
1566 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
1567 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
1568 pwszDrive[2] = L'\\'; // Restore the backslash
1569
1570 DPRINT("Testing '%S' --> '%S'\n", pwszDrive, wszNTPath);
1571
1572 /* Check whether the queried NT path prefixes the user-provided NT path */
1573 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
1574 if (!FoundDrive)
1575 {
1576 PWCHAR ptr, ptr2;
1577
1578 /*
1579 * Check whether this was a network share that has a drive letter,
1580 * but the user-provided NT path points to this share without
1581 * mentioning the drive letter.
1582 *
1583 * The format is: \Device<network_redirector>\;X:<data>\share\path
1584 * The corresponding drive letter is 'X'.
1585 * A system-provided network redirector (LanManRedirector or Mup)
1586 * or a 3rd-party one may be used.
1587 *
1588 * We check whether the user-provided NT path has the form:
1589 * \Device<network_redirector><data>\share\path
1590 * as it obviously did not have the full form (the previous check
1591 * would have been OK otherwise).
1592 */
1593 if (!_wcsnicmp(wszNTPath, L"\\Device\\", _countof(L"\\Device\\")-1) &&
1594 (ptr = wcschr(wszNTPath + _countof(L"\\Device\\")-1, L'\\')) &&
1595 wcslen(++ptr) >= 3 && ptr[0] == L';' && ptr[2] == L':')
1596 {
1597 /*
1598 * Normally the specified drive letter should correspond
1599 * to the one used for the mapping. But we will ignore
1600 * if it happens not to be the case.
1601 */
1602 if (pwszDrive[0] != ptr[1])
1603 {
1604 DPRINT1("Peculiar: expected network share drive letter %C different from actual one %C\n",
1605 pwszDrive[0], ptr[1]);
1606 }
1607
1608 /* Remove the drive letter from the NT network share path */
1609 ptr2 = ptr + 3;
1610 /* Swallow as many possible consecutive backslashes as there could be */
1611 while (*ptr2 == L'\\') ++ptr2;
1612
1613 memmove(ptr, ptr2, (wcslen(ptr2) + 1) * sizeof(WCHAR));
1614
1615 /* Now do the check again */
1616 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
1617 }
1618 }
1619 if (FoundDrive)
1620 {
1621 /* Found it! */
1622
1623 pwszDrive[2] = UNICODE_NULL; // Remove the backslash
1624
1625 if (pwszNtPathToMap == pwszNTPath)
1626 {
1627 ASSERT(!RetryOnce && pwszNTPath != TargetPath);
1628 pwszRemaining = pwszNTPath + wcslen(wszNTPath);
1629 }
1630 break;
1631 }
1632 }
1633
1634 if (FoundDrive)
1635 {
1636 /* A mapping was found, add it to the cache */
1638 if (!Entry)
1639 {
1640 DPRINT1("ConvertNtPathToWin32Path: Cannot allocate memory\n");
1641 return FALSE;
1642 }
1643 StringCchCopyNW(Entry->NtPath, _countof(Entry->NtPath),
1644 pwszNTPath, pwszRemaining - pwszNTPath);
1645 StringCchCopyW(Entry->Win32Path, _countof(Entry->Win32Path), pwszDrive);
1646
1647 /* Insert it as the most recent entry */
1648 InsertHeadList(&MappingList->List, &Entry->ListEntry);
1649 MappingList->MappingsCount++;
1650
1651 /* Set the pointers and go build the Win32 path */
1652 pwszDrive = Entry->Win32Path;
1653 goto Quit;
1654 }
1655
1656 /*
1657 * We failed, perhaps because the beginning of the NT path used a symlink.
1658 * Try to see whether this is the case by attempting to resolve it.
1659 * If the symlink resolution gives nothing, or we already failed once,
1660 * there is no hope in converting the path to Win32.
1661 * Otherwise, symlink resolution succeeds but we need to recheck again
1662 * the drives list.
1663 */
1664
1665 /*
1666 * In theory we would have to parse each element in the NT path and going
1667 * until finding a symlink object (otherwise we would fail straight away).
1668 * However here we can use guessing instead, since we know which kind of
1669 * NT paths we are likely to manipulate: \Device\HarddiskX\PartitionY\ and
1670 * the like (including \Device\HarddiskVolumeX\‍) and the other ones that
1671 * are supported in setuplib\utils\arcname.c .
1672 *
1673 * But actually, all the supported names in arcname.c are real devices,
1674 * and only \Device\HarddiskX\PartitionY\ may refer to a symlink, so we
1675 * just check for it.
1676 */
1677 if (!RetryOnce && !FoundDrive)
1678 {
1679 ULONG DiskNumber, PartitionNumber;
1680 INT Length;
1681
1684 HANDLE LinkHandle;
1685 UNICODE_STRING SymLink, Target;
1686
1687 if (swscanf(pwszNTPath, L"\\Device\\Harddisk%lu\\Partition%lu%n",
1688 &DiskNumber, &PartitionNumber, &Length) != 2)
1689 {
1690 /* Definitively not a recognized path, bail out */
1691 return FALSE;
1692 }
1693
1694 /* Check whether \Device\HarddiskX\PartitionY is a symlink */
1695 RtlInitEmptyUnicodeString(&SymLink, (PWCHAR)pwszNTPath, Length * sizeof(WCHAR));
1696 SymLink.Length = SymLink.MaximumLength;
1697
1699 &SymLink,
1701 NULL,
1702 NULL);
1703 Status = NtOpenSymbolicLinkObject(&LinkHandle,
1706 if (!NT_SUCCESS(Status))
1707 {
1708 /* Not a symlink, or something else happened: bail out */
1709 DPRINT1("ConvertNtPathToWin32Path: NtOpenSymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
1710 &SymLink, Status);
1711 return FALSE;
1712 }
1713
1714 *TargetPath = UNICODE_NULL;
1715 RtlInitEmptyUnicodeString(&Target, TargetPath, sizeof(TargetPath));
1716
1717 /* Resolve the link and close its handle */
1719 NtClose(LinkHandle);
1720
1721 /* Check for success */
1722 if (!NT_SUCCESS(Status))
1723 {
1724 /* Not a symlink, or something else happened: bail out */
1725 DPRINT1("ConvertNtPathToWin32Path: NtQuerySymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
1726 &SymLink, Status);
1727 return FALSE;
1728 }
1729
1730 /* Set the pointers */
1731 pwszRemaining = pwszNTPath + Length;
1732 pwszNtPathToMap = TargetPath; // Point to our local buffer
1733
1734 /* Retry once */
1735 RetryOnce = TRUE;
1736 goto Retry;
1737 }
1738
1739 ASSERT(!FoundDrive);
1740
1741Quit:
1742 if (FoundDrive)
1743 {
1744 StringCchPrintfW(pwszPath, cchPathMax,
1745 L"%s%s",
1746 pwszDrive,
1747 pwszRemaining);
1748 DPRINT("ConvertNtPathToWin32Path: %S\n", pwszPath);
1749 return TRUE;
1750 }
1751
1752 return FALSE;
1753}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
HANDLE ProcessHeap
Definition: reactos.c:39
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
Definition: classpnp.h:312
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define wcschr
Definition: compat.h:17
#define HeapAlloc
Definition: compat.h:733
#define MAX_PATH
Definition: compat.h:34
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
DWORD WINAPI QueryDosDeviceW(LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax)
Definition: dosdev.c:542
DWORD WINAPI GetLogicalDriveStringsW(IN DWORD nBufferLength, IN LPWSTR lpBuffer)
Definition: disk.c:73
#define InsertHeadList(ListHead, Entry)
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
Status
Definition: gdiplustypes.h:25
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define ASSERT(a)
Definition: mode.c:44
static PVOID ptr
Definition: dispmode.c:27
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
#define SYMBOLIC_LINK_QUERY
Definition: nt_native.h:1265
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define L(x)
Definition: ntvdm.h:50
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
#define DPRINT
Definition: sndvol32.h:71
#define _countof(array)
Definition: sndvol32.h:68
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
STRSAFEAPI StringCchCopyNW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy)
Definition: strsafe.h:236
base of all file and directory entries
Definition: entries.h:83
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
USHORT MaximumLength
Definition: env_spec_w32.h:370
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
uint16_t * PWCHAR
Definition: typedefs.h:56
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
_In_ ULONG _In_ ULONG PartitionNumber
Definition: iofuncs.h:2061
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by SetupOpenInfFileExW(), SpFileQueueCopy_NtToWin32(), SpFileQueueDelete_NtToWin32(), and SpFileQueueRename_NtToWin32().

◆ CreateListViewColumns()

BOOL CreateListViewColumns ( IN HINSTANCE  hInstance,
IN HWND  hWndListView,
IN const UINT pIDs,
IN const INT pColsWidth,
IN const INT pColsAlign,
IN UINT  nNumOfColumns 
)

Definition at line 296 of file reactos.c.

303{
304 UINT i;
305 LVCOLUMN lvC;
306 WCHAR szText[50];
307
308 /* Create the columns */
309 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
310 lvC.pszText = szText;
311
312 /* Load the column labels from the resource file */
313 for (i = 0; i < nNumOfColumns; i++)
314 {
315 lvC.iSubItem = i;
316 lvC.cx = pColsWidth[i];
317 lvC.fmt = pColsAlign[i];
318
319 LoadStringW(hInstance, pIDs[i], szText, ARRAYSIZE(szText));
320
321 if (ListView_InsertColumn(hWndListView, i, &lvC) == -1)
322 return FALSE;
323 }
324
325 return TRUE;
326}
HINSTANCE hInstance
Definition: charmap.c:19
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
#define ListView_InsertColumn(hwnd, iCol, pcol)
Definition: commctrl.h:2636
#define LVCF_WIDTH
Definition: commctrl.h:2587
#define LVCF_FMT
Definition: commctrl.h:2586
#define LVCF_SUBITEM
Definition: commctrl.h:2589
#define LVCF_TEXT
Definition: commctrl.h:2588
#define LVCOLUMN
Definition: commctrl.h:2581
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)

Referenced by UpgradeRepairDlgProc().

◆ DriveDlgProc()

INT_PTR CALLBACK DriveDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 613 of file drivepage.c.

618{
619 PSETUPDATA pSetupData;
620 HWND hList;
621 HIMAGELIST hSmall;
622
623 /* Retrieve pointer to the global setup data */
624 pSetupData = (PSETUPDATA)GetWindowLongPtrW(hwndDlg, GWLP_USERDATA);
625
626 switch (uMsg)
627 {
628 case WM_INITDIALOG:
629 {
630 /* Save pointer to the global setup data */
631 pSetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
632 SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (DWORD_PTR)pSetupData);
633
634 /*
635 * Keep the "Next" button disabled. It will be enabled only
636 * when the user selects a valid partition.
637 */
639
640 hList = GetDlgItem(hwndDlg, IDC_PARTITION);
641
643 // TreeList_SetExtendedStyleEx(hList, TVS_EX_FULLROWITEMS, TVS_EX_FULLROWITEMS);
644
646 hList,
651
652 /* Create the ImageList */
655 ILC_COLOR32 | ILC_MASK, // ILC_COLOR24
656 1, 1);
657
658 /* Add event type icons to the ImageList */
661
662 /* Assign the ImageList to the List View */
664
665 // DisplayStuffUsingWin32Setup(hwndDlg);
667 break;
668 }
669
670 case WM_DESTROY:
671 {
672 hList = GetDlgItem(hwndDlg, IDC_PARTITION);
675 ImageList_Destroy(hSmall);
676 return TRUE;
677 }
678
679 case WM_COMMAND:
680 {
681 switch (LOWORD(wParam))
682 {
683 case IDC_PARTMOREOPTS:
684 DialogBoxParamW(pSetupData->hInstance,
686 hwndDlg,
688 (LPARAM)pSetupData);
689 break;
690
691 case IDC_PARTCREATE:
692 DialogBoxW(pSetupData->hInstance,
694 hwndDlg,
696 break;
697
698 case IDC_PARTDELETE:
699 break;
700 }
701 break;
702 }
703
704 case WM_NOTIFY:
705 {
706 LPNMHDR lpnm = (LPNMHDR)lParam;
707
708 // On Vista+ we can use TVN_ITEMCHANGED instead, with NMTVITEMCHANGE* pointer
709 if (lpnm->idFrom == IDC_PARTITION && lpnm->code == TVN_SELCHANGED)
710 {
712
713 // if (pnmv->uChanged & TVIF_STATE) /* The state has changed */
714 if (pnmv->itemNew.mask & TVIF_STATE)
715 {
716 /* The item has been (de)selected */
717 // if (pnmv->uNewState & TVIS_SELECTED)
718 if (pnmv->itemNew.state & TVIS_SELECTED)
719 {
720 HTLITEM hParentItem = TreeList_GetParent(lpnm->hwndFrom, pnmv->itemNew.hItem);
721 /* May or may not be a PPARTENTRY: this is a PPARTENTRY only when hParentItem != NULL */
722 PPARTENTRY PartEntry = (PPARTENTRY)pnmv->itemNew.lParam;
723
724 if (!hParentItem || !PartEntry)
725 {
728 goto DisableWizNext;
729 }
730 else // if (hParentItem && PartEntry)
731 {
732 EnableWindow(GetDlgItem(hwndDlg, IDC_PARTCREATE), !PartEntry->IsPartitioned);
734
735 if (PartEntry->IsPartitioned &&
736 !IsContainerPartition(PartEntry->PartitionType) /* alternatively: PartEntry->PartitionNumber != 0 */ &&
737 // !PartEntry->New &&
738 (PartEntry->FormatState == Preformatted /* || PartEntry->FormatState == Formatted */))
739 {
741 }
742 else
743 {
744 goto DisableWizNext;
745 }
746 }
747 }
748 else
749 {
750DisableWizNext:
751 /*
752 * Keep the "Next" button disabled. It will be enabled only
753 * when the user selects a valid partition.
754 */
756 }
757 }
758
759 break;
760 }
761
762 switch (lpnm->code)
763 {
764#if 0
765 case PSN_SETACTIVE:
766 {
767 /*
768 * Keep the "Next" button disabled. It will be enabled only
769 * when the user selects a valid partition.
770 */
772 break;
773 }
774#endif
775
777 {
778 /* Give the focus on and select the first item */
779 hList = GetDlgItem(hwndDlg, IDC_PARTITION);
780 // TreeList_SetFocusItem(hList, 1, 1);
783 return TRUE;
784 }
785
786 case PSN_QUERYCANCEL:
787 {
788 if (MessageBoxW(GetParent(hwndDlg),
789 pSetupData->szAbortMessage,
790 pSetupData->szAbortTitle,
792 {
793 /* Go to the Terminate page */
795 }
796
797 /* Do not close the wizard too soon */
799 return TRUE;
800 }
801
802 case PSN_WIZNEXT: /* Set the selected data */
803 {
805
806 /****/
807 // FIXME: This is my test disk encoding!
808 DISKENTRY DiskEntry;
809 PARTENTRY PartEntry;
810 DiskEntry.DiskNumber = 0;
811 DiskEntry.HwDiskNumber = 0;
812 DiskEntry.HwFixedDiskNumber = 0;
813 PartEntry.DiskEntry = &DiskEntry;
814 PartEntry.PartitionNumber = 1; // 4;
815 /****/
816
818 NULL, // pSetupData->USetupData.InstallationDirectory,
819 &PartEntry);
820
821 if (!NT_SUCCESS(Status))
822 {
823 DPRINT1("InitDestinationPaths() failed with status 0x%08lx\n", Status);
824 }
825
826 break;
827 }
828
829 default:
830 break;
831 }
832 }
833 break;
834
835 default:
836 break;
837 }
838
839 return FALSE;
840}
struct _SETUPDATA * PSETUPDATA
#define IDD_RESTARTPAGE
Definition: resource.h:59
#define IDI_PARTITION
Definition: resource.h:12
#define IDC_PARTMOREOPTS
Definition: resource.h:62
#define IDC_PARTDELETE
Definition: resource.h:40
#define IDC_PARTITION
Definition: resource.h:38
#define IDI_DISKDRIVE
Definition: resource.h:11
#define IDC_PARTCREATE
Definition: resource.h:39
#define IDD_PARTITION
Definition: resource.h:70
#define IDD_BOOTOPTIONS
Definition: resource.h:64
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
static const INT column_widths[MAX_LIST_COLUMNS]
Definition: drivepage.c:46
#define MAX_LIST_COLUMNS
Definition: drivepage.c:44
static const INT column_alignment[MAX_LIST_COLUMNS]
Definition: drivepage.c:47
VOID DrawPartitionList(IN HWND hWndList, IN PPARTLIST List)
Definition: drivepage.c:591
static INT_PTR CALLBACK MoreOptDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drivepage.c:52
BOOL CreateTreeListColumns(IN HINSTANCE hInstance, IN HWND hWndTreeList, IN const UINT *pIDs, IN const INT *pColsWidth, IN const INT *pColsAlign, IN UINT nNumOfColumns)
Definition: drivepage.c:127
static const UINT column_ids[MAX_LIST_COLUMNS]
Definition: drivepage.c:45
static INT_PTR CALLBACK PartitionDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: drivepage.c:99
struct _PARTENTRY * PPARTENTRY
@ Preformatted
Definition: partlist.h:37
if(dx< 0)
Definition: linetemp.h:194
HWND hList
Definition: livecd.c:10
#define PSN_QUERYINITIALFOCUS
Definition: settings.cpp:98
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define IsContainerPartition(PartitionType)
Definition: ntdddisk.h:316
#define LOWORD(l)
Definition: pedump.c:82
#define PSN_QUERYCANCEL
Definition: prsht.h:123
#define PSN_WIZNEXT
Definition: prsht.h:121
#define PSWIZB_NEXT
Definition: prsht.h:154
#define PSWIZB_BACK
Definition: prsht.h:153
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
#define LPPROPSHEETPAGE
Definition: prsht.h:390
#define PropSheet_SetCurSelByID(d, i)
Definition: prsht.h:354
#define PSN_SETACTIVE
Definition: prsht.h:115
#define TVN_SELCHANGED
Definition: commctrl.h:3735
#define TVSIL_NORMAL
Definition: commctrl.h:3443
#define LPNMTREEVIEW
Definition: commctrl.h:3643
#define ILC_COLOR32
Definition: commctrl.h:358
#define TVIS_SELECTED
Definition: commctrl.h:3280
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define ILC_MASK
Definition: commctrl.h:351
#define TVIF_STATE
Definition: commctrl.h:3269
#define WM_NOTIFY
Definition: richedit.h:61
NTSTATUS InitDestinationPaths(IN OUT PUSETUP_DATA pSetupData, IN PCWSTR InstallationDir, IN PPARTENTRY PartEntry)
Definition: setuplib.c:627
ULONG HwDiskNumber
Definition: partlist.h:105
ULONG DiskNumber
Definition: partlist.h:111
ULONG HwFixedDiskNumber
Definition: partlist.h:106
BOOLEAN IsPartitioned
Definition: partlist.h:66
UCHAR PartitionType
Definition: partlist.h:53
struct _DISKENTRY * DiskEntry
Definition: partlist.h:46
FORMATSTATE FormatState
Definition: partlist.h:61
ULONG PartitionNumber
Definition: partlist.h:55
USETUP_DATA USetupData
Definition: reactos.h:128
HINSTANCE hInstance
Definition: reactos.h:114
TCHAR szAbortMessage[512]
Definition: reactos.h:123
PPARTLIST PartitionList
Definition: reactos.h:132
TCHAR szAbortTitle[64]
Definition: reactos.h:124
UINT_PTR idFrom
Definition: winuser.h:3148
UINT code
Definition: winuser.h:3149
HWND hwndFrom
Definition: winuser.h:3147
#define SetWindowLongPtr
Definition: treelist.c:70
#define GWLP_USERDATA
Definition: treelist.c:63
#define TreeList_SetExtendedStyleEx(h, d, m)
Definition: treelist.h:377
#define HTLITEM
Definition: treelist.h:460
#define TreeList_GetImageList(h, i)
Definition: treelist.h:397
#define TreeList_GetParent(h, i)
Definition: treelist.h:436
#define TVS_EX_FULLROWMARK
Definition: treelist.h:272
#define TreeList_SelectItem(h, i)
Definition: treelist.h:430
#define TreeList_SetImageList(h, l, i)
Definition: treelist.h:407
uint32_t DWORD_PTR
Definition: typedefs.h:65
LONG_PTR LPARAM
Definition: windef.h:208
#define GetWindowLongPtrW
Definition: winuser.h:4819
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4389
#define WM_COMMAND
Definition: winuser.h:1730
#define SM_CYSMICON
Definition: winuser.h:1007
#define WM_INITDIALOG
Definition: winuser.h:1729
#define MB_YESNO
Definition: winuser.h:811
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define SM_CXSMICON
Definition: winuser.h:1006
struct tagNMHDR * LPNMHDR
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define MB_ICONQUESTION
Definition: winuser.h:783
#define DWLP_MSGRESULT
Definition: winuser.h:864
#define WM_DESTROY
Definition: winuser.h:1599
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:829
#define SetWindowLongPtrW
Definition: winuser.h:5336
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2044
int WINAPI GetSystemMetrics(_In_ int)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)

Referenced by _tWinMain().

Variable Documentation

◆ IsUnattendedSetup

BOOLEAN IsUnattendedSetup
extern

Definition at line 40 of file reactos.c.

◆ ProcessHeap

HANDLE ProcessHeap
extern
  • Internal Headers *‍/

Definition at line 15 of file servman.c.

◆ SetupData