Compare commits

...

20 Commits

Author SHA1 Message Date
Amine Khaldi
59e1af70da [0.4.2] * Remove the RC1 note.
svn path=/branches/ros-branch-0_4_2/; revision=72232
2016-08-15 18:55:26 +00:00
Amine Khaldi
3f56e98f4f [0.4.2] * Merge the browseui addressband fix by Christoph in r72103. CORE-11766
svn path=/branches/ros-branch-0_4_2/; revision=72112
2016-08-05 09:36:22 +00:00
Amine Khaldi
0db027bf72 [0.4.2] * Merge the notepad Danish translation improvement by Hermès in r72078.
svn path=/branches/ros-branch-0_4_2/; revision=72095
2016-08-02 17:35:51 +00:00
Amine Khaldi
b288719201 [0.4.2] * Merge the browseui disc names fix by Christoph in r72092. CORE-11458
svn path=/branches/ros-branch-0_4_2/; revision=72094
2016-08-02 17:21:30 +00:00
Amine Khaldi
9e328c22dd [0.4.2] * Merge the ntfs fix by Trevor in r72067. CORE-11707
svn path=/branches/ros-branch-0_4_2/; revision=72068
2016-08-01 08:45:49 +00:00
Amine Khaldi
972edc6b66 [0.4.2] * Merge the browseui work by Mark in r72063. CORE-11721
svn path=/branches/ros-branch-0_4_2/; revision=72064
2016-07-31 12:46:15 +00:00
Amine Khaldi
6b0015b18f [0.4.2] * Merge Sylvain's machine.inf update in r72036.
svn path=/branches/ros-branch-0_4_2/; revision=72040
2016-07-28 19:41:56 +00:00
Amine Khaldi
bfc5077cfe [0.4.2] * Merge the console work by Hermès in r72030. CORE-8394 CORE-9900
svn path=/branches/ros-branch-0_4_2/; revision=72039
2016-07-28 19:40:27 +00:00
Amine Khaldi
50b8c0ca9c [0.4.2] * Merge the RDP files association fix by Jared in r72032. CORE-11655
svn path=/branches/ros-branch-0_4_2/; revision=72038
2016-07-28 19:36:40 +00:00
Amine Khaldi
09f6700528 [0.4.2] * Merge the shell fixes by Joachim and Christoph in revisions 72033 and 72034. CORE-5272
svn path=/branches/ros-branch-0_4_2/; revision=72037
2016-07-28 19:34:06 +00:00
Amine Khaldi
30e30daf51 [0.4.2] * Merge r72028. CORE-11689
svn path=/branches/ros-branch-0_4_2/; revision=72029
2016-07-27 21:40:49 +00:00
Amine Khaldi
4165e2c6d2 [0.4.2] * Merge the shell fix by Giannis in r72026. CORE-11681
svn path=/branches/ros-branch-0_4_2/; revision=72027
2016-07-27 21:35:54 +00:00
Amine Khaldi
725e7bef25 [0.4.2] * Merge setupapi work by Hermès in revisions 72020-72022. CORE-11689 ROSTESTS-234
svn path=/branches/ros-branch-0_4_2/; revision=72025
2016-07-27 19:32:11 +00:00
Amine Khaldi
392a9398e2 [0.4.2] * Apply the hackfix from CORE-9836 by Joachim Henze.
svn path=/branches/ros-branch-0_4_2/; revision=72018
2016-07-27 15:21:39 +00:00
Thomas Faber
a20eaf6799 [0.4.2]
- Add a hack to avoid MmGetPhysicalAddress failures during USB transfers
CORE-9224

svn path=/branches/ros-branch-0_4_2/; revision=72016
2016-07-27 10:55:39 +00:00
Thomas Faber
633468a888 [0.4.2]
- Update start menu banner

svn path=/branches/ros-branch-0_4_2/; revision=72015
2016-07-27 10:48:19 +00:00
Amine Khaldi
132750f269 [0.4.2] * Disable COMMAND.COM debugging messages. CORE-10710
svn path=/branches/ros-branch-0_4_2/; revision=72014
2016-07-27 10:42:15 +00:00
Amine Khaldi
f5333c3e7b [0.4.2] * Apply the Wordpad related hack from CORE-5823 by Jared Smudde.
svn path=/branches/ros-branch-0_4_2/; revision=72013
2016-07-27 10:40:42 +00:00
Amine Khaldi
976b50cf4d [0.4.2] * Apply the patch that allows us to dynamically change the resolution by resizing in VirtualBox. CORE-6742
svn path=/branches/ros-branch-0_4_2/; revision=72012
2016-07-27 10:34:01 +00:00
Amine Khaldi
273689afa6 [0.4.2] Update the version number.
svn path=/branches/ros-branch-0_4_2/; revision=72011
2016-07-27 10:09:46 +00:00
48 changed files with 651 additions and 330 deletions

View File

@@ -23,8 +23,8 @@ BEGIN
POPUP "&Fil"
BEGIN
MENUITEM "&Ny\tCtrl+N", CMD_NEW
MENUITEM "Å&bn\tEnter", CMD_OPEN
MENUITEM "&Gem", CMD_SAVE
MENUITEM "Å&bn...\tCtrl+O", CMD_OPEN
MENUITEM "&Gem\tCtrl+S", CMD_SAVE
MENUITEM "Gem so&m...", CMD_SAVE_AS
MENUITEM SEPARATOR
MENUITEM "Side&opsætning...", CMD_PAGE_SETUP

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -341,6 +341,14 @@ HKCR,"regfile\shell\edit\command","",0x00020000,"%SystemRoot%\system32\notepad.e
HKCR,"regfile\shell\open","",0x00000000,%MERGE%
HKCR,"regfile\shell\open\command","",0x00000000,"regedit.exe ""%1"""
; Remote Desktop File
HKCR,".rdp","",0x00000000,"rdpfile"
HKCR,"rdpfile","",0x00000000,"Remote Desktop Connection"
;HKCR,"rdpfile","FriendlyTypeName",0x00020000,"%SystemRoot%\mstsc.exe,-4004"
HKCR,"rdpfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\mstsc.exe,0"
HKCR,"rdpfile\shell\open\command","",0x00020000,"%SystemRoot%\system32\mstsc.exe %1"
;HKCR,"rdpfile\shell\edit\command","",0x00020000,"%SystemRoot%\system32\mstsc.exe -edit %1"
; Screen Savers
HKCR,".scr","",0x00000000,"scrfile"
HKCR,"scrfile","",0x00000000,"Screen Saver"

View File

