ReactOS 0.4.15-dev-7934-g1dc8d80
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 1523 of file reactos.c.

1528{
1529 BOOL FoundDrive = FALSE, RetryOnce = FALSE;
1530 PLIST_ENTRY ListEntry;
1532 PCWSTR pwszNtPathToMap = pwszNTPath;
1533 PCWSTR pwszRemaining = NULL;
1534 DWORD cchDrives;
1535 PWCHAR pwszDrive;
1536 WCHAR wszDrives[512];
1537 WCHAR wszNTPath[MAX_PATH];
1538 WCHAR TargetPath[MAX_PATH];
1539
1540 *pwszPath = UNICODE_NULL;
1541
1542 /*
1543 * We find first a mapping inside the MappingList. If one is found, use it
1544 * to build the Win32 path. If there is none, we need to create one by
1545 * checking the Win32 drives (and possibly NT symlinks too).
1546 * In case of success, add the newly found mapping to the list and use it
1547 * to build the Win32 path.
1548 */
1549
1550 for (ListEntry = MappingList->List.Flink;
1551 ListEntry != &MappingList->List;
1552 ListEntry = ListEntry->Flink)
1553 {
1554 Entry = CONTAINING_RECORD(ListEntry, NT_WIN32_PATH_MAPPING, ListEntry);
1555
1556 DPRINT("Testing '%S' --> '%S'\n", Entry->Win32Path, Entry->NtPath);
1557
1558 /* Check whether the queried NT path prefixes the user-provided NT path */
1559 FoundDrive = !_wcsnicmp(pwszNtPathToMap, Entry->NtPath, wcslen(Entry->NtPath));
1560 if (FoundDrive)
1561 {
1562 /* Found it! */
1563
1564 /* Set the pointers and go build the Win32 path */
1565 pwszDrive = Entry->Win32Path;
1566 pwszRemaining = pwszNTPath + wcslen(Entry->NtPath);
1567 goto Quit;
1568 }
1569 }
1570
1571 /*
1572 * No mapping exists for this path yet: try to find one now.
1573 */
1574
1575 /* Retrieve the mounted drives (available drive letters) */
1576 cchDrives = GetLogicalDriveStringsW(_countof(wszDrives) - 1, wszDrives);
1577 if (cchDrives == 0 || cchDrives >= _countof(wszDrives))
1578 {
1579 /* Buffer too small or failure */
1580 DPRINT1("ConvertNtPathToWin32Path: GetLogicalDriveStringsW failed\n");
1581 return FALSE;
1582 }
1583
1584/* We go back there once if RetryOnce == TRUE */
1585Retry:
1586
1587 /* Enumerate the mounted drives */
1588 for (pwszDrive = wszDrives; *pwszDrive; pwszDrive += wcslen(pwszDrive) + 1)
1589 {
1590 /* Retrieve the NT path corresponding to the current Win32 DOS path */
1591 pwszDrive[2] = UNICODE_NULL; // Temporarily remove the backslash
1592 QueryDosDeviceW(pwszDrive, wszNTPath, _countof(wszNTPath));
1593 pwszDrive[2] = L'\\'; // Restore the backslash
1594
1595 DPRINT("Testing '%S' --> '%S'\n", pwszDrive, wszNTPath);
1596
1597 /* Check whether the queried NT path prefixes the user-provided NT path */
1598 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
1599 if (!FoundDrive)
1600 {
1601 PWCHAR ptr, ptr2;
1602
1603 /*
1604 * Check whether this was a network share that has a drive letter,
1605 * but the user-provided NT path points to this share without
1606 * mentioning the drive letter.
1607 *
1608 * The format is: \Device<network_redirector>\;X:<data>\share\path
1609 * The corresponding drive letter is 'X'.
1610 * A system-provided network redirector (LanManRedirector or Mup)
1611 * or a 3rd-party one may be used.
1612 *
1613 * We check whether the user-provided NT path has the form:
1614 * \Device<network_redirector><data>\share\path
1615 * as it obviously did not have the full form (the previous check
1616 * would have been OK otherwise).
1617 */
1618 if (!_wcsnicmp(wszNTPath, L"\\Device\\", _countof(L"\\Device\\")-1) &&
1619 (ptr = wcschr(wszNTPath + _countof(L"\\Device\\")-1, L'\\')) &&
1620 wcslen(++ptr) >= 3 && ptr[0] == L';' && ptr[2] == L':')
1621 {
1622 /*
1623 * Normally the specified drive letter should correspond
1624 * to the one used for the mapping. But we will ignore
1625 * if it happens not to be the case.
1626 */
1627 if (pwszDrive[0] != ptr[1])
1628 {
1629 DPRINT1("Peculiar: expected network share drive letter %C different from actual one %C\n",
1630 pwszDrive[0], ptr[1]);
1631 }
1632
1633 /* Remove the drive letter from the NT network share path */
1634 ptr2 = ptr + 3;
1635 /* Swallow as many possible consecutive backslashes as there could be */
1636 while (*ptr2 == L'\\') ++ptr2;
1637
1638 memmove(ptr, ptr2, (wcslen(ptr2) + 1) * sizeof(WCHAR));
1639
1640 /* Now do the check again */
1641 FoundDrive = !_wcsnicmp(pwszNtPathToMap, wszNTPath, wcslen(wszNTPath));
1642 }
1643 }
1644 if (FoundDrive)
1645 {
1646 /* Found it! */
1647
1648 pwszDrive[2] = UNICODE_NULL; // Remove the backslash
1649
1650 if (pwszNtPathToMap == pwszNTPath)
1651 {
1652 ASSERT(!RetryOnce && pwszNTPath != TargetPath);
1653 pwszRemaining = pwszNTPath + wcslen(wszNTPath);
1654 }
1655 break;
1656 }
1657 }
1658
1659 if (FoundDrive)
1660 {
1661 /* A mapping was found, add it to the cache */
1663 if (!Entry)
1664 {
1665 DPRINT1("ConvertNtPathToWin32Path: Cannot allocate memory\n");
1666 return FALSE;
1667 }
1668 StringCchCopyNW(Entry->NtPath, _countof(Entry->NtPath),
1669 pwszNTPath, pwszRemaining - pwszNTPath);
1670 StringCchCopyW(Entry->Win32Path, _countof(Entry->Win32Path), pwszDrive);
1671
1672 /* Insert it as the most recent entry */
1673 InsertHeadList(&MappingList->List, &Entry->ListEntry);
1674 MappingList->MappingsCount++;
1675
1676 /* Set the pointers and go build the Win32 path */
1677 pwszDrive = Entry->Win32Path;
1678 goto Quit;
1679 }
1680
1681 /*
1682 * We failed, perhaps because the beginning of the NT path used a symlink.
1683 * Try to see whether this is the case by attempting to resolve it.
1684 * If the symlink resolution gives nothing, or we already failed once,
1685 * there is no hope in converting the path to Win32.
1686 * Otherwise, symlink resolution succeeds but we need to recheck again
1687 * the drives list.
1688 */
1689
1690 /*
1691 * In theory we would have to parse each element in the NT path and going
1692 * until finding a symlink object (otherwise we would fail straight away).
1693 * However here we can use guessing instead, since we know which kind of
1694 * NT paths we are likely to manipulate: \Device\HarddiskX\PartitionY\ and
1695 * the like (including \Device\HarddiskVolumeX\‍) and the other ones that
1696 * are supported in setuplib\utils\arcname.c .
1697 *
1698 * But actually, all the supported names in arcname.c are real devices,
1699 * and only \Device\HarddiskX\PartitionY\ may refer to a symlink, so we
1700 * just check for it.
1701 */
1702 if (!RetryOnce && !FoundDrive)
1703 {
1704 ULONG DiskNumber, PartitionNumber;
1705 INT Length;
1706
1709 HANDLE LinkHandle;
1710 UNICODE_STRING SymLink, Target;
1711
1712 if (swscanf(pwszNTPath, L"\\Device\\Harddisk%lu\\Partition%lu%n",
1713 &DiskNumber, &PartitionNumber, &Length) != 2)
1714 {
1715 /* Definitively not a recognized path, bail out */
1716 return FALSE;
1717 }
1718
1719 /* Check whether \Device\HarddiskX\PartitionY is a symlink */
1720 RtlInitEmptyUnicodeString(&SymLink, (PWCHAR)pwszNTPath, Length * sizeof(WCHAR));
1721 SymLink.Length = SymLink.MaximumLength;
1722
1724 &SymLink,
1726 NULL,
1727 NULL);
1728 Status = NtOpenSymbolicLinkObject(&LinkHandle,
1731 if (!NT_SUCCESS(Status))
1732 {
1733 /* Not a symlink, or something else happened: bail out */
1734 DPRINT1("ConvertNtPathToWin32Path: NtOpenSymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
1735 &SymLink, Status);
1736 return FALSE;
1737 }
1738
1739 *TargetPath = UNICODE_NULL;
1740 RtlInitEmptyUnicodeString(&Target, TargetPath, sizeof(TargetPath));
1741
1742 /* Resolve the link and close its handle */
1744 NtClose(LinkHandle);
1745
1746 /* Check for success */
1747 if (!NT_SUCCESS(Status))
1748 {
1749 /* Not a symlink, or something else happened: bail out */
1750 DPRINT1("ConvertNtPathToWin32Path: NtQuerySymbolicLinkObject(%wZ) failed, Status 0x%08lx\n",
1751 &SymLink, Status);
1752 return FALSE;
1753 }
1754
1755 /* Set the pointers */
1756 pwszRemaining = pwszNTPath + Length;
1757 pwszNtPathToMap = TargetPath; // Point to our local buffer
1758
1759 /* Retry once */
1760 RetryOnce = TRUE;
1761 goto Retry;
1762 }
1763
1764 ASSERT(!FoundDrive);
1765
1766Quit:
1767 if (FoundDrive)
1768 {
1769 StringCchPrintfW(pwszPath, cchPathMax,
1770 L"%s%s",
1771 pwszDrive,
1772 pwszRemaining);
1773 DPRINT("ConvertNtPathToWin32Path: %S\n", pwszPath);
1774 return TRUE;
1775 }
1776
1777 return FALSE;
1778}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
HANDLE ProcessHeap
Definition: reactos.c:40
_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().

◆ 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 297 of file reactos.c.

304{
305 UINT i;
306 LVCOLUMN lvC;
307 WCHAR szText[50];
308
309 /* Create the columns */
310 lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
311 lvC.pszText = szText;
312
313 /* Load the column labels from the resource file */
314 for (i = 0; i < nNumOfColumns; i++)
315 {
316 lvC.iSubItem = i;
317 lvC.cx = pColsWidth[i];
318 lvC.fmt = pColsAlign[i];
319
320 LoadStringW(hInstance, pIDs[i], szText, ARRAYSIZE(szText));
321
322 if (ListView_InsertColumn(hWndListView, i, &lvC) == -1)
323 return FALSE;
324 }
325
326 return TRUE;
327}
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:102
ULONG DiskNumber
Definition: partlist.h:108
ULONG HwFixedDiskNumber
Definition: partlist.h:103
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:3158
UINT code
Definition: winuser.h:3159
HWND hwndFrom
Definition: winuser.h:3157
#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:4829
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4399
#define WM_COMMAND
Definition: winuser.h:1740
#define SM_CYSMICON
Definition: winuser.h:1013
#define WM_INITDIALOG
Definition: winuser.h:1739
#define MB_YESNO
Definition: winuser.h:817
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:1012
struct tagNMHDR * LPNMHDR
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define MB_ICONQUESTION
Definition: winuser.h:789
#define DWLP_MSGRESULT
Definition: winuser.h:870
#define WM_DESTROY
Definition: winuser.h:1609
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDYES
Definition: winuser.h:835
#define SetWindowLongPtrW
Definition: winuser.h:5346
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2075
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 41 of file reactos.c.

◆ ProcessHeap

HANDLE ProcessHeap
extern
  • Internal Headers *‍/

Definition at line 15 of file servman.c.

◆ SetupData