@@ -72,7 +72,7 @@ HRESULT STDMETHODCALLTYPE CAddressBand::GetBandInfo(DWORD dwBandID, DWORD dwView
{
if (pdbi->dwMask & DBIM_MINSIZE)
{
pdbi->ptMinSize.x = 400;
pdbi->ptMinSize.x = 100;
pdbi->ptMinSize.y = 22;
}
if (pdbi->dwMask & DBIM_MAXSIZE)
@@ -87,7 +87,7 @@ HRESULT STDMETHODCALLTYPE CAddressBand::GetBandInfo(DWORD dwBandID, DWORD dwView
}
if (pdbi->dwMask & DBIM_ACTUAL)
{
pdbi->ptActual.x = 400;
pdbi->ptActual.x = 100;
pdbi->ptActual.y = 22;
}
if (pdbi->dwMask & DBIM_TITLE)

View File

@@ -350,7 +350,7 @@ HTREEITEM CExplorerBand::InsertItem(HTREEITEM hParent, IShellFolder *psfParent,
/* Get the name of the node */
WCHAR wszDisplayName[MAX_PATH];
if (!ILGetDisplayNameEx(psfParent, pEltRelative, wszDisplayName, ILGDN_INFOLDER))
if (!ILGetDisplayNameEx(psfParent, pElt, wszDisplayName, ILGDN_INFOLDER))
{
ERR("Failed to get node name\n");
return NULL;

View File

@@ -273,3 +273,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Back|Forward|Up|Search|Folders|Move To|Copy To|Delete|Undo|Views|Stop|Refresh|Home|Map Drive|Disconnect|Favorites|History|Full Screen|Properties|Cut|Copy|Paste|Folder Options||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -292,3 +292,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Zurück|Vorwärts|Übergeordneter Ordner|Suchen|Ordner|Verschieben nach|Kopieren nach|Löschen|Rückgängig|Ansicht|Stop|Aktualisieren|Startseite|Netzlaufwerk verbinden|Netzlaufwerk trennen|Favoriten|Verlauf|Vollbild|Eigenschaften|Ausschneiden|Kopieren|Einfügen|Ordneroptionen||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -291,3 +291,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Back|Forward|Up|Search|Folders|Move To|Copy To|Delete|Undo|Views|Stop|Refresh|Home|Map Drive|Disconnect|Favorites|History|Full Screen|Properties|Cut|Copy|Paste|Folder Options||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -275,3 +275,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Atrás|Adelante|Subir|Búsqueda|Carpetas|Mover a|Copiar a|Borrar|Deshacer|Vistas|Detener|Recargar|Inicio|Montar disco|Desconectar|Favoritos|Historial|Pantalla completa|Propiedades|Cortar|Copiar|Pegar|Opciones de carpeta||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -291,3 +291,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Retour|Avancer|Dossier parent|Recherche|Dossiers|Aller vers|Copier dans|Supprimer|Annuler|Affichage|Stop|Rafraîchir|Home|Map Drive|Déconnecter|Favoris|Historique|Plein écran|Propriétés|Couper|Copier|Coller|Options des dossiers||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Désolé"
IDS_SORRY_MESSAGE, "ReactOS ne peut pas atteindre '%s' (erreur 0x%lx).\nVeuillez vérifier qu'un navigateur web est installé."
END

View File

@@ -275,3 +275,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Back|Forward|Up|Search|Folders|Move To|Copy To|Delete|Undo|Views|Stop|Refresh|Home|Map Drive|Disconnect|Favorites|History|Full Screen|Properties|Cut|Copy|Paste|Folder Options||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -273,3 +273,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Indietro|Avanti|Livello superiore|Cerca|Cartelle|Sposta in|Copia in|Elimina|Annulla|Visualizza|Ferma|Aggiorna|Pagina iniziale|Mappa disco|Disconnette|Preferiti|Cronologia|Schermo intero|Proprietà|Taglia|Copia|Incolla|Opzioni cartella||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -281,3 +281,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Wstecz|Dalej|W górę|Wyszukaj|Foldery|Przemieść do|Kopiuj do|Usuń|Cofnij|Widoki|Stop|Odśwież|Strona główna|Mapa dysków|Rozłącz|Ulubione|Historia|Pełny ekran|Właściwości|Wytnij|Kopiuj|Wklej|Opcje folderów||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -275,3 +275,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Voltar|Avançar|Acima|Pesquisar|Pastas|Mover para|Copiar para|Excluir|Desfazer|Modos de exibição|Parar|Atualizar|Página inicial|Mapear unidade|Desconectar|Favoritos|Histórico|Tela inteira|Propriedades|Recortar|Copiar|Colar|Opções de pasta||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -275,3 +275,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Înapoi|Înainte|Sus|Căutare|Dosare|Mutare în|Copiere în|Ștergere|Desfacere|Afișări|Oprire|Împrospătare|Acasă|Conectare unitate de stocare|Deconectare|Favorite|Istoric|Pe tot ecranul|Proprietăți|Decupare|Copiere|Lipire|Opțiuni de dosar||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -275,3 +275,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Назад|Вперед|Вверх|Поиск|Папки|Переместить в|Копировать в|Удалить|Отменить|Вид|Остановить|Обновить|Домой|Подключить диск|Отключить|Избранное|Журнал|Во весь экран|Свойства|Вырезать|Копировать|Вставить|Свойства папки||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -292,3 +292,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Back|Forward|Up|Search|Folders|Move To|Copy To|Delete|Undo|Views|Stop|Refresh|Home|Map Drive|Disconnect|Favorites|History|Full Screen|Properties|Cut|Copy|Paste|Folder Options||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -273,3 +273,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Back|Forward|Up|Search|Folders|Move To|Copy To|Delete|Undo|Views|Stop|Refresh|Home|Map Drive|Disconnect|Favorites|History|Full Screen|Properties|Cut|Copy|Paste|Folder Options||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -275,3 +275,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|Back|Forward|Up|Search|Folders|Move To|Copy To|Delete|Undo|Views|Stop|Refresh|Home|Map Drive|Disconnect|Favorites|History|Full Screen|Properties|Cut|Copy|Paste|Folder Options||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -293,3 +293,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|返回|前进|向上|搜索|文件夹|移动到|复制到|删除|撤消|视图|停止|刷新|首页|映射磁盘|断开连接|收藏夹|历史|全屏幕|属性|剪下|复制|贴下|文件夹选项||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -293,3 +293,10 @@ STRINGTABLE
BEGIN
IDS_STANDARD_TOOLBAR, "|返回|前進|向上|搜索|資料夾|移動到|複製到|刪除|撤消|檢視|停止|重新整理|首頁|對映磁碟|斷開連線|收藏夾|歷史|全螢幕|屬性|剪下|複製|貼下|資料夾選項||"
END
STRINGTABLE
BEGIN
IDS_LEGAL_URL, "https://www.reactos.org/joining/faqs"
IDS_SORRY_CAPTION, "Sorry"
IDS_SORRY_MESSAGE, "ReactOS could not browse to '%s' (error 0x%lx).\nPlease make sure there is a web browser installed."
END

View File

@@ -93,6 +93,7 @@
#define IDR_AUTOCOMPLETE 141
#define IDR_ACLISTISF 142
#define IDS_LEGAL_URL 12299
#define IDS_SMALLICONS 12301
#define IDS_LARGEICONS 12302
#define IDS_SHOWTEXTLABELS 12303
@@ -105,6 +106,8 @@
#define IDS_ADDRESSBANDLABEL 12902
#define IDS_FOLDERSLABEL 12919
#define IDS_HISTORYTEXT 13169
#define IDS_SORRY_CAPTION 14001
#define IDS_SORRY_MESSAGE 14002
#define IDS_UP 58434
#define IDS_BACK 58689
#define IDS_FORWARD 58690

View File

@@ -3619,26 +3619,34 @@ LRESULT CShellBrowser::OnOrganizeFavorites(WORD wNotifyCode, WORD wID, HWND hWnd
LRESULT CShellBrowser::OnIsThisLegal(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
{
/* TODO: Implement properly */
WCHAR wszSite[256];
HINSTANCE hResourceInstance = _AtlBaseModule.GetResourceInstance();
LPCWSTR strSite = L"https://www.reactos.org/user-faq";
if (!LoadStringW(hResourceInstance, IDS_LEGAL_URL, wszSite, _countof(wszSite)))
StringCchCopyW(wszSite, _countof(wszSite), L"https://www.reactos.org/joining/faqs");
/* TODO: Make localizable */
LPCWSTR strCaption = L"Sorry";
LPCWSTR strMessage = L"ReactOS could not browse to '%s' (error %d). Please make sure there is a web browser installed.";
WCHAR tmpMessage[512];
SHELLEXECUTEINFOW execInfo = { sizeof(execInfo), 0 };
execInfo.lpVerb = L"open";
execInfo.lpFile = wszSite;
execInfo.hwnd = m_hWnd;
execInfo.nShow = SW_SHOWNORMAL;
/* TODO: Read from the registry */
LPCWSTR strVerb = NULL; /* default */
LPCWSTR strPath = strSite;
LPCWSTR strParams = NULL;
/* The return value is defined as HINSTANCE for backwards compatibility only, the cast is needed */
int result = (int) ShellExecuteW(m_hWnd, strVerb, strPath, strParams, NULL, SW_SHOWNORMAL);
if (result <= 32)
if (!ShellExecuteExW(&execInfo))
{
StringCchPrintfW(tmpMessage, 512, strMessage, strSite, result);
MessageBoxExW(m_hWnd, tmpMessage, strCaption, MB_OK, 0);
WCHAR wszCaption[256];
WCHAR wszMessage[512];
DWORD error = GetLastError();
if (!LoadStringW(hResourceInstance, IDS_SORRY_MESSAGE, wszCaption, _countof(wszCaption)))
StringCchCopyW(wszCaption, _countof(wszCaption), L"ReactOS could not browse to '%s' (error 0x%lx). Please make sure there is a web browser installed.");
StringCchPrintfW(wszMessage, _countof(wszMessage), wszCaption, wszSite, error);
if (!LoadStringW(hResourceInstance, IDS_SORRY_CAPTION, wszCaption, _countof(wszCaption)))
StringCchCopyW(wszCaption, _countof(wszCaption), L"Sorry");
MessageBoxW(wszMessage, wszCaption, MB_OK);
}
return 0;

View File

@@ -1577,11 +1577,13 @@ cleanup:
if ( hinf != INVALID_HANDLE_VALUE )
SetupCloseInfFile( hinf );
#ifdef CORE_11689_IS_FIXED
// TODO: Localize the error string.
if (!ret && !(GlobalSetupFlags & PSPGF_NONINTERACTIVE))
{
MessageBoxW(hwnd, section, L"setupapi.dll: An error happened...", MB_ICONERROR | MB_OK);
}
#endif
}

View File

@@ -1332,12 +1332,18 @@ HRESULT WINAPI CShellLink::SetDescription(LPCWSTR pszName)
TRACE("(%p)->(desc=%s)\n", this, debugstr_w(pszName));
HeapFree(GetProcessHeap(), 0, sDescription);
sDescription = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
(wcslen(pszName) + 1) * sizeof(WCHAR));
if (!sDescription)
return E_OUTOFMEMORY;
if (pszName)
{
sDescription = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
(wcslen(pszName) + 1) * sizeof(WCHAR));
if (!sDescription)
return E_OUTOFMEMORY;
wcscpy(sDescription, pszName);
}
else
sDescription = NULL;
wcscpy(sDescription, pszName);
bDirty = TRUE;
return S_OK;
@@ -1360,11 +1366,17 @@ HRESULT WINAPI CShellLink::SetWorkingDirectory(LPCWSTR pszDir)
TRACE("(%p)->(dir=%s)\n", this, debugstr_w(pszDir));
HeapFree(GetProcessHeap(), 0, sWorkDir);
sWorkDir = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
(wcslen(pszDir) + 1) * sizeof (WCHAR));
if (!sWorkDir)
return E_OUTOFMEMORY;
wcscpy(sWorkDir, pszDir);
if (pszDir)
{
sWorkDir = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
(wcslen(pszDir) + 1) * sizeof (WCHAR));
if (!sWorkDir)
return E_OUTOFMEMORY;
wcscpy(sWorkDir, pszDir);
}
else
sWorkDir = NULL;
bDirty = TRUE;
return S_OK;
@@ -1387,12 +1399,18 @@ HRESULT WINAPI CShellLink::SetArguments(LPCWSTR pszArgs)
TRACE("(%p)->(args=%s)\n", this, debugstr_w(pszArgs));
HeapFree(GetProcessHeap(), 0, sArgs);
sArgs = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
(wcslen(pszArgs) + 1) * sizeof (WCHAR));
if (!sArgs)
return E_OUTOFMEMORY;
if (pszArgs)
{
sArgs = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
(wcslen(pszArgs) + 1) * sizeof (WCHAR));
if (!sArgs)
return E_OUTOFMEMORY;
wcscpy(sArgs, pszArgs);
}
else
sArgs = NULL;
wcscpy(sArgs, pszArgs);
bDirty = TRUE;
return S_OK;
@@ -1473,11 +1491,16 @@ HRESULT WINAPI CShellLink::SetIconLocation(LPCWSTR pszIconPath, INT iIcon)
TRACE("(%p)->(path=%s iicon=%u)\n", this, debugstr_w(pszIconPath), iIcon);
HeapFree(GetProcessHeap(), 0, sIcoPath);
sIcoPath = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
(wcslen(pszIconPath) + 1) * sizeof (WCHAR));
if (!sIcoPath)
return E_OUTOFMEMORY;
wcscpy(sIcoPath, pszIconPath);
if (pszIconPath)
{
sIcoPath = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
(wcslen(pszIconPath) + 1) * sizeof (WCHAR));
if (!sIcoPath)
return E_OUTOFMEMORY;
wcscpy(sIcoPath, pszIconPath);
}
else
sIcoPath = NULL;
iIcoNdx = iIcon;
bDirty = TRUE;
@@ -1490,11 +1513,17 @@ HRESULT WINAPI CShellLink::SetRelativePath(LPCWSTR pszPathRel, DWORD dwReserved)
TRACE("(%p)->(path=%s %x)\n", this, debugstr_w(pszPathRel), dwReserved);
HeapFree(GetProcessHeap(), 0, sPathRel);
sPathRel = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
(wcslen(pszPathRel) + 1) * sizeof (WCHAR));
if (!sPathRel)
return E_OUTOFMEMORY;
wcscpy(sPathRel, pszPathRel);
if (pszPathRel)
{
sPathRel = (LPWSTR)HeapAlloc(GetProcessHeap(), 0,
(wcslen(pszPathRel) + 1) * sizeof (WCHAR));
if (!sPathRel)
return E_OUTOFMEMORY;
wcscpy(sPathRel, pszPathRel);
}
else
sPathRel = NULL;
bDirty = TRUE;
return ShellLink_UpdatePath(sPathRel, sPath, sWorkDir, &sPath);

View File

@@ -1236,6 +1236,11 @@ HRESULT WINAPI CFSFolder::Drop(IDataObject *pDataObject,
{
TRACE("(%p) object dropped, effect %u\n", this, *pdwEffect);
if (!pdwEffect)
return E_INVALIDARG;
QueryDrop(dwKeyState, pdwEffect);
BOOL fIsOpAsync = FALSE;
CComPtr<IAsyncOperation> pAsyncOperation;

View File

@@ -147,7 +147,10 @@ NtfsReadFile(PDEVICE_EXTENSION DeviceExt,
RealLength = ROUND_UP(ToRead, DeviceExt->NtfsInfo.BytesPerSector);
/* do we need to extend RealLength by one sector? */
if (RealLength + RealReadOffset < ReadOffset + Length)
RealLength += DeviceExt->NtfsInfo.BytesPerSector;
{
if (RealReadOffset + RealLength + DeviceExt->NtfsInfo.BytesPerSector <= AttributeAllocatedLength(&DataContext->Record))
RealLength += DeviceExt->NtfsInfo.BytesPerSector;
}
ReadBuffer = ExAllocatePoolWithTag(NonPagedPool, RealLength, TAG_NTFS);

View File

@@ -601,6 +601,7 @@ CUSBRequest::InitDescriptor(
//
// get address
//
*(volatile char *)TransferBuffer; // HACK for CORE-9224
Address = MmGetPhysicalAddress(TransferBuffer);
//

View File

@@ -771,6 +771,7 @@ CUSBRequest::BuildIsochronousEndpoint(
//
// get physical page
//
*(volatile char *)Buffer; // HACK for CORE-9224
Page = MmGetPhysicalAddress(Buffer).LowPart;
//
@@ -1087,6 +1088,7 @@ CUSBRequest::InitDescriptor(
//
// store physical address of buffer
//
*(volatile char *)TransferBuffer; // HACK for CORE-9224
CurrentDescriptor->BufferPhysical = MmGetPhysicalAddress(TransferBuffer).LowPart;
CurrentDescriptor->LastPhysicalByteAddress = CurrentDescriptor->BufferPhysical + TransferBufferLength - 1;
@@ -1503,6 +1505,7 @@ CUSBRequest::BuildControlTransferDescriptor(
//
// store physical address of buffer
//
*(volatile char *)MmGetMdlVirtualAddress(m_TransferBufferMDL); // HACK for CORE-9224
DataDescriptor->BufferPhysical = MmGetPhysicalAddress(MmGetMdlVirtualAddress(m_TransferBufferMDL)).LowPart;
DataDescriptor->LastPhysicalByteAddress = DataDescriptor->BufferPhysical + m_TransferBufferLength - 1;

View File

@@ -35,6 +35,7 @@ HKR, , Icon, 0, "-27"
%*PNP0A00.DeviceDesc% = PCI_ISA_Inst,*PNP0A00
%*PNP0A03.DeviceDesc% = PCI_Inst,*PNP0A03
%*PNP0A05.DeviceDesc% = NO_DRV,*PNP0A05
%*PNP0A06.DeviceDesc% = NO_DRV,*PNP0A06
%*PNP0A08.DeviceDesc% = PCI_Inst,*PNP0A08
%*PNP0B00.DeviceDesc% = NO_DRV,*PNP0B00
%*PNP0C01.DeviceDesc% = NO_DRV,*PNP0C01
@@ -156,6 +157,7 @@ GenericMfg = "(Generic system devices)"
*PNP0A00.DeviceDesc = "ISA bus"
*PNP0A03.DeviceDesc = "PCI bus"
*PNP0A05.DeviceDesc = "Generic ACPI bus"
*PNP0A06.DeviceDesc = "Extended I/O Bus / Generic container Device"
*PNP0A08.DeviceDesc = "PCI bus"
*PNP0B00.DeviceDesc = "AT real-time clock"
*PNP0C01.DeviceDesc = "System board"

View File

@@ -17,12 +17,12 @@ endmacro()
string(TIMESTAMP KERNEL_VERSION_BUILD %Y%m%d UTC)
set(KERNEL_VERSION_MAJOR "0")
set(KERNEL_VERSION_MINOR "5")
set(KERNEL_VERSION_PATCH_LEVEL "0")
set(KERNEL_VERSION_MINOR "4")
set(KERNEL_VERSION_PATCH_LEVEL "2")
set(COPYRIGHT_YEAR "2016")
# KERNEL_VERSION_BUILD_TYPE is "SVN" or "" (for the release)
set(KERNEL_VERSION_BUILD_TYPE "SVN")
set(KERNEL_VERSION_BUILD_TYPE "")
# KERNEL_VERSION_RELEASE_TYPE is "RC1", "RC2" or "" (for the final one)
set(KERNEL_VERSION_RELEASE_TYPE "")

View File

@@ -17,7 +17,7 @@
#include "asmxtras.inc"
#include <isvbop.inc>
// #define NDEBUG
#define NDEBUG
/* DEFINES ********************************************************************/

View File

@@ -30,6 +30,132 @@ InitDeviceImpl(VOID)
return STATUS_SUCCESS;
}
BOOLEAN
EngpPopulateDeviceModeList(
_Inout_ PGRAPHICS_DEVICE pGraphicsDevice,
_In_ PDEVMODEW pdmDefault)
{
PWSTR pwsz;
PLDEVOBJ pldev;
PDEVMODEINFO pdminfo;
PDEVMODEW pdm, pdmEnd;
ULONG i, cModes = 0;
BOOLEAN bModeMatch = FALSE;
ASSERT(pGraphicsDevice->pdevmodeInfo == NULL);
ASSERT(pGraphicsDevice->pDevModeList == NULL);
pwsz = pGraphicsDevice->pDiplayDrivers;
/* Loop through the driver names
* This is a REG_MULTI_SZ string */
for (; *pwsz; pwsz += wcslen(pwsz) + 1)
{
TRACE("trying driver: %ls\n", pwsz);
/* Try to load the display driver */
pldev = EngLoadImageEx(pwsz, LDEV_DEVICE_DISPLAY);
if (!pldev)
{
ERR("Could not load driver: '%ls'\n", pwsz);
continue;
}
/* Get the mode list from the driver */
pdminfo = LDEVOBJ_pdmiGetModes(pldev, pGraphicsDevice->DeviceObject);
if (!pdminfo)
{
ERR("Could not get mode list for '%ls'\n", pwsz);
continue;
}
/* Attach the mode info to the device */
pdminfo->pdmiNext = pGraphicsDevice->pdevmodeInfo;
pGraphicsDevice->pdevmodeInfo = pdminfo;
/* Loop all DEVMODEs */
pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
for (pdm = pdminfo->adevmode;
(pdm + 1 <= pdmEnd) && (pdm->dmSize != 0);
pdm = (DEVMODEW*)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
{
/* Count this DEVMODE */
cModes++;
/* Some drivers like the VBox driver don't fill the dmDeviceName
with the name of the display driver. So fix that here. */
wcsncpy(pdm->dmDeviceName, pwsz, CCHDEVICENAME);
pdm->dmDeviceName[CCHDEVICENAME - 1] = 0;
}
// FIXME: release the driver again until it's used?
}
if (!pGraphicsDevice->pdevmodeInfo || cModes == 0)
{
ERR("No devmodes\n");
return FALSE;
}
/* Allocate an index buffer */
pGraphicsDevice->cDevModes = cModes;
pGraphicsDevice->pDevModeList = ExAllocatePoolWithTag(PagedPool,
cModes * sizeof(DEVMODEENTRY),
GDITAG_GDEVICE);
if (!pGraphicsDevice->pDevModeList)
{
ERR("No devmode list\n");
return FALSE;
}
TRACE("Looking for mode %lux%lux%lu(%lu Hz)\n",
pdmDefault->dmPelsWidth,
pdmDefault->dmPelsHeight,
pdmDefault->dmBitsPerPel,
pdmDefault->dmDisplayFrequency);
/* Loop through all DEVMODEINFOs */
for (pdminfo = pGraphicsDevice->pdevmodeInfo, i = 0;
pdminfo;
pdminfo = pdminfo->pdmiNext)
{
/* Calculate End of the DEVMODEs */
pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
/* Loop through the DEVMODEs */
for (pdm = pdminfo->adevmode;
(pdm + 1 <= pdmEnd) && (pdm->dmSize != 0);
pdm = (PDEVMODEW)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
{
TRACE(" %S has mode %lux%lux%lu(%lu Hz)\n",
pdm->dmDeviceName,
pdm->dmPelsWidth,
pdm->dmPelsHeight,
pdm->dmBitsPerPel,
pdm->dmDisplayFrequency);
/* Compare with the default entry */
if (!bModeMatch &&
pdm->dmBitsPerPel == pdmDefault->dmBitsPerPel &&
pdm->dmPelsWidth == pdmDefault->dmPelsWidth &&
pdm->dmPelsHeight == pdmDefault->dmPelsHeight)
{
pGraphicsDevice->iDefaultMode = i;
pGraphicsDevice->iCurrentMode = i;
TRACE("Found default entry: %lu '%ls'\n", i, pdm->dmDeviceName);
if (pdm->dmDisplayFrequency == pdmDefault->dmDisplayFrequency)
{
/* Uh oh, even the display frequency matches. */
bModeMatch = TRUE;
}
}
/* Initialize the entry */
pGraphicsDevice->pDevModeList[i].dwFlags = 0;
pGraphicsDevice->pDevModeList[i].pdm = pdm;
i++;
}
}
return TRUE;
}
PGRAPHICS_DEVICE
NTAPI
@@ -44,13 +170,9 @@ EngpRegisterGraphicsDevice(
PFILE_OBJECT pFileObject;
NTSTATUS Status;
PWSTR pwsz;
ULONG i, cj, cModes = 0;
ULONG cj;
SIZE_T cjWritten;
BOOL bEnable = TRUE;
PDEVMODEINFO pdminfo;
PDEVMODEW pdm, pdmEnd;
PLDEVOBJ pldev;
BOOLEAN bModeMatch = FALSE;
TRACE("EngpRegisterGraphicsDevice(%wZ)\n", pustrDeviceName);
@@ -124,116 +246,14 @@ EngpRegisterGraphicsDevice(
// FIXME: initialize state flags
pGraphicsDevice->StateFlags = 0;
/* Loop through the driver names
* This is a REG_MULTI_SZ string */
for (; *pwsz; pwsz += wcslen(pwsz) + 1)
/* Create the mode list */
pGraphicsDevice->pDevModeList = NULL;
if (!EngpPopulateDeviceModeList(pGraphicsDevice, pdmDefault))
{
TRACE("trying driver: %ls\n", pwsz);
/* Try to load the display driver */
pldev = EngLoadImageEx(pwsz, LDEV_DEVICE_DISPLAY);
if (!pldev)
{
ERR("Could not load driver: '%ls'\n", pwsz);
continue;
}
/* Get the mode list from the driver */
pdminfo = LDEVOBJ_pdmiGetModes(pldev, pDeviceObject);
if (!pdminfo)
{
ERR("Could not get mode list for '%ls'\n", pwsz);
continue;
}
/* Attach the mode info to the device */
pdminfo->pdmiNext = pGraphicsDevice->pdevmodeInfo;
pGraphicsDevice->pdevmodeInfo = pdminfo;
/* Loop all DEVMODEs */
pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
for (pdm = pdminfo->adevmode;
(pdm + 1 <= pdmEnd) && (pdm->dmSize != 0);
pdm = (DEVMODEW*)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
{
/* Count this DEVMODE */
cModes++;
/* Some drivers like the VBox driver don't fill the dmDeviceName
with the name of the display driver. So fix that here. */
wcsncpy(pdm->dmDeviceName, pwsz, CCHDEVICENAME);
pdm->dmDeviceName[CCHDEVICENAME - 1] = 0;
}
// FIXME: release the driver again until it's used?
}
if (!pGraphicsDevice->pdevmodeInfo || cModes == 0)
{
ERR("No devmodes\n");
ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE);
return NULL;
}
/* Allocate an index buffer */
pGraphicsDevice->cDevModes = cModes;
pGraphicsDevice->pDevModeList = ExAllocatePoolWithTag(PagedPool,
cModes * sizeof(DEVMODEENTRY),
GDITAG_GDEVICE);
if (!pGraphicsDevice->pDevModeList)
{
ERR("No devmode list\n");
ExFreePoolWithTag(pGraphicsDevice, GDITAG_GDEVICE);
return NULL;
}
TRACE("Looking for mode %lux%lux%lu(%lu Hz)\n",
pdmDefault->dmPelsWidth,
pdmDefault->dmPelsHeight,
pdmDefault->dmBitsPerPel,
pdmDefault->dmDisplayFrequency);
/* Loop through all DEVMODEINFOs */
for (pdminfo = pGraphicsDevice->pdevmodeInfo, i = 0;
pdminfo;
pdminfo = pdminfo->pdmiNext)
{
/* Calculate End of the DEVMODEs */
pdmEnd = (DEVMODEW*)((PCHAR)pdminfo->adevmode + pdminfo->cbdevmode);
/* Loop through the DEVMODEs */
for (pdm = pdminfo->adevmode;
(pdm + 1 <= pdmEnd) && (pdm->dmSize != 0);
pdm = (PDEVMODEW)((PCHAR)pdm + pdm->dmSize + pdm->dmDriverExtra))
{
TRACE(" %S has mode %lux%lux%lu(%lu Hz)\n",
pdm->dmDeviceName,
pdm->dmPelsWidth,
pdm->dmPelsHeight,
pdm->dmBitsPerPel,
pdm->dmDisplayFrequency);
/* Compare with the default entry */
if (!bModeMatch &&
pdm->dmBitsPerPel == pdmDefault->dmBitsPerPel &&
pdm->dmPelsWidth == pdmDefault->dmPelsWidth &&
pdm->dmPelsHeight == pdmDefault->dmPelsHeight)
{
pGraphicsDevice->iDefaultMode = i;
pGraphicsDevice->iCurrentMode = i;
TRACE("Found default entry: %lu '%ls'\n", i, pdm->dmDeviceName);
if (pdm->dmDisplayFrequency == pdmDefault->dmDisplayFrequency)
{
/* Uh oh, even the display frequency matches. */
bModeMatch = TRUE;
}
}
/* Initialize the entry */
pGraphicsDevice->pDevModeList[i].dwFlags = 0;
pGraphicsDevice->pDevModeList[i].pdm = pdm;
i++;
}
}
/* Lock loader */
EngAcquireSemaphore(ghsemGraphicsDeviceList);
@@ -250,7 +270,7 @@ EngpRegisterGraphicsDevice(
/* Unlock loader */
EngReleaseSemaphore(ghsemGraphicsDeviceList);
TRACE("Prepared %lu modes for %ls\n", cModes, pGraphicsDevice->pwszDescription);
TRACE("Prepared %lu modes for %ls\n", pGraphicsDevice->cDevModes, pGraphicsDevice->pwszDescription);
return pGraphicsDevice;
}

View File

@@ -3,6 +3,11 @@
#define TAG_GDEV 'gdev'
VOID
NTAPI
PDEVOBJ_vRefreshModeList(
PPDEVOBJ ppdev);
extern PGRAPHICS_DEVICE gpPrimaryGraphicsDevice;
extern PGRAPHICS_DEVICE gpVgaGraphicsDevice;
@@ -29,6 +34,11 @@ EngpRegisterGraphicsDevice(
_In_ PUNICODE_STRING pustrDescription,
_In_ PDEVMODEW pdmDefault);
BOOLEAN
EngpPopulateDeviceModeList(
_Inout_ PGRAPHICS_DEVICE pGraphicsDevice,
_In_ PDEVMODEW pdmDefault);
INIT_FUNCTION
NTSTATUS
NTAPI

View File

@@ -251,6 +251,45 @@ PDEVOBJ_pSurface(
return ppdev->pSurface;
}
VOID
NTAPI
PDEVOBJ_vRefreshModeList(
PPDEVOBJ ppdev)
{
PGRAPHICS_DEVICE pGraphicsDevice;
PDEVMODEINFO pdminfo, pdmiNext;
DEVMODEW dmDefault;
/* Lock the PDEV */
EngAcquireSemaphore(ppdev->hsemDevLock);
pGraphicsDevice = ppdev->pGraphicsDevice;
/* Remember our default mode */
dmDefault = *pGraphicsDevice->pDevModeList[pGraphicsDevice->iDefaultMode].pdm;
/* Clear out the modes */
for (pdminfo = pGraphicsDevice->pdevmodeInfo;
pdminfo;
pdminfo = pdmiNext)
{
pdmiNext = pdminfo->pdmiNext;
ExFreePoolWithTag(pdminfo, GDITAG_DEVMODE);
}
pGraphicsDevice->pdevmodeInfo = NULL;
ExFreePoolWithTag(pGraphicsDevice->pDevModeList, GDITAG_GDEVICE);
pGraphicsDevice->pDevModeList = NULL;
/* Now re-populate the list */
if (!EngpPopulateDeviceModeList(pGraphicsDevice, &dmDefault))
{
DPRINT1("FIXME: EngpPopulateDeviceModeList failed, we just destroyed a perfectly good mode list\n");
}
/* Unlock PDEV */
EngReleaseSemaphore(ppdev->hsemDevLock);
}
PDEVMODEW
NTAPI
PDEVOBJ_pdmMatchDevMode(

View File

@@ -267,8 +267,11 @@ IntDestroyClass(IN OUT PCLS Class)
if (Class->spicn)
UserDereferenceObject(Class->spicn);
if (Class->spcur)
if (Class->spcur && !UserObjectInDestroy(Class->spcur))
{
UserDereferenceObject(Class->spcur);
Class->spcur = NULL;
}
if (Class->spicnSm)
{
UserDereferenceObject(Class->spicnSm);

View File

@@ -1086,11 +1086,14 @@ NtUserSetCursor(
goto leave;
}
pcurOld->CURSORF_flags &= ~CURSORF_CURRENT;
/* See if it was destroyed in the meantime */
if (UserObjectInDestroy(hOldCursor))
hOldCursor = NULL;
pcurOld->CURSORF_flags &= ~CURSORF_CURRENT;
UserDereferenceObject(pcurOld);
{
UserDereferenceObject(pcurOld);
pcurOld = NULL;
}
}
leave:

View File

@@ -463,22 +463,34 @@ UserEnumDisplaySettings(
PGRAPHICS_DEVICE pGraphicsDevice;
PDEVMODEENTRY pdmentry;
ULONG i, iFoundMode;
PPDEVOBJ ppdev;
TRACE("Enter UserEnumDisplaySettings('%wZ', %lu)\n",
pustrDevice, iModeNum);
/* Ask GDI for the GRAPHICS_DEVICE */
pGraphicsDevice = EngpFindGraphicsDevice(pustrDevice, 0, 0);
ppdev = EngpGetPDEV(pustrDevice);
if (!pGraphicsDevice)
if (!pGraphicsDevice || !ppdev)
{
/* No device found */
ERR("No device found!\n");
return STATUS_UNSUCCESSFUL;
}
/* let's politely ask the driver for an updated mode list,
just in case there's something new in there (vbox) */
PDEVOBJ_vRefreshModeList(ppdev);
PDEVOBJ_vRelease(ppdev);
/* FIXME: maybe only refresh when iModeNum is bigger than cDevModes? */
if (iModeNum >= pGraphicsDevice->cDevModes)
{
ERR("STATUS_NO_MORE_ENTRIES!\n");
return STATUS_NO_MORE_ENTRIES;
}
iFoundMode = 0;
for (i = 0; i < pGraphicsDevice->cDevModes; i++)

View File

@@ -2288,8 +2288,12 @@ MsqCleanupMessageQueue(PTHREADINFO pti)
IntGetSysCursorInfo()->CurrentCursorObject = NULL;
}
TRACE("DereferenceObject pCursor\n");
UserDereferenceObject(pCursor);
if (pCursor && UserObjectInDestroy(UserHMGetHandle(pCursor)))
{
TRACE("DereferenceObject pCursor\n");
UserDereferenceObject(pCursor);
pCursor = NULL;
}
}
if (gpqForeground == MessageQueue)

View File

@@ -179,11 +179,7 @@ GetScreenBufferSizeUnits(IN PCONSOLE_SCREEN_BUFFER Buffer,
OUT PUINT WidthUnit,
OUT PUINT HeightUnit)
{
if (Buffer == NULL || GuiData == NULL ||
WidthUnit == NULL || HeightUnit == NULL)
{
return;
}
ASSERT(Buffer && GuiData && WidthUnit && HeightUnit);
if (GetType(Buffer) == TEXTMODE_BUFFER)
{
@@ -449,7 +445,7 @@ ResizeConWnd(PGUI_CONSOLE_DATA GuiData, DWORD WidthUnit, DWORD HeightUnit)
2 * (GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYEDGE)) + GetSystemMetrics(SM_CYCAPTION);
/* Set scrollbar sizes */
sInfo.cbSize = sizeof(SCROLLINFO);
sInfo.cbSize = sizeof(sInfo);
sInfo.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
sInfo.nMin = 0;
if (Buff->ScreenBufferSize.Y > Buff->ViewSize.Y)
@@ -937,6 +933,8 @@ UpdateSelection(PGUI_CONSOLE_DATA GuiData,
if (SelectionAnchor)
GuiData->Selection.dwSelectionAnchor = *SelectionAnchor;
// TODO: Scroll buffer to bring 'coord' into view
if (coord != NULL)
{
SMALL_RECT rc;
@@ -947,7 +945,7 @@ UpdateSelection(PGUI_CONSOLE_DATA GuiData,
* into line-selection mode, the selection mode of *nix terminals.
*/
BOOL OldLineSel = GuiData->LineSelection;
GuiData->LineSelection = !!(GetKeyState(VK_CONTROL) & 0x8000);
GuiData->LineSelection = !!(GetKeyState(VK_CONTROL) & KEY_PRESSED);
/* Exchange left/top with right/bottom if required */
rc.Left = min(GuiData->Selection.dwSelectionAnchor.X, coord->X);
@@ -1179,7 +1177,7 @@ OnKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
goto Quit;
}
else if ( VirtualKeyCode == VK_ESCAPE ||
(VirtualKeyCode == 'C' && (GetKeyState(VK_CONTROL) & 0x8000)) )
(VirtualKeyCode == 'C' && (GetKeyState(VK_CONTROL) & KEY_PRESSED)) )
{
/* Cancel selection if ESC or Ctrl-C are pressed */
UpdateSelection(GuiData, NULL, NULL);
@@ -1190,7 +1188,7 @@ OnKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
{
/* Keyboard selection mode */
BOOL Interpreted = FALSE;
BOOL MajPressed = !!(GetKeyState(VK_SHIFT) & 0x8000);
BOOL MajPressed = !!(GetKeyState(VK_SHIFT) & KEY_PRESSED);
switch (VirtualKeyCode)
{
@@ -1348,7 +1346,7 @@ OnTimer(PGUI_CONSOLE_DATA GuiData)
int OldScrollX = -1, OldScrollY = -1;
int NewScrollX = -1, NewScrollY = -1;
xScroll.cbSize = sizeof(SCROLLINFO);
xScroll.cbSize = sizeof(xScroll);
xScroll.fMask = SIF_POS;
// Capture the original position of the scroll bars and save them.
if (GetScrollInfo(GuiData->hWindow, SB_HORZ, &xScroll)) OldScrollX = xScroll.nPos;
@@ -1475,6 +1473,114 @@ OnNcDestroy(HWND hWnd)
return DefWindowProcW(hWnd, WM_NCDESTROY, 0, 0);
}
static VOID
OnScroll(PGUI_CONSOLE_DATA GuiData, INT nBar, WORD sbCode)
{
PCONSRV_CONSOLE Console = GuiData->Console;
PCONSOLE_SCREEN_BUFFER Buff;
SCROLLINFO sInfo;
INT oldPos, Maximum;
PSHORT pOriginXY;
ASSERT(nBar == SB_HORZ || nBar == SB_VERT);
if (!ConDrvValidateConsoleUnsafe((PCONSOLE)Console, CONSOLE_RUNNING, TRUE)) return;
Buff = GuiData->ActiveBuffer;
if (nBar == SB_HORZ)
{
Maximum = Buff->ScreenBufferSize.X - Buff->ViewSize.X;
pOriginXY = &Buff->ViewOrigin.X;
}
else // if (nBar == SB_VERT)
{
Maximum = Buff->ScreenBufferSize.Y - Buff->ViewSize.Y;
pOriginXY = &Buff->ViewOrigin.Y;
}
/* Set scrollbar sizes */
sInfo.cbSize = sizeof(sInfo);
sInfo.fMask = SIF_RANGE | SIF_POS | SIF_PAGE | SIF_TRACKPOS;
if (!GetScrollInfo(GuiData->hWindow, nBar, &sInfo)) goto Quit;
oldPos = sInfo.nPos;
switch (sbCode)
{
case SB_LINEUP: // SB_LINELEFT:
sInfo.nPos--;
break;
case SB_LINEDOWN: // SB_LINERIGHT:
sInfo.nPos++;
break;
case SB_PAGEUP: // SB_PAGELEFT:
sInfo.nPos -= sInfo.nPage;
break;
case SB_PAGEDOWN: // SB_PAGERIGHT:
sInfo.nPos += sInfo.nPage;
break;
case SB_THUMBTRACK:
sInfo.nPos = sInfo.nTrackPos;
ConioPause(Console, PAUSED_FROM_SCROLLBAR);
break;
case SB_THUMBPOSITION:
sInfo.nPos = sInfo.nTrackPos;
ConioUnpause(Console, PAUSED_FROM_SCROLLBAR);
break;
case SB_TOP: // SB_LEFT:
sInfo.nPos = sInfo.nMin;
break;
case SB_BOTTOM: // SB_RIGHT:
sInfo.nPos = sInfo.nMax;
break;
default:
break;
}
sInfo.nPos = min(max(sInfo.nPos, 0), Maximum);
if (oldPos != sInfo.nPos)
{
USHORT OldX = Buff->ViewOrigin.X;
USHORT OldY = Buff->ViewOrigin.Y;
UINT WidthUnit, HeightUnit;
/* We now modify either Buff->ViewOrigin.X or Buff->ViewOrigin.Y */
*pOriginXY = sInfo.nPos;
GetScreenBufferSizeUnits(Buff, GuiData, &WidthUnit, &HeightUnit);
ScrollWindowEx(GuiData->hWindow,
(OldX - Buff->ViewOrigin.X) * WidthUnit ,
(OldY - Buff->ViewOrigin.Y) * HeightUnit,
NULL,
NULL,
NULL,
NULL,
SW_INVALIDATE);
sInfo.fMask = SIF_POS;
SetScrollInfo(GuiData->hWindow, nBar, &sInfo, TRUE);
UpdateWindow(GuiData->hWindow);
// InvalidateRect(GuiData->hWindow, NULL, FALSE);
}
Quit:
LeaveCriticalSection(&Console->Lock);
return;
}
static COORD
PointToCoord(PGUI_CONSOLE_DATA GuiData, LPARAM lParam)
{
@@ -1504,7 +1610,7 @@ PointToCoord(PGUI_CONSOLE_DATA GuiData, LPARAM lParam)
static LRESULT
OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
{
BOOL Err = FALSE;
BOOL DoDefault = FALSE;
PCONSRV_CONSOLE Console = GuiData->Console;
/*
@@ -1545,14 +1651,14 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
* This mouse signal is a button-down action.
* Ignore it and perform default action.
*/
Err = TRUE;
DoDefault = TRUE;
}
goto Quit;
}
if (!ConDrvValidateConsoleUnsafe((PCONSOLE)Console, CONSOLE_RUNNING, TRUE))
{
Err = TRUE;
DoDefault = TRUE;
goto Quit;
}
@@ -1563,16 +1669,32 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
{
case WM_LBUTTONDOWN:
{
/* Clear the old selection */
GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION;
/* Check for selection state */
if ( (GuiData->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) &&
(GuiData->Selection.dwFlags & CONSOLE_MOUSE_SELECTION) &&
(GetKeyState(VK_SHIFT) & KEY_PRESSED) )
{
/*
* A mouse selection is currently in progress and the user
* has pressed the SHIFT key and clicked somewhere, update
* the selection.
*/
GuiData->dwSelectionCursor = PointToCoord(GuiData, lParam);
UpdateSelection(GuiData, NULL, &GuiData->dwSelectionCursor);
}
else
{
/* Clear the old selection */
GuiData->Selection.dwFlags = CONSOLE_NO_SELECTION;
/* Restart a new selection */
GuiData->dwSelectionCursor = PointToCoord(GuiData, lParam);
SetCapture(GuiData->hWindow);
GuiData->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN;
UpdateSelection(GuiData,
&GuiData->dwSelectionCursor,
&GuiData->dwSelectionCursor);
/* Restart a new selection */
GuiData->dwSelectionCursor = PointToCoord(GuiData, lParam);
SetCapture(GuiData->hWindow);
GuiData->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN;
UpdateSelection(GuiData,
&GuiData->dwSelectionCursor,
&GuiData->dwSelectionCursor);
}
break;
}
@@ -1630,6 +1752,7 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
/* Ignore the next mouse move signal */
GuiData->IgnoreNextMouseSignal = TRUE;
#undef IS_WORD_SEP
}
break;
@@ -1654,18 +1777,16 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_MOUSEMOVE:
{
if (!(wParam & MK_LBUTTON)) break;
if (!(GET_KEYSTATE_WPARAM(wParam) & MK_LBUTTON)) break;
if (!(GuiData->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break;
// TODO: Scroll buffer to bring SelectionCursor into view
GuiData->dwSelectionCursor = PointToCoord(GuiData, lParam);
UpdateSelection(GuiData, NULL, &GuiData->dwSelectionCursor);
break;
}
default:
Err = FALSE; // TRUE;
DoDefault = TRUE; // FALSE;
break;
}
}
@@ -1706,7 +1827,7 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
if (wButton & ~(XBUTTON1 | XBUTTON2))
{
DPRINT1("X-button 0x%04x invalid\n", wButton);
Err = TRUE;
DoDefault = TRUE;
break;
}
@@ -1777,7 +1898,7 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
if (wButton & ~(XBUTTON1 | XBUTTON2))
{
DPRINT1("X-button 0x%04x invalid\n", wButton);
Err = TRUE;
DoDefault = TRUE;
break;
}
@@ -1803,7 +1924,7 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
break;
default:
Err = TRUE;
DoDefault = TRUE;
break;
}
@@ -1831,7 +1952,7 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
break;
}
if (!Err)
if (!DoDefault)
{
if (wKeyState & MK_LBUTTON)
dwButtonState |= FROM_LEFT_1ST_BUTTON_PRESSED;
@@ -1844,21 +1965,21 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
if (wKeyState & MK_XBUTTON2)
dwButtonState |= FROM_LEFT_4TH_BUTTON_PRESSED;
if (GetKeyState(VK_RMENU) & 0x8000)
if (GetKeyState(VK_RMENU) & KEY_PRESSED)
dwControlKeyState |= RIGHT_ALT_PRESSED;
if (GetKeyState(VK_LMENU) & 0x8000)
if (GetKeyState(VK_LMENU) & KEY_PRESSED)
dwControlKeyState |= LEFT_ALT_PRESSED;
if (GetKeyState(VK_RCONTROL) & 0x8000)
if (GetKeyState(VK_RCONTROL) & KEY_PRESSED)
dwControlKeyState |= RIGHT_CTRL_PRESSED;
if (GetKeyState(VK_LCONTROL) & 0x8000)
if (GetKeyState(VK_LCONTROL) & KEY_PRESSED)
dwControlKeyState |= LEFT_CTRL_PRESSED;
if (GetKeyState(VK_SHIFT) & 0x8000)
if (GetKeyState(VK_SHIFT) & KEY_PRESSED)
dwControlKeyState |= SHIFT_PRESSED;
if (GetKeyState(VK_NUMLOCK) & 0x0001)
if (GetKeyState(VK_NUMLOCK) & KEY_TOGGLED)
dwControlKeyState |= NUMLOCK_ON;
if (GetKeyState(VK_SCROLL) & 0x0001)
if (GetKeyState(VK_SCROLL) & KEY_TOGGLED)
dwControlKeyState |= SCROLLLOCK_ON;
if (GetKeyState(VK_CAPITAL) & 0x0001)
if (GetKeyState(VK_CAPITAL) & KEY_TOGGLED)
dwControlKeyState |= CAPSLOCK_ON;
/* See WM_CHAR MSDN documentation for instance */
if (lParam & 0x01000000)
@@ -1876,16 +1997,42 @@ OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam)
}
else
{
Err = TRUE;
DoDefault = TRUE;
}
LeaveCriticalSection(&Console->Lock);
Quit:
if (Err)
return DefWindowProcW(GuiData->hWindow, msg, wParam, lParam);
else
if (!DoDefault)
return 0;
if (msg == WM_MOUSEWHEEL || msg == WM_MOUSEHWHEEL)
{
INT nBar;
WORD sbCode;
// WORD wKeyState = GET_KEYSTATE_WPARAM(wParam);
SHORT wDelta = GET_WHEEL_DELTA_WPARAM(wParam);
if (msg == WM_MOUSEWHEEL)
nBar = SB_VERT;
else // if (msg == WM_MOUSEHWHEEL)
nBar = SB_HORZ;
// NOTE: We currently do not support zooming...
// if (wKeyState & MK_CONTROL)
// FIXME: For some reason our win32k does not set the key states
// when sending WM_MOUSEWHEEL or WM_MOUSEHWHEEL ...
// if (wKeyState & MK_SHIFT)
if (GetKeyState(VK_SHIFT) & KEY_PRESSED)
sbCode = (wDelta >= 0 ? SB_PAGEUP : SB_PAGEDOWN);
else
sbCode = (wDelta >= 0 ? SB_LINEUP : SB_LINEDOWN);
OnScroll(GuiData, nBar, sbCode);
}
return DefWindowProcW(GuiData->hWindow, msg, wParam, lParam);
}
VOID
@@ -2001,29 +2148,29 @@ OnSize(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam)
windx = LOWORD(lParam);
windy = HIWORD(lParam);
// Compensate for existing scroll bars (because lParam values do not accommodate scroll bar)
/* Compensate for existing scroll bars (because lParam values do not accommodate scroll bar) */
if (Buff->ViewSize.X < Buff->ScreenBufferSize.X) windy += GetSystemMetrics(SM_CYHSCROLL); // window currently has a horizontal scrollbar
if (Buff->ViewSize.Y < Buff->ScreenBufferSize.Y) windx += GetSystemMetrics(SM_CXVSCROLL); // window currently has a vertical scrollbar
charx = windx / (int)WidthUnit ;
chary = windy / (int)HeightUnit;
// Character alignment (round size up or down)
/* Character alignment (round size up or down) */
if ((windx % WidthUnit ) >= (WidthUnit / 2)) ++charx;
if ((windy % HeightUnit) >= (HeightUnit / 2)) ++chary;
// Compensate for added scroll bars in new window
/* Compensate for added scroll bars in new window */
if (charx < (DWORD)Buff->ScreenBufferSize.X) windy -= GetSystemMetrics(SM_CYHSCROLL); // new window will have a horizontal scroll bar
if (chary < (DWORD)Buff->ScreenBufferSize.Y) windx -= GetSystemMetrics(SM_CXVSCROLL); // new window will have a vertical scroll bar
charx = windx / (int)WidthUnit ;
chary = windy / (int)HeightUnit;
// Character alignment (round size up or down)
/* Character alignment (round size up or down) */
if ((windx % WidthUnit ) >= (WidthUnit / 2)) ++charx;
if ((windy % HeightUnit) >= (HeightUnit / 2)) ++chary;
// Resize window
/* Resize window */
if ((charx != Buff->ViewSize.X) || (chary != Buff->ViewSize.Y))
{
Buff->ViewSize.X = (charx <= (DWORD)Buff->ScreenBufferSize.X) ? charx : Buff->ScreenBufferSize.X;
@@ -2032,7 +2179,7 @@ OnSize(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam)
ResizeConWnd(GuiData, WidthUnit, HeightUnit);
// Adjust the start of the visible area if we are attempting to show nonexistent areas
/* Adjust the start of the visible area if we are attempting to show nonexistent areas */
if ((Buff->ScreenBufferSize.X - Buff->ViewOrigin.X) < Buff->ViewSize.X) Buff->ViewOrigin.X = Buff->ScreenBufferSize.X - Buff->ViewSize.X;
if ((Buff->ScreenBufferSize.Y - Buff->ViewOrigin.Y) < Buff->ViewSize.Y) Buff->ViewOrigin.Y = Buff->ScreenBufferSize.Y - Buff->ViewSize.Y;
InvalidateRect(GuiData->hWindow, NULL, TRUE);
@@ -2085,114 +2232,6 @@ GuiConsoleHandleScrollbarMenu(VOID)
}
*/
static LRESULT
OnScroll(PGUI_CONSOLE_DATA GuiData, UINT uMsg, WPARAM wParam)
{
PCONSRV_CONSOLE Console = GuiData->Console;
PCONSOLE_SCREEN_BUFFER Buff;
SCROLLINFO sInfo;
int fnBar;
int old_pos, Maximum;
PSHORT pShowXY;
if (!ConDrvValidateConsoleUnsafe((PCONSOLE)Console, CONSOLE_RUNNING, TRUE)) return 0;
Buff = GuiData->ActiveBuffer;
if (uMsg == WM_HSCROLL)
{
fnBar = SB_HORZ;
Maximum = Buff->ScreenBufferSize.X - Buff->ViewSize.X;
pShowXY = &Buff->ViewOrigin.X;
}
else
{
fnBar = SB_VERT;
Maximum = Buff->ScreenBufferSize.Y - Buff->ViewSize.Y;
pShowXY = &Buff->ViewOrigin.Y;
}
/* set scrollbar sizes */
sInfo.cbSize = sizeof(SCROLLINFO);
sInfo.fMask = SIF_RANGE | SIF_POS | SIF_PAGE | SIF_TRACKPOS;
if (!GetScrollInfo(GuiData->hWindow, fnBar, &sInfo)) goto Quit;
old_pos = sInfo.nPos;
switch (LOWORD(wParam))
{
case SB_LINELEFT:
sInfo.nPos -= 1;
break;
case SB_LINERIGHT:
sInfo.nPos += 1;
break;
case SB_PAGELEFT:
sInfo.nPos -= sInfo.nPage;
break;
case SB_PAGERIGHT:
sInfo.nPos += sInfo.nPage;
break;
case SB_THUMBTRACK:
sInfo.nPos = sInfo.nTrackPos;
ConioPause(Console, PAUSED_FROM_SCROLLBAR);
break;
case SB_THUMBPOSITION:
ConioUnpause(Console, PAUSED_FROM_SCROLLBAR);
break;
case SB_TOP:
sInfo.nPos = sInfo.nMin;
break;
case SB_BOTTOM:
sInfo.nPos = sInfo.nMax;
break;
default:
break;
}
sInfo.nPos = max(sInfo.nPos, 0);
sInfo.nPos = min(sInfo.nPos, Maximum);
if (old_pos != sInfo.nPos)
{
USHORT OldX = Buff->ViewOrigin.X;
USHORT OldY = Buff->ViewOrigin.Y;
UINT WidthUnit, HeightUnit;
*pShowXY = sInfo.nPos;
GetScreenBufferSizeUnits(Buff, GuiData, &WidthUnit, &HeightUnit);
ScrollWindowEx(GuiData->hWindow,
(OldX - Buff->ViewOrigin.X) * WidthUnit ,
(OldY - Buff->ViewOrigin.Y) * HeightUnit,
NULL,
NULL,
NULL,
NULL,
SW_INVALIDATE);
sInfo.fMask = SIF_POS;
SetScrollInfo(GuiData->hWindow, fnBar, &sInfo, TRUE);
UpdateWindow(GuiData->hWindow);
// InvalidateRect(GuiData->hWindow, NULL, FALSE);
}
Quit:
LeaveCriticalSection(&Console->Lock);
return 0;
}
static LRESULT CALLBACK
ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -2378,11 +2417,12 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
case WM_HSCROLL:
case WM_VSCROLL:
{
Result = OnScroll(GuiData, msg, wParam);
OnScroll(GuiData, SB_HORZ, LOWORD(wParam));
break;
case WM_VSCROLL:
OnScroll(GuiData, SB_VERT, LOWORD(wParam));
break;
}
case WM_CONTEXTMENU:
{

View File

@@ -21,6 +21,10 @@
#define PM_CONSOLE_BEEP (WM_APP + 4)
#define PM_CONSOLE_SET_TITLE (WM_APP + 5)
/* Flags for GetKeyState */
#define KEY_TOGGLED 0x0001
#define KEY_PRESSED 0x8000
/*
typedef struct _CONSOLE_FONT
{

View File

@@ -44,7 +44,7 @@ CopyBlock(PTEXTMODE_SCREEN_BUFFER Buffer,
* Pressing the Shift key while copying text, allows us to copy
* text without newline characters (inline-text copy mode).
*/
BOOL InlineCopyMode = !!(GetKeyState(VK_SHIFT) & 0x8000);
BOOL InlineCopyMode = !!(GetKeyState(VK_SHIFT) & KEY_PRESSED);
HANDLE hData;
PCHAR_INFO ptr;

View File

@@ -32,7 +32,12 @@
static void test_SetupPromptForDiskA(void)
{
#ifdef __REACTOS__
char path[] = "C:\\ReactOS\\system32";
#else
#error "path must use GetSystemDirectoryA()! ROSTESTS_234"
char path[] = "C:\\windows\\system32";
#endif
char file[] = "kernel32.dll";
char buffer[MAX_PATH];
UINT ret;
@@ -66,7 +71,12 @@ static void test_SetupPromptForDiskA(void)
static void test_SetupPromptForDiskW(void)
{
#ifdef __REACTOS__
WCHAR path[] = {'C',':','\\','R','e','a','c','t','O','S','\\','s','y','s','t','e','m','3','2','\0'};
#else
#error "path must use GetSystemDirectoryW()! ROSTESTS_234"
WCHAR path[] = {'C',':','\\','w','i','n','d','o','w','s','\\','s','y','s','t','e','m','3','2','\0'};
#endif
WCHAR file[] = {'k','e','r','n','e','l','3','2','.','d','l','l','\0'};
WCHAR title[] = {'T','e','s','t','\0'};
WCHAR disk[] = {'T','e','s','t','d','i','s','k','\0'};