ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
November 2014
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
18 participants
373 discussions
Start a n
N
ew thread
[dquintana] 65225: [EXPLORER-NEW] * Fix GCC build.
by dquintana@svn.reactos.org
Author: dquintana Date: Mon Nov 3 15:06:54 2014 New Revision: 65225 URL:
http://svn.reactos.org/svn/reactos?rev=65225&view=rev
Log: [EXPLORER-NEW] * Fix GCC build. Modified: branches/shell-experiments/base/shell/explorer-new/trayntfy.cpp Modified: branches/shell-experiments/base/shell/explorer-new/trayntfy.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/ex…
============================================================================== --- branches/shell-experiments/base/shell/explorer-new/trayntfy.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/explorer-new/trayntfy.cpp [iso-8859-1] Mon Nov 3 15:06:54 2014 @@ -44,59 +44,59 @@ public: int GetItemCount() { - return SendMessage(TB_BUTTONCOUNT); + return this->SendMessageW(TB_BUTTONCOUNT); } DWORD GetButton(int index, TBBUTTON * btn) { - return SendMessage(TB_GETBUTTON, index, (LPARAM)btn); + return this->SendMessageW(TB_GETBUTTON, index, (LPARAM) btn); } DWORD AddButton(TBBUTTON * btn) { - return SendMessage(TB_ADDBUTTONS, 1, (LPARAM) btn); + return this->SendMessageW(TB_ADDBUTTONS, 1, (LPARAM) btn); } DWORD AddButtons(int count, TBBUTTON * buttons) { - return SendMessage(TB_ADDBUTTONS, count, (LPARAM) btn); + return this->SendMessageW(TB_ADDBUTTONS, count, (LPARAM) buttons); } DWORD InsertButton(int insertAt, TBBUTTON * btn) { - return SendMessage(TB_INSERTBUTTON, insertAt, (LPARAM) btn); + return this->SendMessageW(TB_INSERTBUTTON, insertAt, (LPARAM) btn); } DWORD MoveButton(int oldIndex, int newIndex) { - return SendMessage(TB_MOVEBUTTON, oldIndex, newIndex); + return this->SendMessageW(TB_MOVEBUTTON, oldIndex, newIndex); } DWORD DeleteButton(int index) { - return SendMessage(TB_DELETEBUTTON, index, 0); + return this->SendMessageW(TB_DELETEBUTTON, index, 0); } DWORD GetButtonInfo(int cmdId, TBBUTTONINFO * info) { - return SendMessage(TB_GETBUTTONINFO, cmdId, (LPARAM) info); + return this->SendMessageW(TB_GETBUTTONINFO, cmdId, (LPARAM) info); } DWORD SetButtonInfo(int cmdId, TBBUTTONINFO * info) { - return SendMessage(TB_SETBUTTONINFO, cmdId, (LPARAM) info); + return this->SendMessageW(TB_SETBUTTONINFO, cmdId, (LPARAM) info); } public: DWORD SetButtonSize(int w, int h) { - return SendMessage(TB_SETBUTTONSIZE, 0, MAKELONG(w, h)); + return this->SendMessageW(TB_SETBUTTONSIZE, 0, MAKELONG(w, h)); } public: DWORD AutoSize() { - return SendMessage(TB_AUTOSIZE); + return this->SendMessageW(TB_AUTOSIZE); } public: @@ -109,7 +109,7 @@ DWORD SetItemData(int index, TItemData * data) { - TBBUTTONINFO info = { 0 }; + TBBUTTONINFOW info = { 0 }; info.cbSize = sizeof(info); info.dwMask = TBIF_BYINDEX | TBIF_LPARAM; info.lParam = (DWORD_PTR) data; @@ -286,7 +286,6 @@ VOID RemoveButton(IN CONST NOTIFYICONDATA *iconData) { NOTIFYICONDATA * notifyItem; - TBBUTTONINFO tbbi = { 0 }; int index = FindItemByIconData(iconData, ¬ifyItem); if (index < 0)
10 years, 1 month
1
0
0
0
[akhaldi] 65224: [SHELL32] * Move control.cpp to the wine folder. * Rename control.cpp to control.c. * Partially sync control.c with Wine 1.7.27. CORE-8540
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 3 14:36:57 2014 New Revision: 65224 URL:
http://svn.reactos.org/svn/reactos?rev=65224&view=rev
Log: [SHELL32] * Move control.cpp to the wine folder. * Rename control.cpp to control.c. * Partially sync control.c with Wine 1.7.27. CORE-8540 Added: branches/shell-experiments/dll/win32/shell32/wine/control.c - copied, changed from r65215, branches/shell-experiments/dll/win32/shell32/control.cpp Removed: branches/shell-experiments/dll/win32/shell32/control.cpp Modified: branches/shell-experiments/dll/win32/shell32/CMakeLists.txt branches/shell-experiments/dll/win32/shell32/cpanel.h Modified: branches/shell-experiments/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Mon Nov 3 14:36:57 2014 @@ -22,7 +22,6 @@ changenotify.cpp classes.cpp clipboard.cpp - control.cpp CMenuBand.cpp CMenuDeskBar.cpp dataobject.cpp @@ -73,6 +72,7 @@ add_library(shell32 SHARED ${SOURCE} + wine/control.c wine/shell32_main.c wine/shellole.c wine/shellpath.c Removed: branches/shell-experiments/dll/win32/shell32/control.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/control.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/control.cpp (removed) @@ -1,549 +0,0 @@ -/* Control Panel management - * - * Copyright 2001 Eric Pouech - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "precomp.h" - -WINE_DEFAULT_DEBUG_CHANNEL(shlctrl); - -CPlApplet* Control_UnloadApplet(CPlApplet* applet) -{ - unsigned i; - CPlApplet* next; - - for (i = 0; i < applet->count; i++) - { - if (!applet->info[i].dwSize) - continue; - applet->proc(applet->hWnd, CPL_STOP, i, applet->info[i].lData); - } - if (applet->proc) - applet->proc(applet->hWnd, CPL_EXIT, 0L, 0L); - - FreeLibrary(applet->hModule); - next = applet->next; - HeapFree(GetProcessHeap(), 0, applet); - return next; -} - -CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel) -{ - CPlApplet* applet; - unsigned i; - CPLINFO info; - NEWCPLINFOW newinfo; - - if (!(applet = (CPlApplet *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*applet)))) - return applet; - - applet->hWnd = hWnd; - - if (!(applet->hModule = LoadLibraryW(cmd))) - { - WARN("Cannot load control panel applet %s\n", debugstr_w(cmd)); - goto theError; - } - if (!(applet->proc = (APPLET_PROC)GetProcAddress(applet->hModule, "CPlApplet"))) - { - WARN("Not a valid control panel applet %s\n", debugstr_w(cmd)); - goto theError; - } - if (!applet->proc(hWnd, CPL_INIT, 0L, 0L)) - { - WARN("Init of applet has failed\n"); - goto theError; - } - if ((applet->count = applet->proc(hWnd, CPL_GETCOUNT, 0L, 0L)) == 0) - { - WARN("No subprogram in applet\n"); - goto theError; - } - - applet = (CPlApplet *)HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, applet, - sizeof(*applet) + (applet->count - 1) * sizeof(NEWCPLINFOW)); - - for (i = 0; i < applet->count; i++) - { - ZeroMemory(&newinfo, sizeof(newinfo)); - newinfo.dwSize = sizeof(NEWCPLINFOW); - applet->info[i].dwSize = sizeof(NEWCPLINFOW); - /* proc is supposed to return a null value upon success for - * CPL_INQUIRE and CPL_NEWINQUIRE - * However, real drivers don't seem to behave like this - * So, use introspection rather than return value - */ - applet->proc(hWnd, CPL_NEWINQUIRE, i, (LPARAM)&newinfo); - if (newinfo.hIcon == 0) - { - applet->proc(hWnd, CPL_INQUIRE, i, (LPARAM)&info); - if (info.idIcon == 0 || info.idName == 0) - { - WARN("Couldn't get info from sp %u\n", i); - applet->info[i].dwSize = 0; - } - else - { - /* convert the old data into the new structure */ - applet->info[i].dwFlags = 0; - applet->info[i].dwHelpContext = 0; - applet->info[i].lData = info.lData; - applet->info[i].hIcon = LoadIconW(applet->hModule, - MAKEINTRESOURCEW(info.idIcon)); - LoadStringW(applet->hModule, info.idName, - applet->info[i].szName, sizeof(applet->info[i].szName) / sizeof(WCHAR)); - LoadStringW(applet->hModule, info.idInfo, - applet->info[i].szInfo, sizeof(applet->info[i].szInfo) / sizeof(WCHAR)); - applet->info[i].szHelpFile[0] = '\0'; - } - } - else - { - CopyMemory(&applet->info[i], &newinfo, newinfo.dwSize); - if (newinfo.dwSize != sizeof(NEWCPLINFOW)) - { - applet->info[i].dwSize = sizeof(NEWCPLINFOW); - lstrcpyW(applet->info[i].szName, newinfo.szName); - lstrcpyW(applet->info[i].szInfo, newinfo.szInfo); - lstrcpyW(applet->info[i].szHelpFile, newinfo.szHelpFile); - } - } - } - - applet->next = panel->first; - panel->first = applet; - - return applet; - - theError: - Control_UnloadApplet(applet); - return NULL; -} - -static void Control_WndProc_Create(HWND hWnd, const CREATESTRUCTW* cs) -{ - CPanel* panel = (CPanel*)cs->lpCreateParams; - - SetWindowLongPtrW(hWnd, 0, (LONG_PTR)panel); - panel->status = 0; - panel->hWnd = hWnd; -} - -#define XICON 32 -#define XSTEP 128 -#define YICON 32 -#define YSTEP 64 - -static BOOL Control_Localize(const CPanel* panel, int cx, int cy, - CPlApplet** papplet, unsigned* psp) -{ - unsigned int i; - int x = (XSTEP-XICON)/2, y = 0; - CPlApplet* applet; - RECT rc; - - GetClientRect(panel->hWnd, &rc); - for (applet = panel->first; applet; applet = applet->next) - { - for (i = 0; i < applet->count; i++) - { - if (!applet->info[i].dwSize) - continue; - if (x + XSTEP >= rc.right - rc.left) - { - x = (XSTEP-XICON)/2; - y += YSTEP; - } - if (cx >= x && cx < x + XICON && cy >= y && cy < y + YSTEP) - { - *papplet = applet; - *psp = i; - return TRUE; - } - x += XSTEP; - } - } - return FALSE; -} - -static LRESULT Control_WndProc_Paint(const CPanel* panel, WPARAM wParam) -{ - HDC hdc; - PAINTSTRUCT ps; - RECT rc, txtRect; - unsigned int i; - int x = 0, y = 0; - CPlApplet* applet; - HGDIOBJ hOldFont; - - hdc = (wParam) ? (HDC)wParam : BeginPaint(panel->hWnd, &ps); - hOldFont = SelectObject(hdc, GetStockObject(ANSI_VAR_FONT)); - GetClientRect(panel->hWnd, &rc); - - for (applet = panel->first; applet; applet = applet->next) - { - for (i = 0; i < applet->count; i++) - { - if (x + XSTEP >= rc.right - rc.left) - { - x = 0; - y += YSTEP; - } - if (!applet->info[i].dwSize) - continue; - DrawIcon(hdc, x + (XSTEP-XICON)/2, y, applet->info[i].hIcon); - txtRect.left = x; - txtRect.right = x + XSTEP; - txtRect.top = y + YICON; - txtRect.bottom = y + YSTEP; - DrawTextW(hdc, applet->info[i].szName, -1, &txtRect, - DT_CENTER | DT_VCENTER); - x += XSTEP; - } - } - - SelectObject(hdc, hOldFont); - if (!wParam) - EndPaint(panel->hWnd, &ps); - - return 0; -} - -static LRESULT Control_WndProc_LButton(CPanel* panel, LPARAM lParam, BOOL up) -{ - unsigned i; - CPlApplet* applet; - - if (Control_Localize(panel, (short)LOWORD(lParam), (short)HIWORD(lParam), &applet, &i)) - { - if (up) - { - if (panel->clkApplet == applet && panel->clkSP == i) - { - applet->proc(applet->hWnd, CPL_DBLCLK, i, applet->info[i].lData); - } - } - else - { - panel->clkApplet = applet; - panel->clkSP = i; - } - } - return 0; -} - -static LRESULT WINAPI Control_WndProc(HWND hWnd, UINT wMsg, - WPARAM lParam1, LPARAM lParam2) -{ - CPanel* panel = (CPanel*)GetWindowLongPtrW(hWnd, 0); - - if (panel || wMsg == WM_CREATE) - { - switch (wMsg) - { - case WM_CREATE: - Control_WndProc_Create(hWnd, (CREATESTRUCTW*)lParam2); - return 0; - case WM_DESTROY: - { - CPlApplet *applet = panel->first; - while (applet) - applet = Control_UnloadApplet(applet); - - PostQuitMessage(0); - break; - } - case WM_PAINT: - return Control_WndProc_Paint(panel, lParam1); - case WM_LBUTTONUP: - return Control_WndProc_LButton(panel, lParam2, TRUE); - case WM_LBUTTONDOWN: - return Control_WndProc_LButton(panel, lParam2, FALSE); - /* EPP case WM_COMMAND: */ - /* EPP return Control_WndProc_Command(mwi, lParam1, lParam2); */ - } - } - - return DefWindowProcW(hWnd, wMsg, lParam1, lParam2); -} - -static void Control_DoInterface(CPanel* panel, HWND hWnd, HINSTANCE hInst) -{ - WNDCLASSW wc; - MSG msg; - const WCHAR* appName = L"ReactOS Control Panel"; - wc.style = CS_HREDRAW|CS_VREDRAW; - wc.lpfnWndProc = Control_WndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = sizeof(CPlApplet*); - wc.hInstance = hInst; - wc.hIcon = 0; - wc.hCursor = 0; - wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); - wc.lpszMenuName = NULL; - wc.lpszClassName = L"Shell_Control_WndClass"; - - if (!RegisterClassW(&wc)) return; - - CreateWindowExW(0, wc.lpszClassName, appName, - WS_OVERLAPPEDWINDOW | WS_VISIBLE, - CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, CW_USEDEFAULT, - hWnd, NULL, hInst, panel); - - if (!panel->hWnd) - return; - - if (!panel->first) - { - /* FIXME appName & message should be localized */ - MessageBoxW(panel->hWnd, L"Cannot load any applets", appName, MB_OK); - return; - } - - while (GetMessageW(&msg, panel->hWnd, 0, 0)) - { - TranslateMessage(&msg); - DispatchMessageW(&msg); - } -} - -static void Control_DoWindow(CPanel *panel, HWND hWnd, HINSTANCE hInst) -{ - HANDLE hFind; - WIN32_FIND_DATAW wfd; - WCHAR wszPath[MAX_PATH]; - WCHAR *Ptr = wszPath; - - Ptr += GetSystemDirectoryW(wszPath, MAX_PATH); - *Ptr++ = '\\'; - wcscpy(Ptr, L"*.cpl"); - - hFind = FindFirstFileW(wszPath, &wfd); - if (hFind != INVALID_HANDLE_VALUE) - { - do - { - wcscpy(Ptr, wfd.cFileName); - Control_LoadApplet(hWnd, wszPath, panel); - } while (FindNextFileW(hFind, &wfd)); - FindClose(hFind); - } - - Control_DoInterface(panel, hWnd, hInst); -} - -static void Control_DoLaunch(CPanel *pPanel, HWND hWnd, LPCWSTR pwszCmd) -{ - /* Make a pwszCmd copy so we can modify it */ - LPWSTR pwszCmdCopy = _wcsdup(pwszCmd); - if (!pwszCmdCopy) - return; - - LPWSTR pwszPath = pwszCmdCopy, pwszArg = NULL, pwszArg2 = NULL; - - /* Path can be quoted */ - if (pwszPath[0] == L'"') - { - ++pwszPath; - pwszArg = wcschr(pwszPath, L'"'); - if (pwszArg) - *(pwszArg++) = '\0'; - } - else - pwszArg = pwszCmdCopy; - - /* First argument starts after space or ','. Note: we ignore characters between '"' and ',' or ' '. */ - if (pwszArg) - pwszArg = wcspbrk(pwszArg, L" ,"); - if (pwszArg) - { - /* NULL terminate path and find first character of arg */ - *(pwszArg++) = L'\0'; - if (pwszArg[0] == L'"') - { - ++pwszArg; - pwszArg2 = wcschr(pwszArg, L'"'); - if (pwszArg2) - *(pwszArg2++) = L'\0'; - } else - pwszArg2 = pwszArg; - - /* Second argument always starts with ','. Note: we ignore characters between '"' and ','. */ - if (pwszArg2) - pwszArg2 = wcschr(pwszArg2, L','); - } - - TRACE("Launch %ls, arg %ls, arg2 %ls\n", pwszPath, pwszArg, pwszArg2); - - /* Create a mutex to disallow running multiple instances */ - HANDLE hMutex = CreateMutexW(NULL, TRUE, PathFindFileNameW(pwszPath)); - if (!hMutex || GetLastError() == ERROR_ALREADY_EXISTS) - { - TRACE("Next instance disallowed\n"); - if (hMutex) - CloseHandle(hMutex); - return; - } - - /* Load applet cpl */ - TRACE("Load applet %ls\n", pwszPath); - Control_LoadApplet(hWnd, pwszPath, pPanel); - if (pPanel->first) - { - /* First pPanel applet is the new one */ - CPlApplet *pApplet = pPanel->first; - assert(pApplet && pApplet->next == NULL); - TRACE("pApplet->count %d\n", pApplet->count); - - /* Note: if there is only one applet, first argument is ignored */ - INT i = 0; - if (pApplet->count > 1 && pwszArg && pwszArg[0]) - { - /* If arg begins with '@', number specifies applet index */ - if (pwszArg[0] == L'@') - i = _wtoi(pwszArg + 1); - else - { - /* Otherwise it's applet name */ - for (i = 0; i < (INT)pApplet->count; ++i) - if (!wcscmp(pwszArg, pApplet->info[i].szName)) - break; - } - } - - if (i >= 0 && i < (INT)pApplet->count && pApplet->info[i].dwSize) - { - /* Start the applet */ - TRACE("Starting applet %d\n", i); - if (!pApplet->proc(pApplet->hWnd, CPL_STARTWPARMSW, i, (LPARAM)pwszArg)) - pApplet->proc(pApplet->hWnd, CPL_DBLCLK, i, pApplet->info[i].lData); - } else - ERR("Applet not found: %ls\n", pwszArg ? pwszArg : L"NULL"); - - Control_UnloadApplet(pApplet); - } - else - ERR("Failed to load applet %ls\n", pwszPath); - - ReleaseMutex(hMutex); - CloseHandle(hMutex); - free(pwszCmdCopy); -} - -/************************************************************************* - * Control_RunDLLW [SHELL32.@] - * - */ -EXTERN_C void WINAPI Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow) -{ - CPanel Panel; - - TRACE("(%p, %p, %s, 0x%08x)\n", - hWnd, hInst, debugstr_w(cmd), nCmdShow); - - memset(&Panel, 0, sizeof(Panel)); - - if (!cmd || !*cmd) - { - TRACE("[shell32, Control_RunDLLW] Calling Control_DoWindow\n"); - Control_DoWindow(&Panel, hWnd, hInst); - } - else - { - TRACE("[shell32, Control_RunDLLW] Calling Control_DoLaunch\n"); - Control_DoLaunch(&Panel, hWnd, cmd); - } -} - -/************************************************************************* - * Control_RunDLLA [SHELL32.@] - * - */ -EXTERN_C void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow) -{ - DWORD len = MultiByteToWideChar(CP_ACP, 0, cmd, -1, NULL, 0 ); - LPWSTR wszCmd = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - - if (wszCmd && MultiByteToWideChar(CP_ACP, 0, cmd, -1, wszCmd, len )) - { - Control_RunDLLW(hWnd, hInst, wszCmd, nCmdShow); - } - - HeapFree(GetProcessHeap(), 0, wszCmd); -} - -/************************************************************************* - * Control_FillCache_RunDLLW [SHELL32.@] - * - */ -EXTERN_C HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWORD w, DWORD x) -{ - FIXME("%p %p 0x%08x 0x%08x stub\n", hWnd, hModule, w, x); - return 0; -} - -/************************************************************************* - * Control_FillCache_RunDLLA [SHELL32.@] - * - */ -EXTERN_C HRESULT WINAPI Control_FillCache_RunDLLA(HWND hWnd, HANDLE hModule, DWORD w, DWORD x) -{ - return Control_FillCache_RunDLLW(hWnd, hModule, w, x); -} - - -/************************************************************************* - * RunDLL_CallEntry16 [SHELL32.122] - * the name is probably wrong - */ -EXTERN_C void WINAPI RunDLL_CallEntry16( DWORD proc, HWND hwnd, HINSTANCE inst, - LPCSTR cmdline, INT cmdshow ) -{ -#if !defined(__CYGWIN__) && !defined (__MINGW32__) && !defined(_MSC_VER) - WORD args[5]; - SEGPTR cmdline_seg; - - TRACE( "proc %x hwnd %p inst %p cmdline %s cmdshow %d\n", - proc, hwnd, inst, debugstr_a(cmdline), cmdshow ); - - cmdline_seg = MapLS( cmdline ); - args[4] = HWND_16(hwnd); - args[3] = MapHModuleLS(inst); - args[2] = SELECTOROF(cmdline_seg); - args[1] = OFFSETOF(cmdline_seg); - args[0] = cmdshow; - WOWCallback16Ex( proc, WCB16_PASCAL, sizeof(args), args, NULL ); - UnMapLS( cmdline_seg ); -#else - FIXME( "proc %lx hwnd %p inst %p cmdline %s cmdshow %d\n", - proc, hwnd, inst, debugstr_a(cmdline), cmdshow ); -#endif -} - -/************************************************************************* - * CallCPLEntry16 [SHELL32.166] - * - * called by desk.cpl on "Advanced" with: - * hMod("DeskCp16.Dll"), pFunc("CplApplet"), 0, 1, 0xc, 0 - * - */ -LRESULT WINAPI CallCPLEntry16(HINSTANCE hMod, FARPROC pFunc, HWND dw3, UINT dw4, LPARAM dw5, LPARAM dw6) -{ - FIXME("(%p, %p, %08x, %08x, %08x, %08x): stub.\n", hMod, pFunc, dw3, dw4, dw5, dw6); - return 0x0deadbee; -} Modified: branches/shell-experiments/dll/win32/shell32/cpanel.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/cpanel.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/cpanel.h [iso-8859-1] Mon Nov 3 14:36:57 2014 @@ -43,7 +43,7 @@ } CPanel; -CPlApplet *Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel); -CPlApplet *Control_UnloadApplet(CPlApplet* applet); +EXTERN_C CPlApplet *Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel); +EXTERN_C CPlApplet *Control_UnloadApplet(CPlApplet* applet); #endif /* __WINE_SHELL_CPANEL_H */ Copied: branches/shell-experiments/dll/win32/shell32/wine/control.c (from r65215, branches/shell-experiments/dll/win32/shell32/control.cpp) URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/control.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/wine/control.c [iso-8859-1] Mon Nov 3 14:36:57 2014 @@ -1,6 +1,7 @@ /* Control Panel management * * Copyright 2001 Eric Pouech + * Copyright 2008 Owen Rudge * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,7 +18,18 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <assert.h> + +#define WIN32_NO_STATUS +#define _INC_WINDOWS + +#include <windef.h> +#include <winbase.h> +#define NO_SHLWAPI_REG +#include <shlwapi.h> +#include <wine/debug.h> + +#include "cpanel.h" WINE_DEFAULT_DEBUG_CHANNEL(shlctrl); @@ -349,12 +361,14 @@ static void Control_DoLaunch(CPanel *pPanel, HWND hWnd, LPCWSTR pwszCmd) { + HANDLE hMutex; + /* Make a pwszCmd copy so we can modify it */ LPWSTR pwszCmdCopy = _wcsdup(pwszCmd); + + LPWSTR pwszPath = pwszCmdCopy, pwszArg = NULL, pwszArg2 = NULL; if (!pwszCmdCopy) return; - - LPWSTR pwszPath = pwszCmdCopy, pwszArg = NULL, pwszArg2 = NULL; /* Path can be quoted */ if (pwszPath[0] == L'"') @@ -391,7 +405,7 @@ TRACE("Launch %ls, arg %ls, arg2 %ls\n", pwszPath, pwszArg, pwszArg2); /* Create a mutex to disallow running multiple instances */ - HANDLE hMutex = CreateMutexW(NULL, TRUE, PathFindFileNameW(pwszPath)); + hMutex = CreateMutexW(NULL, TRUE, PathFindFileNameW(pwszPath)); if (!hMutex || GetLastError() == ERROR_ALREADY_EXISTS) { TRACE("Next instance disallowed\n"); @@ -405,13 +419,13 @@ Control_LoadApplet(hWnd, pwszPath, pPanel); if (pPanel->first) { + INT i = 0; /* First pPanel applet is the new one */ CPlApplet *pApplet = pPanel->first; assert(pApplet && pApplet->next == NULL); TRACE("pApplet->count %d\n", pApplet->count); /* Note: if there is only one applet, first argument is ignored */ - INT i = 0; if (pApplet->count > 1 && pwszArg && pwszArg[0]) { /* If arg begins with '@', number specifies applet index */ @@ -454,7 +468,7 @@ CPanel Panel; TRACE("(%p, %p, %s, 0x%08x)\n", - hWnd, hInst, debugstr_w(cmd), nCmdShow); + hWnd, hInst, debugstr_w(cmd), nCmdShow); memset(&Panel, 0, sizeof(Panel)); @@ -471,37 +485,35 @@ } /************************************************************************* - * Control_RunDLLA [SHELL32.@] - * - */ -EXTERN_C void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow) + * Control_RunDLLA [SHELL32.@] + * + */ +void WINAPI Control_RunDLLA(HWND hWnd, HINSTANCE hInst, LPCSTR cmd, DWORD nCmdShow) { DWORD len = MultiByteToWideChar(CP_ACP, 0, cmd, -1, NULL, 0 ); - LPWSTR wszCmd = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - + LPWSTR wszCmd = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (wszCmd && MultiByteToWideChar(CP_ACP, 0, cmd, -1, wszCmd, len )) { Control_RunDLLW(hWnd, hInst, wszCmd, nCmdShow); } - HeapFree(GetProcessHeap(), 0, wszCmd); } /************************************************************************* - * Control_FillCache_RunDLLW [SHELL32.@] - * - */ -EXTERN_C HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWORD w, DWORD x) + * Control_FillCache_RunDLLW [SHELL32.@] + * + */ +HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWORD w, DWORD x) { FIXME("%p %p 0x%08x 0x%08x stub\n", hWnd, hModule, w, x); - return 0; + return S_OK; } /************************************************************************* - * Control_FillCache_RunDLLA [SHELL32.@] - * - */ -EXTERN_C HRESULT WINAPI Control_FillCache_RunDLLA(HWND hWnd, HANDLE hModule, DWORD w, DWORD x) + * Control_FillCache_RunDLLA [SHELL32.@] + * + */ +HRESULT WINAPI Control_FillCache_RunDLLA(HWND hWnd, HANDLE hModule, DWORD w, DWORD x) { return Control_FillCache_RunDLLW(hWnd, hModule, w, x); }
10 years, 1 month
1
0
0
0
[akhaldi] 65223: [SHELL32] * Move shpolicy.cpp to the wine folder. * Rename shpolicy.cpp to shpolicy.c. * Sync shpolicy.c with Wine 1.7.27. CORE-8540
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 3 13:59:23 2014 New Revision: 65223 URL:
http://svn.reactos.org/svn/reactos?rev=65223&view=rev
Log: [SHELL32] * Move shpolicy.cpp to the wine folder. * Rename shpolicy.cpp to shpolicy.c. * Sync shpolicy.c with Wine 1.7.27. CORE-8540 Added: branches/shell-experiments/dll/win32/shell32/wine/shpolicy.c - copied, changed from r65215, branches/shell-experiments/dll/win32/shell32/shpolicy.cpp Removed: branches/shell-experiments/dll/win32/shell32/shpolicy.cpp Modified: branches/shell-experiments/dll/win32/shell32/CMakeLists.txt Modified: branches/shell-experiments/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Mon Nov 3 13:59:23 2014 @@ -63,7 +63,6 @@ shlfsbind.cpp shlmenu.cpp shlview.cpp - shpolicy.cpp stubs.cpp systray.cpp defcontextmenu.cpp @@ -78,6 +77,7 @@ wine/shellole.c wine/shellpath.c wine/shellstring.c + wine/shpolicy.c vista.c shell32.rc ${CMAKE_CURRENT_BINARY_DIR}/shell32_stubs.c Removed: branches/shell-experiments/dll/win32/shell32/shpolicy.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/shpolicy.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shpolicy.cpp (removed) @@ -1,905 +0,0 @@ -/* - * shpolicy.c - Data for shell/system policies. - * - * Copyright 1999 Ian Schmidt <ischmidt(a)cfl.rr.com> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - * NOTES: - * - * Some of these policies can be tweaked via the System Policy - * Editor which came with the Win95 Migration Guide, although - * there doesn't appear to be an updated Win98 version that - * would handle the many new policies introduced since then. - * You could easily write one with the information in - * this file... - * - * Up to date as of SHELL32 v5.00 (W2K) - */ - -#include "precomp.h" - -WINE_DEFAULT_DEBUG_CHANNEL(shell); - -#define SHELL_NO_POLICY 0xffffffff - -typedef struct tagPOLICYDAT -{ - RESTRICTIONS policy; /* policy value passed to SHRestricted */ - LPCSTR appstr; /* application str such as "Explorer" */ - LPCSTR keystr; /* name of the actual registry key / policy */ - DWORD cache; /* cached value or 0xffffffff for invalid */ -} POLICYDATA, *LPPOLICYDATA; - -/* registry strings */ -static const CHAR strRegistryPolicyA[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies"; -static const WCHAR strRegistryPolicyW[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o', - 's','o','f','t','\\','W','i','n','d','o','w','s','\\', - 'C','u','r','r','e','n','t','V','e','r','s','i','o','n', - '\\','P','o','l','i','c','i','e','s',0}; -static const CHAR strPolicyA[] = "Policy"; -static const WCHAR strPolicyW[] = {'P','o','l','i','c','y',0}; - -/* application strings */ - -static const char strExplorer[] = {"Explorer"}; -static const char strActiveDesk[] = {"ActiveDesktop"}; -static const char strWinOldApp[] = {"WinOldApp"}; -static const char strAddRemoveProgs[] = {"AddRemoveProgs"}; - -/* key strings */ - -static const char strNoFileURL[] = {"NoFileUrl"}; -static const char strNoFolderOptions[] = {"NoFolderOptions"}; -static const char strNoChangeStartMenu[] = {"NoChangeStartMenu"}; -static const char strNoWindowsUpdate[] = {"NoWindowsUpdate"}; -static const char strNoSetActiveDesktop[] = {"NoSetActiveDesktop"}; -static const char strNoForgetSoftwareUpdate[] = {"NoForgetSoftwareUpdate"}; -//static const char strNoMSAppLogo[] = {"NoMSAppLogo5ChannelNotify"}; -static const char strForceCopyACLW[] = {"ForceCopyACLWithFile"}; -static const char strNoResolveTrk[] = {"NoResolveTrack"}; -static const char strNoResolveSearch[] = {"NoResolveSearch"}; -static const char strNoEditComponent[] = {"NoEditingComponents"}; -static const char strNoMovingBand[] = {"NoMovingBands"}; -static const char strNoCloseDragDrop[] = {"NoCloseDragDropBands"}; -static const char strNoCloseComponent[] = {"NoClosingComponents"}; -static const char strNoDelComponent[] = {"NoDeletingComponents"}; -static const char strNoAddComponent[] = {"NoAddingComponents"}; -static const char strNoComponent[] = {"NoComponents"}; -static const char strNoChangeWallpaper[] = {"NoChangingWallpaper"}; -static const char strNoHTMLWallpaper[] = {"NoHTMLWallpaper"}; -static const char strNoCustomWebView[] = {"NoCustomizeWebView"}; -static const char strClassicShell[] = {"ClassicShell"}; -static const char strClearRecentDocs[] = {"ClearRecentDocsOnExit"}; -static const char strNoFavoritesMenu[] = {"NoFavoritesMenu"}; -static const char strNoActiveDesktopChanges[] = {"NoActiveDesktopChanges"}; -static const char strNoActiveDesktop[] = {"NoActiveDesktop"}; -static const char strNoRecentDocMenu[] = {"NoRecentDocsMenu"}; -static const char strNoRecentDocHistory[] = {"NoRecentDocsHistory"}; -static const char strNoInetIcon[] = {"NoInternetIcon"}; -static const char strNoSettingsWizard[] = {"NoSettingsWizards"}; -static const char strNoLogoff[] = {"NoLogoff"}; -static const char strNoNetConDis[] = {"NoNetConnectDisconnect"}; -static const char strNoViewContextMenu[] = {"NoViewContextMenu"}; -static const char strNoTrayContextMenu[] = {"NoTrayContextMenu"}; -static const char strNoWebMenu[] = {"NoWebMenu"}; -static const char strLnkResolveIgnoreLnkInfo[] = {"LinkResolveIgnoreLinkInfo"}; -static const char strNoCommonGroups[] = {"NoCommonGroups"}; -static const char strEnforceShlExtSecurity[] = {"EnforceShellExtensionSecurity"}; -static const char strNoRealMode[] = {"NoRealMode"}; -static const char strMyDocsOnNet[] = {"MyDocsOnNet"}; -static const char strNoStartMenuSubfolder[] = {"NoStartMenuSubFolders"}; -static const char strNoAddPrinters[] = {"NoAddPrinter"}; -static const char strNoDeletePrinters[] = {"NoDeletePrinter"}; -static const char strNoPrintTab[] = {"NoPrinterTabs"}; -static const char strRestrictRun[] = {"RestrictRun"}; -static const char strNoStartBanner[] = {"NoStartBanner"}; -static const char strNoNetworkNeighborhood[] = {"NoNetHood"}; -static const char strNoDriveTypeAtRun[] = {"NoDriveTypeAutoRun"}; -static const char strNoDrivesAutoRun[] = {"NoDriveAutoRun"}; -static const char strSeparateProcess[] = {"SeparateProcess"}; -static const char strNoDrives[] = {"NoDrives"}; -static const char strNoFind[] = {"NoFind"}; -static const char strNoDesktop[] = {"NoDesktop"}; -static const char strNoSetTaskBar[] = {"NoSetTaskbar"}; -static const char strNoSetFld[] = {"NoSetFolders"}; -static const char strNoFileMenu[] = {"NoFileMenu"}; -static const char strNoSaveSetting[] = {"NoSaveSettings"}; -static const char strNoClose[] = {"NoClose"}; -static const char strNoRun[] = {"NoRun"}; - -/* policy data array */ -static POLICYDATA sh32_policy_table[] = -{ - { - REST_NORUN, - strExplorer, - strNoRun, - SHELL_NO_POLICY - }, - { - REST_NOCLOSE, - strExplorer, - strNoClose, - SHELL_NO_POLICY - }, - { - REST_NOSAVESET, - strExplorer, - strNoSaveSetting, - SHELL_NO_POLICY - }, - { - REST_NOFILEMENU, - strExplorer, - strNoFileMenu, - SHELL_NO_POLICY - }, - { - REST_NOSETFOLDERS, - strExplorer, - strNoSetFld, - SHELL_NO_POLICY - }, - { - REST_NOSETTASKBAR, - strExplorer, - strNoSetTaskBar, - SHELL_NO_POLICY - }, - { - REST_NODESKTOP, - strExplorer, - strNoDesktop, - SHELL_NO_POLICY - }, - { - REST_NOFIND, - strExplorer, - strNoFind, - SHELL_NO_POLICY - }, - { - REST_NODRIVES, - strExplorer, - strNoDrives, - SHELL_NO_POLICY - }, - { - REST_NODRIVEAUTORUN, - strExplorer, - strNoDrivesAutoRun, - SHELL_NO_POLICY - }, - { - REST_NODRIVETYPEAUTORUN, - strExplorer, - strNoDriveTypeAtRun, - SHELL_NO_POLICY - }, - { - REST_NONETHOOD, - strExplorer, - strNoNetworkNeighborhood, - SHELL_NO_POLICY - }, - { - REST_STARTBANNER, - strExplorer, - strNoStartBanner, - SHELL_NO_POLICY - }, - { - REST_RESTRICTRUN, - strExplorer, - strRestrictRun, - SHELL_NO_POLICY - }, - { - REST_NOPRINTERTABS, - strExplorer, - strNoPrintTab, - SHELL_NO_POLICY - }, - { - REST_NOPRINTERDELETE, - strExplorer, - strNoDeletePrinters, - SHELL_NO_POLICY - }, - { - REST_NOPRINTERADD, - strExplorer, - strNoAddPrinters, - SHELL_NO_POLICY - }, - { - REST_NOSTARTMENUSUBFOLDERS, - strExplorer, - strNoStartMenuSubfolder, - SHELL_NO_POLICY - }, - { - REST_MYDOCSONNET, - strExplorer, - strMyDocsOnNet, - SHELL_NO_POLICY - }, - { - REST_NOEXITTODOS, - strWinOldApp, - strNoRealMode, - SHELL_NO_POLICY - }, - { - REST_ENFORCESHELLEXTSECURITY, - strExplorer, - strEnforceShlExtSecurity, - SHELL_NO_POLICY - }, - { - REST_LINKRESOLVEIGNORELINKINFO, - strExplorer, - strLnkResolveIgnoreLnkInfo, - SHELL_NO_POLICY - }, - { - REST_NOCOMMONGROUPS, - strExplorer, - strNoCommonGroups, - SHELL_NO_POLICY - }, - { - REST_SEPARATEDESKTOPPROCESS, - strExplorer, - strSeparateProcess, - SHELL_NO_POLICY - }, - { - REST_NOWEB, - strExplorer, - strNoWebMenu, - SHELL_NO_POLICY - }, - { - REST_NOTRAYCONTEXTMENU, - strExplorer, - strNoTrayContextMenu, - SHELL_NO_POLICY - }, - { - REST_NOVIEWCONTEXTMENU, - strExplorer, - strNoViewContextMenu, - SHELL_NO_POLICY - }, - { - REST_NONETCONNECTDISCONNECT, - strExplorer, - strNoNetConDis, - SHELL_NO_POLICY - }, - { - REST_STARTMENULOGOFF, - strExplorer, - strNoLogoff, - SHELL_NO_POLICY - }, - { - REST_NOSETTINGSASSIST, - strExplorer, - strNoSettingsWizard, - SHELL_NO_POLICY - }, - { - REST_NOINTERNETICON, - strExplorer, - strNoInetIcon, - SHELL_NO_POLICY - }, - { - REST_NORECENTDOCSHISTORY, - strExplorer, - strNoRecentDocHistory, - SHELL_NO_POLICY - }, - { - REST_NORECENTDOCSMENU, - strExplorer, - strNoRecentDocMenu, - SHELL_NO_POLICY - }, - { - REST_NOACTIVEDESKTOP, - strExplorer, - strNoActiveDesktop, - SHELL_NO_POLICY - }, - { - REST_NOACTIVEDESKTOPCHANGES, - strExplorer, - strNoActiveDesktopChanges, - SHELL_NO_POLICY - }, - { - REST_NOFAVORITESMENU, - strExplorer, - strNoFavoritesMenu, - SHELL_NO_POLICY - }, - { - REST_CLEARRECENTDOCSONEXIT, - strExplorer, - strClearRecentDocs, - SHELL_NO_POLICY - }, - { - REST_CLASSICSHELL, - strExplorer, - strClassicShell, - SHELL_NO_POLICY - }, - { - REST_NOCUSTOMIZEWEBVIEW, - strExplorer, - strNoCustomWebView, - SHELL_NO_POLICY - }, - { - REST_NOHTMLWALLPAPER, - strActiveDesk, - strNoHTMLWallpaper, - SHELL_NO_POLICY - }, - { - REST_NOCHANGINGWALLPAPER, - strActiveDesk, - strNoChangeWallpaper, - SHELL_NO_POLICY - }, - { - REST_NODESKCOMP, - strActiveDesk, - strNoComponent, - SHELL_NO_POLICY - }, - { - REST_NOADDDESKCOMP, - strActiveDesk, - strNoAddComponent, - SHELL_NO_POLICY - }, - { - REST_NODELDESKCOMP, - strActiveDesk, - strNoDelComponent, - SHELL_NO_POLICY - }, - { - REST_NOCLOSEDESKCOMP, - strActiveDesk, - strNoCloseComponent, - SHELL_NO_POLICY - }, - { - REST_NOCLOSE_DRAGDROPBAND, - strActiveDesk, - strNoCloseDragDrop, - SHELL_NO_POLICY - }, - { - REST_NOMOVINGBAND, - strActiveDesk, - strNoMovingBand, - SHELL_NO_POLICY - }, - { - REST_NOEDITDESKCOMP, - strActiveDesk, - strNoEditComponent, - SHELL_NO_POLICY - }, - { - REST_NORESOLVESEARCH, - strExplorer, - strNoResolveSearch, - SHELL_NO_POLICY - }, - { - REST_NORESOLVETRACK, - strExplorer, - strNoResolveTrk, - SHELL_NO_POLICY - }, - { - REST_FORCECOPYACLWITHFILE, - strExplorer, - strForceCopyACLW, - SHELL_NO_POLICY - }, -#if (NTDDI_VERSION < NTDDI_LONGHORN) - { - REST_NOLOGO3CHANNELNOTIFY, - strExplorer, - strNoMSAppLogo, - SHELL_NO_POLICY - }, -#endif - { - REST_NOFORGETSOFTWAREUPDATE, - strExplorer, - strNoForgetSoftwareUpdate, - SHELL_NO_POLICY - }, - { - REST_NOSETACTIVEDESKTOP, - strExplorer, - strNoSetActiveDesktop, - SHELL_NO_POLICY - }, - { - REST_NOUPDATEWINDOWS, - strExplorer, - strNoWindowsUpdate, - SHELL_NO_POLICY - }, - { - REST_NOCHANGESTARMENU, - strExplorer, - strNoChangeStartMenu, - SHELL_NO_POLICY - }, - { - REST_NOFOLDEROPTIONS, - strExplorer, - strNoFolderOptions, - SHELL_NO_POLICY - }, - { - REST_HASFINDCOMPUTERS, - strExplorer, - "FindComputers", - SHELL_NO_POLICY - }, - { - REST_INTELLIMENUS, - strExplorer, - "IntelliMenus", - SHELL_NO_POLICY - }, - { - REST_RUNDLGMEMCHECKBOX, - strExplorer, - "MemCheckBoxInRunDlg", - SHELL_NO_POLICY - }, - { - REST_ARP_ShowPostSetup, - strAddRemoveProgs, - "ShowPostSetup", - SHELL_NO_POLICY - }, - { - REST_NOCSC, - strExplorer, - "NoSyncAll", - SHELL_NO_POLICY - }, - { - REST_NOCONTROLPANEL, - strExplorer, - "NoControlPanel", - SHELL_NO_POLICY - }, - { - REST_ENUMWORKGROUP, - strExplorer, - "EnumWorkgroup", - SHELL_NO_POLICY - }, - { - REST_ARP_NOARP, - strAddRemoveProgs, - "NoAddRemovePrograms", - SHELL_NO_POLICY - }, - { - REST_ARP_NOREMOVEPAGE, - strAddRemoveProgs, - "NoRemovePage", - SHELL_NO_POLICY - }, - { - REST_ARP_NOADDPAGE, - strAddRemoveProgs, - "NoAddPage", - SHELL_NO_POLICY - }, - { - REST_ARP_NOWINSETUPPAGE, - strAddRemoveProgs, - "NoWindowsSetupPage", - SHELL_NO_POLICY - }, - { - REST_GREYMSIADS, - strExplorer, - "", - SHELL_NO_POLICY - }, - { - REST_NOCHANGEMAPPEDDRIVELABEL, - strExplorer, - "NoChangeMappedDriveLabel", - SHELL_NO_POLICY - }, - { - REST_NOCHANGEMAPPEDDRIVECOMMENT, - strExplorer, - "NoChangeMappedDriveComment", - SHELL_NO_POLICY - }, - { - REST_MaxRecentDocs, - strExplorer, - "MaxRecentDocs", - SHELL_NO_POLICY - }, - { - REST_NONETWORKCONNECTIONS, - strExplorer, - "NoNetworkConnections", - SHELL_NO_POLICY - }, - { - REST_FORCESTARTMENULOGOFF, - strExplorer, - "ForceStartMenuLogoff", - SHELL_NO_POLICY - }, - { - REST_NOWEBVIEW, - strExplorer, - "NoWebView", - SHELL_NO_POLICY - }, - { - REST_NOCUSTOMIZETHISFOLDER, - strExplorer, - "NoCustomizeThisFolder", - SHELL_NO_POLICY - }, - { - REST_NOENCRYPTION, - strExplorer, - "NoEncryption", - SHELL_NO_POLICY - }, - { - REST_ALLOWFRENCHENCRYPTION, - strExplorer, - "AllowFrenchEncryption", - SHELL_NO_POLICY - }, - { - REST_DONTSHOWSUPERHIDDEN, - strExplorer, - "DontShowSuperHidden", - SHELL_NO_POLICY - }, - { - REST_NOSHELLSEARCHBUTTON, - strExplorer, - "NoShellSearchButton", - SHELL_NO_POLICY - }, - { - REST_NOHARDWARETAB, - strExplorer, - "NoHardwareTab", - SHELL_NO_POLICY - }, - { - REST_NORUNASINSTALLPROMPT, - strExplorer, - "NoRunasInstallPrompt", - SHELL_NO_POLICY - }, - { - REST_PROMPTRUNASINSTALLNETPATH, - strExplorer, - "PromptRunasInstallNetPath", - SHELL_NO_POLICY - }, - { - REST_NOMANAGEMYCOMPUTERVERB, - strExplorer, - "NoManageMyComputerVerb", - SHELL_NO_POLICY - }, - { - REST_NORECENTDOCSNETHOOD, - strExplorer, - "NoRecentDocsNetHood", - SHELL_NO_POLICY - }, - { - REST_DISALLOWRUN, - strExplorer, - "DisallowRun", - SHELL_NO_POLICY - }, - { - REST_NOWELCOMESCREEN, - strExplorer, - "NoWelcomeScreen", - SHELL_NO_POLICY - }, - { - REST_RESTRICTCPL, - strExplorer, - "RestrictCpl", - SHELL_NO_POLICY - }, - { - REST_DISALLOWCPL, - strExplorer, - "DisallowCpl", - SHELL_NO_POLICY - }, - { - REST_NOSMBALLOONTIP, - strExplorer, - "NoSMBalloonTip", - SHELL_NO_POLICY - }, - { - REST_NOSMHELP, - strExplorer, - "NoSMHelp", - SHELL_NO_POLICY - }, - { - REST_NOWINKEYS, - strExplorer, - "NoWinKeys", - SHELL_NO_POLICY - }, - { - REST_NOENCRYPTONMOVE, - strExplorer, - "NoEncryptOnMove", - SHELL_NO_POLICY - }, - { - REST_NOLOCALMACHINERUN, - strExplorer, - "DisableLocalMachineRun", - SHELL_NO_POLICY - }, - { - REST_NOCURRENTUSERRUN, - strExplorer, - "DisableCurrentUserRun", - SHELL_NO_POLICY - }, - { - REST_NOLOCALMACHINERUNONCE, - strExplorer, - "DisableLocalMachineRunOnce", - SHELL_NO_POLICY - }, - { - REST_NOCURRENTUSERRUNONCE, - strExplorer, - "DisableCurrentUserRunOnce", - SHELL_NO_POLICY - }, - { - REST_FORCEACTIVEDESKTOPON, - strExplorer, - "ForceActiveDesktopOn", - SHELL_NO_POLICY - }, - { - REST_NOCOMPUTERSNEARME, - strExplorer, - "NoComputersNearMe", - SHELL_NO_POLICY - }, - { - REST_NOVIEWONDRIVE, - strExplorer, - "NoViewOnDrive", - SHELL_NO_POLICY - }, - { - REST_NONETCRAWL, - strExplorer, - "NoNetCrawl", - SHELL_NO_POLICY - }, - { - REST_NOSHAREDDOCUMENTS, - strExplorer, - "NoSharedDocs", - SHELL_NO_POLICY - }, - { - REST_NOSMMYDOCS, - strExplorer, - "NoSMMyDocs", - SHELL_NO_POLICY - }, -/* 0x4000050 - 0x4000060 */ - { - REST_NONLEGACYSHELLMODE, - strExplorer, - "NoneLegacyShellMode", - SHELL_NO_POLICY - }, - { - REST_STARTRUNNOHOMEPATH, - strExplorer, - "StartRunNoHOMEPATH", - SHELL_NO_POLICY - }, -/* 0x4000061 - 0x4000086 */ - { - REST_NODISCONNECT, - strExplorer, - "NoDisconnect", - SHELL_NO_POLICY - }, - { - REST_NOSECURITY, - strExplorer, - "NoNTSecurity", - SHELL_NO_POLICY - }, - { - REST_NOFILEASSOCIATE, - strExplorer, - "NoFileAssociate", - SHELL_NO_POLICY - }, - { - (RESTRICTIONS)0x50000024, - strExplorer, - strNoFileURL, - SHELL_NO_POLICY - }, - { - (RESTRICTIONS)0, - 0, - 0, - SHELL_NO_POLICY - } -}; - -/************************************************************************* - * SHRestricted [SHELL32.100] - * - * Get the value associated with a policy Id. - * - * PARAMS - * pol [I] Policy Id - * - * RETURNS - * The queried value for the policy. - * - * NOTES - * Exported by ordinal. - * This function caches the retrieved values to prevent unnecessary registry access, - * if SHInitRestricted() was previously called. - * - * REFERENCES - * a: MS System Policy Editor. - * b: 98Lite 2.0 (which uses many of these policy keys)
http://www.98lite.net/
- * c: 'The Windows 95 Registry', by John Woram, 1996 MIS: Press - */ -DWORD WINAPI SHRestricted (RESTRICTIONS policy) -{ - char regstr[256]; - HKEY xhkey; - DWORD retval, datsize = 4; - LPPOLICYDATA p; - - TRACE("(%08x)\n", policy); - - /* scan to see if we know this policy ID */ - for (p = sh32_policy_table; p->policy; p++) - { - if (policy == p->policy) - { - break; - } - } - - if (p->policy == 0) - { - /* we don't know this policy, return 0 */ - TRACE("unknown policy: (%08x)\n", policy); - return 0; - } - - /* we have a known policy */ - - /* first check if this policy has been cached, return it if so */ - if (p->cache != SHELL_NO_POLICY) - { - return p->cache; - } - - lstrcpyA(regstr, strRegistryPolicyA); - lstrcatA(regstr, p->appstr); - - /* return 0 and don't set the cache if any registry errors occur */ - retval = 0; - if (RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey) == ERROR_SUCCESS) - { - if (RegQueryValueExA(xhkey, p->keystr, NULL, NULL, (LPBYTE)&retval, &datsize) == ERROR_SUCCESS) - { - p->cache = retval; - } - RegCloseKey(xhkey); - } - return retval; -} - -/************************************************************************* - * SHInitRestricted [SHELL32.244] - * - * Initialise the policy cache to speed up calls to SHRestricted(). - * - * PARAMS - * unused [I] Reserved. - * inpRegKey [I] Registry key to scan. - * - * RETURNS - * Success: -1. The policy cache is initialised. - * Failure: 0, if inpRegKey is any value other than NULL, "Policy", or - * "Software\Microsoft\Windows\CurrentVersion\Policies". - * - * NOTES - * Exported by ordinal. Introduced in Win98. - */ -BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey) -{ - TRACE("(%p, %p)\n", unused, inpRegKey); - - /* first check - if input is non-NULL and points to the secret - key string, then pass. Otherwise return 0. - */ - if (inpRegKey != NULL) - { - if (SHELL_OsIsUnicode()) - { - if (lstrcmpiW((LPCWSTR)inpRegKey, strRegistryPolicyW) && - lstrcmpiW((LPCWSTR)inpRegKey, strPolicyW)) - /* doesn't match, fail */ - return 0; - } - else - { - if (lstrcmpiA((LPCSTR)inpRegKey, strRegistryPolicyA) && - lstrcmpiA((LPCSTR)inpRegKey, strPolicyA)) - /* doesn't match, fail */ - return 0; - } - } - - return TRUE; -} Copied: branches/shell-experiments/dll/win32/shell32/wine/shpolicy.c (from r65215, branches/shell-experiments/dll/win32/shell32/shpolicy.cpp) URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/shpolicy.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/wine/shpolicy.c [iso-8859-1] Mon Nov 3 13:59:23 2014 @@ -29,7 +29,19 @@ * Up to date as of SHELL32 v5.00 (W2K) */ -#include "precomp.h" +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> + +#define WIN32_NO_STATUS +#define _INC_WINDOWS + +#include <windef.h> +#include <winbase.h> +#include <shlobj.h> +#include <wine/debug.h> + +#include "shell32_main.h" WINE_DEFAULT_DEBUG_CHANNEL(shell); @@ -37,7 +49,7 @@ typedef struct tagPOLICYDAT { - RESTRICTIONS policy; /* policy value passed to SHRestricted */ + DWORD policy; /* policy value passed to SHRestricted */ LPCSTR appstr; /* application str such as "Explorer" */ LPCSTR keystr; /* name of the actual registry key / policy */ DWORD cache; /* cached value or 0xffffffff for invalid */ @@ -776,21 +788,21 @@ SHELL_NO_POLICY }, { - (RESTRICTIONS)0x50000024, + 0x50000024, strExplorer, strNoFileURL, SHELL_NO_POLICY }, { - (RESTRICTIONS)0, 0, 0, + 0, SHELL_NO_POLICY } }; /************************************************************************* - * SHRestricted [SHELL32.100] + * SHRestricted [SHELL32.100] * * Get the value associated with a policy Id. * @@ -812,51 +824,51 @@ */ DWORD WINAPI SHRestricted (RESTRICTIONS policy) { - char regstr[256]; - HKEY xhkey; - DWORD retval, datsize = 4; - LPPOLICYDATA p; - - TRACE("(%08x)\n", policy); - - /* scan to see if we know this policy ID */ - for (p = sh32_policy_table; p->policy; p++) - { - if (policy == p->policy) - { - break; - } - } - - if (p->policy == 0) - { - /* we don't know this policy, return 0 */ - TRACE("unknown policy: (%08x)\n", policy); - return 0; - } - - /* we have a known policy */ - - /* first check if this policy has been cached, return it if so */ - if (p->cache != SHELL_NO_POLICY) - { - return p->cache; - } - - lstrcpyA(regstr, strRegistryPolicyA); - lstrcatA(regstr, p->appstr); - - /* return 0 and don't set the cache if any registry errors occur */ - retval = 0; - if (RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey) == ERROR_SUCCESS) - { - if (RegQueryValueExA(xhkey, p->keystr, NULL, NULL, (LPBYTE)&retval, &datsize) == ERROR_SUCCESS) - { - p->cache = retval; - } - RegCloseKey(xhkey); - } - return retval; + char regstr[256]; + HKEY xhkey; + DWORD retval, datsize = 4; + LPPOLICYDATA p; + + TRACE("(%08x)\n", policy); + + /* scan to see if we know this policy ID */ + for (p = sh32_policy_table; p->policy; p++) + { + if (policy == p->policy) + { + break; + } + } + + if (p->policy == 0) + { + /* we don't know this policy, return 0 */ + TRACE("unknown policy: (%08x)\n", policy); + return 0; + } + + /* we have a known policy */ + + /* first check if this policy has been cached, return it if so */ + if (p->cache != SHELL_NO_POLICY) + { + return p->cache; + } + + lstrcpyA(regstr, strRegistryPolicyA); + lstrcatA(regstr, p->appstr); + + /* return 0 and don't set the cache if any registry errors occur */ + retval = 0; + if (RegOpenKeyA(HKEY_CURRENT_USER, regstr, &xhkey) == ERROR_SUCCESS) + { + if (RegQueryValueExA(xhkey, p->keystr, NULL, NULL, (LPBYTE)&retval, &datsize) == ERROR_SUCCESS) + { + p->cache = retval; + } + RegCloseKey(xhkey); + } + return retval; } /************************************************************************* @@ -878,28 +890,28 @@ */ BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey) { - TRACE("(%p, %p)\n", unused, inpRegKey); - - /* first check - if input is non-NULL and points to the secret - key string, then pass. Otherwise return 0. - */ - if (inpRegKey != NULL) - { - if (SHELL_OsIsUnicode()) - { - if (lstrcmpiW((LPCWSTR)inpRegKey, strRegistryPolicyW) && - lstrcmpiW((LPCWSTR)inpRegKey, strPolicyW)) - /* doesn't match, fail */ - return 0; - } - else - { - if (lstrcmpiA((LPCSTR)inpRegKey, strRegistryPolicyA) && - lstrcmpiA((LPCSTR)inpRegKey, strPolicyA)) - /* doesn't match, fail */ - return 0; - } - } - - return TRUE; + TRACE("(%p, %p)\n", unused, inpRegKey); + + /* first check - if input is non-NULL and points to the secret + key string, then pass. Otherwise return 0. + */ + if (inpRegKey != NULL) + { + if (SHELL_OsIsUnicode()) + { + if (lstrcmpiW(inpRegKey, strRegistryPolicyW) && + lstrcmpiW(inpRegKey, strPolicyW)) + /* doesn't match, fail */ + return FALSE; + } + else + { + if (lstrcmpiA(inpRegKey, strRegistryPolicyA) && + lstrcmpiA(inpRegKey, strPolicyA)) + /* doesn't match, fail */ + return FALSE; + } + } + + return TRUE; }
10 years, 1 month
1
0
0
0
[akhaldi] 65222: [SHELL32] * Apply Wine commit e330a128 by Alexandre Julliard: Use Shell_GetImageLists to retrieve image lists instead of using a global variable. CORE-8540
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 3 13:43:01 2014 New Revision: 65222 URL:
http://svn.reactos.org/svn/reactos?rev=65222&view=rev
Log: [SHELL32] * Apply Wine commit e330a128 by Alexandre Julliard: Use Shell_GetImageLists to retrieve image lists instead of using a global variable. CORE-8540 Modified: branches/shell-experiments/dll/win32/shell32/folders/printers.cpp branches/shell-experiments/dll/win32/shell32/iconcache.cpp branches/shell-experiments/dll/win32/shell32/shell32.cpp branches/shell-experiments/dll/win32/shell32/shlview.cpp branches/shell-experiments/dll/win32/shell32/wine/shell32_main.c branches/shell-experiments/dll/win32/shell32/wine/shell32_main.h Modified: branches/shell-experiments/dll/win32/shell32/folders/printers.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/printers.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/printers.cpp [iso-8859-1] Mon Nov 3 13:43:01 2014 @@ -125,17 +125,20 @@ HICON *phiconSmall, UINT nIconSize) { int index; + HIMAGELIST big_icons, small_icons; FIXME("(%p) (file=%p index=%d %p %p size=%x) semi-stub\n", this, debugstr_w(pszFile), (signed)nIconIndex, phiconLarge, phiconSmall, nIconSize); index = SIC_GetIconIndex(pszFile, nIconIndex, 0); + Shell_GetImageLists(&big_icons, &small_icons); + if (phiconLarge) - *phiconLarge = ImageList_GetIcon(ShellBigIconList, index, ILD_TRANSPARENT); + *phiconLarge = ImageList_GetIcon(big_icons, index, ILD_TRANSPARENT); if (phiconSmall) - *phiconSmall = ImageList_GetIcon(ShellSmallIconList, index, ILD_TRANSPARENT); + *phiconSmall = ImageList_GetIcon(small_icons, index, ILD_TRANSPARENT); return S_OK; } Modified: branches/shell-experiments/dll/win32/shell32/iconcache.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/iconcache.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/iconcache.cpp [iso-8859-1] Mon Nov 3 13:43:01 2014 @@ -36,6 +36,9 @@ } SIC_ENTRY, * LPSIC_ENTRY; static HDPA sic_hdpa = 0; + +static HIMAGELIST ShellSmallIconList; +static HIMAGELIST ShellBigIconList; namespace { Modified: branches/shell-experiments/dll/win32/shell32/shell32.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/shell32.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shell32.cpp [iso-8859-1] Mon Nov 3 13:43:01 2014 @@ -233,8 +233,6 @@ * */ HINSTANCE shell32_hInstance; -HIMAGELIST ShellSmallIconList = 0; -HIMAGELIST ShellBigIconList = 0; void *operator new (size_t, void *buf) { Modified: branches/shell-experiments/dll/win32/shell32/shlview.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] Mon Nov 3 13:43:01 2014 @@ -587,6 +587,7 @@ { SHELLDETAILS sd; WCHAR szTemp[50]; + HIMAGELIST big_icons, small_icons; TRACE("%p\n", this); @@ -608,8 +609,9 @@ FIXME("no SF2\n"); } - m_ListView.SetImageList(ShellBigIconList, LVSIL_NORMAL); - m_ListView.SetImageList(ShellSmallIconList, LVSIL_SMALL); + Shell_GetImageLists(&big_icons, &small_icons); + m_ListView.SetImageList(big_icons, LVSIL_NORMAL); + m_ListView.SetImageList(small_icons, LVSIL_SMALL); return TRUE; } Modified: branches/shell-experiments/dll/win32/shell32/wine/shell32_main.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/wine/shell32_main.c [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/wine/shell32_main.c [iso-8859-1] Mon Nov 3 13:43:01 2014 @@ -419,6 +419,7 @@ HRESULT hr = S_OK; BOOL IconNotYetLoaded=TRUE; UINT uGilFlags = 0; + HIMAGELIST big_icons, small_icons; TRACE("%s fattr=0x%x sfi=%p(attr=0x%08x) size=0x%x flags=0x%x\n", (flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes, @@ -557,6 +558,9 @@ } /* ### icons ###*/ + + Shell_GetImageLists( &big_icons, &small_icons ); + if (flags & SHGFI_OPENICON) uGilFlags |= GIL_OPENICON; @@ -701,9 +705,9 @@ if (ret && (flags & SHGFI_SYSICONINDEX)) { if (flags & SHGFI_SMALLICON) - ret = (DWORD_PTR) ShellSmallIconList; + ret = (DWORD_PTR)small_icons; else - ret = (DWORD_PTR) ShellBigIconList; + ret = (DWORD_PTR)big_icons; } } @@ -711,9 +715,9 @@ if (SUCCEEDED(hr) && (flags & SHGFI_ICON) && IconNotYetLoaded) { if (flags & SHGFI_SMALLICON) - psfi->hIcon = ImageList_GetIcon( ShellSmallIconList, psfi->iIcon, ILD_NORMAL); + psfi->hIcon = ImageList_GetIcon( small_icons, psfi->iIcon, ILD_NORMAL); else - psfi->hIcon = ImageList_GetIcon( ShellBigIconList, psfi->iIcon, ILD_NORMAL); + psfi->hIcon = ImageList_GetIcon( big_icons, psfi->iIcon, ILD_NORMAL); } if (flags & ~SHGFI_KNOWN_FLAGS) Modified: branches/shell-experiments/dll/win32/shell32/wine/shell32_main.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/wine/shell32_main.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/wine/shell32_main.h [iso-8859-1] Mon Nov 3 13:43:01 2014 @@ -31,8 +31,6 @@ */ extern HMODULE huser32; extern HINSTANCE shell32_hInstance; -extern HIMAGELIST ShellSmallIconList; -extern HIMAGELIST ShellBigIconList; BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList);
10 years, 1 month
1
0
0
0
[akhaldi] 65221: [SHELL32] * Move shellpath.cpp to the wine folder. * Rename shellpath.cpp to shellpath.c. * Partially sync shellpath.c with Wine 1.7.27. CORE-8540
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 3 13:29:18 2014 New Revision: 65221 URL:
http://svn.reactos.org/svn/reactos?rev=65221&view=rev
Log: [SHELL32] * Move shellpath.cpp to the wine folder. * Rename shellpath.cpp to shellpath.c. * Partially sync shellpath.c with Wine 1.7.27. CORE-8540 Added: branches/shell-experiments/dll/win32/shell32/wine/shellpath.c - copied, changed from r65215, branches/shell-experiments/dll/win32/shell32/shellpath.cpp Removed: branches/shell-experiments/dll/win32/shell32/shellpath.cpp Modified: branches/shell-experiments/dll/win32/shell32/CMakeLists.txt branches/shell-experiments/dll/win32/shell32/dialogs/filedefext.cpp branches/shell-experiments/dll/win32/shell32/openwithmenu.cpp branches/shell-experiments/dll/win32/shell32/pidl.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/shell-experiments/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
Modified: branches/shell-experiments/dll/win32/shell32/dialogs/filedefext.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
Modified: branches/shell-experiments/dll/win32/shell32/openwithmenu.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
Modified: branches/shell-experiments/dll/win32/shell32/pidl.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
Removed: branches/shell-experiments/dll/win32/shell32/shellpath.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
Copied: branches/shell-experiments/dll/win32/shell32/wine/shellpath.c (from r65215, branches/shell-experiments/dll/win32/shell32/shellpath.cpp) URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
10 years, 1 month
1
0
0
0
[jgardou] 65220: [IPHLPAPI] - Start implementing GetAdaptersAddresses. For now it noly gives interface names and DNS servers IP, but that's already more than 'UNIMPLEMENTED'.
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Nov 3 12:55:59 2014 New Revision: 65220 URL:
http://svn.reactos.org/svn/reactos?rev=65220&view=rev
Log: [IPHLPAPI] - Start implementing GetAdaptersAddresses. For now it noly gives interface names and DNS servers IP, but that's already more than 'UNIMPLEMENTED'. Added: trunk/reactos/dll/win32/iphlpapi/address.c (with props) Modified: trunk/reactos/dll/win32/iphlpapi/CMakeLists.txt trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c Modified: trunk/reactos/dll/win32/iphlpapi/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/CMakeLi…
============================================================================== --- trunk/reactos/dll/win32/iphlpapi/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/win32/iphlpapi/CMakeLists.txt [iso-8859-1] Mon Nov 3 12:55:59 2014 @@ -7,6 +7,7 @@ spec2def(iphlpapi.dll iphlpapi.spec ADD_IMPORTLIB) list(APPEND SOURCE + address.c dhcp_reactos.c ifenum_reactos.c ipstats_reactos.c Added: trunk/reactos/dll/win32/iphlpapi/address.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/address…
============================================================================== --- trunk/reactos/dll/win32/iphlpapi/address.c (added) +++ trunk/reactos/dll/win32/iphlpapi/address.c [iso-8859-1] Mon Nov 3 12:55:59 2014 @@ -0,0 +1,514 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS system libraries + * FILE: dll/win32/iphlpapi/address.c + * PURPOSE: iphlpapi implementation - Adapter Address APIs + * PROGRAMMERS: Jérôme Gardou (jerome.gardou(a)reactos.org) + */ + +#include "iphlpapi_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(iphlpapi); + +/* Helper for GetAdaptersAddresses: + * Retrieves the list of network adapters from tcpip.sys */ +static +NTSTATUS +GetInterfacesList( + _In_ HANDLE TcpFile, + _Out_ TDIEntityID **EntityList, + _Out_ ULONG* InterfaceCount) +{ + + TCP_REQUEST_QUERY_INFORMATION_EX TcpQueryInfo; + IO_STATUS_BLOCK StatusBlock; + NTSTATUS Status; + ULONG_PTR BufferSize; + + ZeroMemory(&TcpQueryInfo, sizeof(TcpQueryInfo)); + TcpQueryInfo.ID.toi_class = INFO_CLASS_GENERIC; + TcpQueryInfo.ID.toi_type = INFO_TYPE_PROVIDER; + TcpQueryInfo.ID.toi_id = ENTITY_LIST_ID; + TcpQueryInfo.ID.toi_entity.tei_entity = GENERIC_ENTITY; + TcpQueryInfo.ID.toi_entity.tei_instance = 0; + + Status = NtDeviceIoControlFile( + TcpFile, + NULL, + NULL, + NULL, + &StatusBlock, + IOCTL_TCP_QUERY_INFORMATION_EX, + &TcpQueryInfo, + sizeof(TcpQueryInfo), + NULL, + 0); + if (Status == STATUS_PENDING) + { + /* So we have to wait a bit */ + Status = NtWaitForSingleObject(TcpFile, FALSE, NULL); + if (NT_SUCCESS(Status)) + Status = StatusBlock.Status; + } + + if (!NT_SUCCESS(Status)) + return Status; + + BufferSize = StatusBlock.Information; + *EntityList = HeapAlloc(GetProcessHeap(), 0, BufferSize); + if (!*EntityList) + return STATUS_NO_MEMORY; + + /* Do the real call */ + Status = NtDeviceIoControlFile( + TcpFile, + NULL, + NULL, + NULL, + &StatusBlock, + IOCTL_TCP_QUERY_INFORMATION_EX, + &TcpQueryInfo, + sizeof(TcpQueryInfo), + *EntityList, + BufferSize); + if (Status == STATUS_PENDING) + { + /* So we have to wait a bit */ + Status = NtWaitForSingleObject(TcpFile, FALSE, NULL); + if (NT_SUCCESS(Status)) + Status = StatusBlock.Status; + } + + if (!NT_SUCCESS(Status)) + { + HeapFree(GetProcessHeap(), 0, *EntityList); + return Status; + } + + *InterfaceCount = BufferSize / sizeof(TDIEntityID); + return Status; +} + +#if 0 +static +NTSTATUS +GetSnmpInfo( + _In_ HANDLE TcpFile, + _In_ TDIEntityID InterfaceID, + _Out_ IPSNMPInfo* Info) +{ + TCP_REQUEST_QUERY_INFORMATION_EX TcpQueryInfo; + IO_STATUS_BLOCK StatusBlock; + NTSTATUS Status; + + ZeroMemory(&TcpQueryInfo, sizeof(TcpQueryInfo)); + TcpQueryInfo.ID.toi_class = INFO_CLASS_PROTOCOL; + TcpQueryInfo.ID.toi_type = INFO_TYPE_PROVIDER; + TcpQueryInfo.ID.toi_id = IP_MIB_STATS_ID; + TcpQueryInfo.ID.toi_entity = InterfaceID; + + Status = NtDeviceIoControlFile( + TcpFile, + NULL, + NULL, + NULL, + &StatusBlock, + IOCTL_TCP_QUERY_INFORMATION_EX, + &TcpQueryInfo, + sizeof(TcpQueryInfo), + Info, + sizeof(*Info)); + if (Status == STATUS_PENDING) + { + /* So we have to wait a bit */ + Status = NtWaitForSingleObject(TcpFile, FALSE, NULL); + if (NT_SUCCESS(Status)) + Status = StatusBlock.Status; + } + + return Status; +} +#endif + +/* + * Fills the IFEntry buffer from tcpip.sys. + * The buffer size MUST be FIELD_OFFSET(IFEntry, if_descr[MAX_ADAPTER_DESCRIPTION_LENGTH + 1]). + * See MSDN IFEntry struct definition if you don't believe me. ;-) + */ +static +NTSTATUS +GetInterfaceEntry( + _In_ HANDLE TcpFile, + _In_ TDIEntityID InterfaceID, + _Out_ IFEntry* Entry) +{ + TCP_REQUEST_QUERY_INFORMATION_EX TcpQueryInfo; + IO_STATUS_BLOCK StatusBlock; + NTSTATUS Status; + + ZeroMemory(&TcpQueryInfo, sizeof(TcpQueryInfo)); + TcpQueryInfo.ID.toi_class = INFO_CLASS_PROTOCOL; + TcpQueryInfo.ID.toi_type = INFO_TYPE_PROVIDER; + TcpQueryInfo.ID.toi_id = IP_MIB_STATS_ID; + TcpQueryInfo.ID.toi_entity = InterfaceID; + + Status = NtDeviceIoControlFile( + TcpFile, + NULL, + NULL, + NULL, + &StatusBlock, + IOCTL_TCP_QUERY_INFORMATION_EX, + &TcpQueryInfo, + sizeof(TcpQueryInfo), + Entry, + FIELD_OFFSET(IFEntry, if_descr[MAX_ADAPTER_DESCRIPTION_LENGTH + 1])); + if (Status == STATUS_PENDING) + { + /* So we have to wait a bit */ + Status = NtWaitForSingleObject(TcpFile, FALSE, NULL); + if (NT_SUCCESS(Status)) + Status = StatusBlock.Status; + } + + return Status; +} + +/* Helpers to get the list of DNS for an interface */ +static +VOID +EnumerateServerNameSize( + _In_ PWCHAR Interface, + _In_ PWCHAR NameServer, + _Inout_ PVOID Data) +{ + ULONG* BufferSize = Data; + + /* This is just sizing here */ + UNREFERENCED_PARAMETER(Interface); + UNREFERENCED_PARAMETER(NameServer); + + *BufferSize += sizeof(IP_ADAPTER_DNS_SERVER_ADDRESS) + sizeof(SOCKADDR); +} + +static +VOID +EnumerateServerName( + _In_ PWCHAR Interface, + _In_ PWCHAR NameServer, + _Inout_ PVOID Data) +{ + PIP_ADAPTER_DNS_SERVER_ADDRESS** Ptr = Data; + PIP_ADAPTER_DNS_SERVER_ADDRESS ServerAddress = **Ptr; + + UNREFERENCED_PARAMETER(Interface); + + ServerAddress->Length = sizeof(IP_ADAPTER_DNS_SERVER_ADDRESS); + ServerAddress->Address.lpSockaddr = (PVOID)(ServerAddress + 1); + ServerAddress->Address.iSockaddrLength = sizeof(SOCKADDR); + + + /* Get the address from the server name string */ + //FIXME: Only ipv4 for now... + if (WSAStringToAddressW( + NameServer, + AF_INET, + NULL, + ServerAddress->Address.lpSockaddr, + &ServerAddress->Address.iSockaddrLength)) + { + /* Pass along, name conversion failed */ + ERR("%S is not a valid IP address\n", NameServer); + return; + } + + /* Go to next item */ + ServerAddress->Next = (PVOID)(ServerAddress->Address.lpSockaddr + 1); + *Ptr = &ServerAddress->Next; +} + +DWORD +WINAPI +DECLSPEC_HOTPATCH +GetAdaptersAddresses( + _In_ ULONG Family, + _In_ ULONG Flags, + _In_ PVOID Reserved, + _Inout_ PIP_ADAPTER_ADDRESSES pAdapterAddresses, + _Inout_ PULONG pOutBufLen) +{ + NTSTATUS Status; + HANDLE TcpFile; + TDIEntityID* InterfacesList; + ULONG InterfacesCount; + ULONG AdaptersCount = 0; + ULONG i; + ULONG TotalSize = 0, RemainingSize; + BYTE* Ptr = (BYTE*)pAdapterAddresses; + + FIXME("GetAdaptersAddresses - Semi Stub: Family %u, Flags 0x%08x, Reserved %p, pAdapterAddress %p, pOutBufLen %p.\n", + Family, Flags, Reserved, pAdapterAddresses, pOutBufLen); + + if (!pOutBufLen) + return ERROR_INVALID_PARAMETER; + + if ((Family == AF_INET6) || (Family == AF_UNSPEC)) + { + /* One day maybe... */ + FIXME("IPv6 is not supported in ReactOS!\n"); + if (Family == AF_INET6) + { + /* We got nothing to say in this case */ + return ERROR_NO_DATA; + } + } + + RemainingSize = *pOutBufLen; + if (Ptr) + ZeroMemory(Ptr, RemainingSize); + + /* open the tcpip driver */ + Status = openTcpFile(&TcpFile); + if (!NT_SUCCESS(Status)) + { + ERR("Could not open handle to tcpip.sys. Status %08x\n", Status); + return RtlNtStatusToDosError(Status); + } + + /* Get the interfaces list */ + Status = GetInterfacesList(TcpFile, &InterfacesList, &InterfacesCount); + if (!NT_SUCCESS(Status)) + { + ERR("Could not get adapters list. Status %08x\n", Status); + NtClose(TcpFile); + return RtlNtStatusToDosError(Status); + } + + /* Let's see if we got any adapter. */ + for (i = 0; i < InterfacesCount; i++) + { + PIP_ADAPTER_ADDRESSES CurrentAA = (PIP_ADAPTER_ADDRESSES)Ptr, PreviousAA = NULL; + ULONG CurrentAASize = 0; + + if (InterfacesList[i].tei_entity == IF_ENTITY) + { + BYTE EntryBuffer[FIELD_OFFSET(IFEntry, if_descr[MAX_ADAPTER_DESCRIPTION_LENGTH + 1])]; + IFEntry* Entry = (IFEntry*)EntryBuffer; + + /* Remember we got one */ + AdaptersCount++; + + /* Of course we need some space for the base structure. */ + CurrentAASize = sizeof(IP_ADAPTER_ADDRESSES); + + /* Get the entry */ + Status = GetInterfaceEntry(TcpFile, InterfacesList[i], Entry); + if (!NT_SUCCESS(Status)) + goto Error; + + TRACE("Got entity %*s, index %u.\n", + Entry->if_descrlen, &Entry->if_descr[0], Entry->if_index); + + /* Add the adapter name */ + CurrentAASize += Entry->if_descrlen + sizeof(CHAR); + + /* Add the DNS suffix */ + CurrentAASize += sizeof(WCHAR); + + /* Add the description. */ + CurrentAASize += sizeof(WCHAR); + + if (!(Flags & GAA_FLAG_SKIP_FRIENDLY_NAME)) + { + /* Just an empty string for now. */ + FIXME("Should get adapter friendly name.\n"); + CurrentAASize += sizeof(WCHAR); + } + + if (!(Flags & GAA_FLAG_SKIP_DNS_SERVER)) + { + /* Enumerate the name servers */ + HKEY InterfaceKey; + CHAR KeyName[256]; + + snprintf(KeyName, 256, + "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\%*s", + Entry->if_descrlen, &Entry->if_descr[0]); + + if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, KeyName, 0, KEY_READ, &InterfaceKey) != ERROR_SUCCESS) + { + ERR("Failed opening interface key for interface %*s\n", Entry->if_descrlen, &Entry->if_descr[0]); + Flags |= GAA_FLAG_SKIP_DNS_SERVER; + } + else + { + EnumNameServers(InterfaceKey, NULL, &CurrentAASize, EnumerateServerNameSize); + RegCloseKey(InterfaceKey); + } + } + + /* This is part of what we will need */ + TotalSize += CurrentAASize; + + /* Fill in the data */ + if ((CurrentAA) && (RemainingSize >= CurrentAASize)) + { + CurrentAA->Length = sizeof(IP_ADAPTER_ADDRESSES); + CurrentAA->IfIndex = Entry->if_index; + CopyMemory(CurrentAA->PhysicalAddress, Entry->if_physaddr, Entry->if_physaddrlen); + CurrentAA->PhysicalAddressLength = Entry->if_physaddrlen; + CurrentAA->Flags = 0; // FIXME! + CurrentAA->Mtu = Entry->if_mtu; + CurrentAA->IfType = Entry->if_type; + CurrentAA->OperStatus = Entry->if_operstatus; + CurrentAA->Next = PreviousAA; + /* Next items */ + Ptr = (BYTE*)(CurrentAA + 1); + + /* Now fill in the name */ + CopyMemory(Ptr, &Entry->if_descr[0], Entry->if_descrlen); + CurrentAA->AdapterName = (PCHAR)Ptr; + CurrentAA->AdapterName[Entry->if_descrlen] = '\0'; + /* Next items */ + Ptr = (BYTE*)(CurrentAA->AdapterName + Entry->if_descrlen + 1); + + /* The DNS suffix */ + CurrentAA->DnsSuffix = (PWCHAR)Ptr; + CurrentAA->DnsSuffix[0] = L'\0'; + /* Next items */ + Ptr = (BYTE*)(CurrentAA->DnsSuffix + 1); + + /* The description */ + CurrentAA->Description = (PWCHAR)Ptr; + CurrentAA->Description[0] = L'\0'; + /* Next items */ + Ptr = (BYTE*)(CurrentAA->Description + 1); + + /* The friendly name */ + if (!(Flags & GAA_FLAG_SKIP_FRIENDLY_NAME)) + { + CurrentAA->FriendlyName = (PWCHAR)Ptr; + CurrentAA->FriendlyName[0] = L'\0'; + /* Next items */ + Ptr = (BYTE*)(CurrentAA->FriendlyName + 1); + } + + /* The DNS Servers */ + if (!(Flags & GAA_FLAG_SKIP_DNS_SERVER)) + { + /* Enumerate the name servers */ + HKEY InterfaceKey; + CHAR KeyName[256]; + + snprintf(KeyName, 256, + "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\%*s", + Entry->if_descrlen, &Entry->if_descr[0]); + + if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, KeyName, 0, KEY_READ, &InterfaceKey) != ERROR_SUCCESS) + { + ERR("Failed opening interface key for interface %*s\n", Entry->if_descrlen, &Entry->if_descr[0]); + } + else + { + PIP_ADAPTER_DNS_SERVER_ADDRESS* ServerAddressPtr; + + CurrentAA->FirstDnsServerAddress = (PIP_ADAPTER_DNS_SERVER_ADDRESS)Ptr; + ServerAddressPtr = &CurrentAA->FirstDnsServerAddress; + + EnumNameServers(InterfaceKey, NULL, &ServerAddressPtr, EnumerateServerName); + RegCloseKey(InterfaceKey); + + /* Set the last entry in the list as having NULL next member */ + Ptr = (BYTE*)*ServerAddressPtr; + *ServerAddressPtr = NULL; + } + } + + /* We're done for this interface */ + PreviousAA = CurrentAA; + RemainingSize -= CurrentAASize; + } + } + } + + if (AdaptersCount == 0) + { + /* Uh? Not even localhost ?! */ + ERR("No Adapters found!\n"); + *pOutBufLen = 0; + return ERROR_NO_DATA; + } + +/* Disabled for now until someone knows how to differentiate unicast/multicast whatver adresses */ +#if 0 + /* See what we will fill our buffer with */ + for (i = 0; i < InterfacesCount; i++) + { + /* Look for network layers */ + if ((InterfacesList[i].tei_entity == CL_TL_ENTITY) + || (InterfacesList[i].tei_entity == CO_TL_ENTITY)) + { + IPSNMPInfo SnmpInfo; + PIP_ADAPTER_ADDRESSES CurrentAA = NULL; + IPAddrEntry* AddrEntries; + ULONG j; + + /* Get its SNMP info */ + Status = GetSnmpInfo(TcpFile, InterfacesList[i], &SnmpInfo); + if (!NT_SUCCESS(Status)) + goto Error; + + /* Allocate the address entry array and get them */ + AddrEntries = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + SnmpInfo.ipsi_numaddr * sizeof(AddrEntries[0])); + if (!AddrEntries) + { + Status = STATUS_NO_MEMORY; + goto Error; + } + Status = GetAddrEntries(TcpFile, InterfacesList[i], AddrEntries, SnmpInfo.ipsi_numaddr); + if (!NT_SUCCESS(Status)) + { + HeapFree(GetProcessHeap(), 0, AddrEntries); + goto Error; + } + + for (j = 0; j < SnmpInfo.ipsi_numaddr; j++) + { + /* Find the adapters struct for this address. */ + if (pAdapterAddresses) + { + CurrentAA = pAdapterAddresses; + while (CurrentAA) + { + if (CurrentAA->IfIndex == AddrEntries[j].iae_index) + break; + } + + if (!CurrentAA) + { + ERR("Got address for interface %u but no adapter was found for it.\n", AddrEntries[j].iae_index); + /* Go to the next address */ + continue; + } + } + } + + } + } +#endif + + /* We're done */ + HeapFree(GetProcessHeap(), 0, InterfacesList); + NtClose(TcpFile); + *pOutBufLen = TotalSize; + return ERROR_SUCCESS; + +Error: + ERR("Failed! Status 0x%08x\n", Status); + *pOutBufLen = 0; + HeapFree(GetProcessHeap(), 0, InterfacesList); + NtClose(TcpFile); + return RtlNtStatusToDosError(Status); +} Propchange: trunk/reactos/dll/win32/iphlpapi/address.c ------------------------------------------------------------------------------ charset = UTF-8 Propchange: trunk/reactos/dll/win32/iphlpapi/address.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: trunk/reactos/dll/win32/iphlpapi/address.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/iphlpapi/iphlpap…
============================================================================== --- trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/iphlpapi/iphlpapi_main.c [iso-8859-1] Mon Nov 3 12:55:59 2014 @@ -2281,9 +2281,9 @@ /* * @implemented */ +#if 0 DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVOID Reserved,PIP_ADAPTER_ADDRESSES pAdapterAddresses,PULONG pOutBufLen) { -#if 0 InterfaceIndexTable *indexTable; IFInfo ifInfo; int i; @@ -2470,16 +2470,8 @@ free(indexTable); return NO_ERROR; -#else - if (!pOutBufLen) return ERROR_INVALID_PARAMETER; - if (!pAdapterAddresses || *pOutBufLen == 0) - return ERROR_BUFFER_OVERFLOW; - if (Reserved) return ERROR_INVALID_PARAMETER; - - FIXME(":stub\n"); - return ERROR_NO_DATA; +} #endif -} /* * @unimplemented
10 years, 1 month
1
0
0
0
[jgardou] 65219: [PSDK] - Add missing GAA_FLAG_* flags for GetAdaptersAddresses function
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Nov 3 12:55:54 2014 New Revision: 65219 URL:
http://svn.reactos.org/svn/reactos?rev=65219&view=rev
Log: [PSDK] - Add missing GAA_FLAG_* flags for GetAdaptersAddresses function Modified: trunk/reactos/include/psdk/iptypes.h Modified: trunk/reactos/include/psdk/iptypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/iptypes.h?rev…
============================================================================== --- trunk/reactos/include/psdk/iptypes.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/iptypes.h [iso-8859-1] Mon Nov 3 12:55:54 2014 @@ -190,6 +190,14 @@ DWORD ZoneIndices[16]; PIP_ADAPTER_PREFIX FirstPrefix; } IP_ADAPTER_ADDRESSES, *PIP_ADAPTER_ADDRESSES; + +#define GAA_FLAG_SKIP_UNICAST 0x00000001 +#define GAA_FLAG_SKIP_ANYCAST 0x00000002 +#define GAA_FLAG_SKIP_MULTICAST 0x00000004 +#define GAA_FLAG_SKIP_DNS_SERVER 0x00000008 +#define GAA_FLAG_INCLUDE_PREFIX 0x00000010 +#define GAA_FLAG_SKIP_FRIENDLY_NAME 0x00000020 + #endif #ifdef __cplusplus
10 years, 1 month
1
0
0
0
[jgardou] 65218: [TCPIP] - Use the structure defined in the public headers instead of some strange internal thing. Uppercase is not so fashionable after all.
by jgardou@svn.reactos.org
Author: jgardou Date: Mon Nov 3 12:55:45 2014 New Revision: 65218 URL:
http://svn.reactos.org/svn/reactos?rev=65218&view=rev
Log: [TCPIP] - Use the structure defined in the public headers instead of some strange internal thing. Uppercase is not so fashionable after all. Modified: trunk/reactos/drivers/network/tcpip/include/info.h trunk/reactos/drivers/network/tcpip/tcpip/iinfo.c Modified: trunk/reactos/drivers/network/tcpip/include/info.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/incl…
============================================================================== --- trunk/reactos/drivers/network/tcpip/include/info.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/include/info.h [iso-8859-1] Mon Nov 3 12:55:45 2014 @@ -76,31 +76,6 @@ ULONG Metric5; ULONG Info; } IPROUTE_ENTRY, *PIPROUTE_ENTRY; - -typedef struct IFENTRY { - ULONG Index; - ULONG Type; - ULONG Mtu; - ULONG Speed; - ULONG PhysAddrLen; - UCHAR PhysAddr[MAX_PHYSADDR_LEN]; - ULONG AdminStatus; - ULONG OperStatus; - ULONG LastChange; - ULONG InOctets; - ULONG InUcastPackets; - ULONG InNUcastPackets; - ULONG InDiscards; - ULONG InErrors; - ULONG InUnknownProtos; - ULONG OutOctets; - ULONG OutUcastPackets; - ULONG OutNUcastPackets; - ULONG OutDiscards; - ULONG OutErrors; - ULONG OutQLen; - ULONG DescrLen; -} IFENTRY, *PIFENTRY; /* Only UDP is supported */ #define TDI_SERVICE_FLAGS (TDI_SERVICE_CONNECTIONLESS_MODE | \ Modified: trunk/reactos/drivers/network/tcpip/tcpip/iinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
============================================================================== --- trunk/reactos/drivers/network/tcpip/tcpip/iinfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/tcpip/tcpip/iinfo.c [iso-8859-1] Mon Nov 3 12:55:45 2014 @@ -12,16 +12,18 @@ #include <ipifcons.h> +/* See iptypes.h */ +#define MAX_ADAPTER_DESCRIPTION_LENGTH 128 + TDI_STATUS InfoTdiQueryGetInterfaceMIB(TDIEntityID ID, PIP_INTERFACE Interface, PNDIS_BUFFER Buffer, PUINT BufferSize) { TDI_STATUS Status = TDI_INVALID_REQUEST; - PIFENTRY OutData; + IFEntry* OutData; PLAN_ADAPTER IF; PCHAR IFDescr; ULONG Size; - UINT DescrLenMax = MAX_IFDESCR_LEN - 1; NDIS_STATUS NdisStatus; if (!Interface) @@ -33,69 +35,65 @@ ("Getting IFEntry MIB (IF %08x LA %08x) (%04x:%d)\n", Interface, IF, ID.tei_entity, ID.tei_instance)); - OutData = - (PIFENTRY)ExAllocatePool( NonPagedPool, - sizeof(IFENTRY) + MAX_IFDESCR_LEN ); + OutData = ExAllocatePool( NonPagedPool, FIELD_OFFSET(IFEntry, if_descr[MAX_ADAPTER_DESCRIPTION_LENGTH + 1])); if( !OutData ) return TDI_NO_RESOURCES; /* Out of memory */ - RtlZeroMemory( OutData, sizeof(IFENTRY) + MAX_IFDESCR_LEN ); + RtlZeroMemory( OutData, FIELD_OFFSET(IFEntry, if_descr[MAX_ADAPTER_DESCRIPTION_LENGTH + 1])); - OutData->Index = Interface->Index; + OutData->if_index = Interface->Index; /* viz: tcpip keeps those indices */ - OutData->Type = Interface == + OutData->if_type = Interface == Loopback ? MIB_IF_TYPE_LOOPBACK : MIB_IF_TYPE_ETHERNET; - OutData->Mtu = Interface->MTU; + OutData->if_mtu = Interface->MTU; TI_DbgPrint(DEBUG_INFO, ("Getting interface speed\n")); - OutData->PhysAddrLen = Interface->AddressLength; - OutData->AdminStatus = MIB_IF_ADMIN_STATUS_UP; + OutData->if_physaddrlen = Interface->AddressLength; + OutData->if_adminstatus = MIB_IF_ADMIN_STATUS_UP; /* NDIS_HARDWARE_STATUS -> ROUTER_CONNECTION_STATE */ - Status = GetInterfaceConnectionStatus( Interface, &OutData->OperStatus ); + Status = GetInterfaceConnectionStatus( Interface, &OutData->if_operstatus ); /* Not sure what to do here, but not ready seems a safe bet on failure */ if( !NT_SUCCESS(Status) ) - OutData->OperStatus = NdisHardwareStatusNotReady; + OutData->if_operstatus = NdisHardwareStatusNotReady; - IFDescr = (PCHAR)&OutData[1]; + IFDescr = (PCHAR)&OutData->if_descr[0]; if( IF ) { - GetInterfaceSpeed( Interface, (PUINT)&OutData->Speed ); + GetInterfaceSpeed( Interface, (PUINT)&OutData->if_speed ); TI_DbgPrint(DEBUG_INFO, - ("IF Speed = %d * 100bps\n", OutData->Speed)); - memcpy(OutData->PhysAddr,Interface->Address,Interface->AddressLength); + ("IF Speed = %d * 100bps\n", OutData->if_speed)); + memcpy(OutData->if_physaddr, Interface->Address, Interface->AddressLength); TI_DbgPrint(DEBUG_INFO, ("Got HWAddr\n")); - memcpy(&OutData->InOctets, &Interface->Stats, sizeof(SEND_RECV_STATS)); + memcpy(&OutData->if_inoctets, &Interface->Stats, sizeof(SEND_RECV_STATS)); NdisStatus = NDISCall(IF, NdisRequestQueryInformation, OID_GEN_XMIT_ERROR, - &OutData->OutErrors, + &OutData->if_outerrors, sizeof(ULONG)); if (NdisStatus != NDIS_STATUS_SUCCESS) - OutData->OutErrors = 0; + OutData->if_outerrors = 0; - TI_DbgPrint(DEBUG_INFO, ("OutErrors = %d\n", OutData->OutErrors)); + TI_DbgPrint(DEBUG_INFO, ("OutErrors = %d\n", OutData->if_outerrors)); NdisStatus = NDISCall(IF, NdisRequestQueryInformation, OID_GEN_RCV_ERROR, - &OutData->InErrors, + &OutData->if_inerrors, sizeof(ULONG)); if (NdisStatus != NDIS_STATUS_SUCCESS) - OutData->InErrors = 0; + OutData->if_inerrors = 0; - TI_DbgPrint(DEBUG_INFO, ("InErrors = %d\n", OutData->InErrors)); + TI_DbgPrint(DEBUG_INFO, ("InErrors = %d\n", OutData->if_inerrors)); } - GetInterfaceName( Interface, IFDescr, MAX_IFDESCR_LEN - 1 ); - DescrLenMax = strlen( IFDescr ) + 1; + GetInterfaceName( Interface, IFDescr, MAX_ADAPTER_DESCRIPTION_LENGTH ); TI_DbgPrint(DEBUG_INFO, ("Copied in name %s\n", IFDescr)); - OutData->DescrLen = DescrLenMax; - IFDescr += DescrLenMax; - Size = IFDescr - (PCHAR)OutData + 1; + OutData->if_descrlen = strlen(IFDescr); + Size = FIELD_OFFSET(IFEntry, if_descr[OutData->if_descrlen + 1]); TI_DbgPrint(DEBUG_INFO, ("Finished IFEntry MIB (%04x:%d) size %d\n", ID.tei_entity, ID.tei_instance, Size));
10 years, 1 month
1
0
0
0
[akhaldi] 65217: [SHELL32] * Move shell32_main.cpp to the wine folder. * Rename shell32_main.cpp to shell32_main.c. * Partially sync shell32_main.c with Wine 1.7.27. * Update the location of shell3...
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 3 12:17:30 2014 New Revision: 65217 URL:
http://svn.reactos.org/svn/reactos?rev=65217&view=rev
Log: [SHELL32] * Move shell32_main.cpp to the wine folder. * Rename shell32_main.cpp to shell32_main.c. * Partially sync shell32_main.c with Wine 1.7.27. * Update the location of shell32_main.h in inclusions. CORE-8540 Added: branches/shell-experiments/dll/win32/shell32/wine/shell32_main.c - copied, changed from r65215, branches/shell-experiments/dll/win32/shell32/shell32_main.cpp branches/shell-experiments/dll/win32/shell32/wine/shell32_main.h - copied, changed from r65212, branches/shell-experiments/dll/win32/shell32/shell32_main.h Removed: branches/shell-experiments/dll/win32/shell32/shell32_main.cpp branches/shell-experiments/dll/win32/shell32/shell32_main.h Modified: branches/shell-experiments/dll/win32/shell32/CMakeLists.txt branches/shell-experiments/dll/win32/shell32/precomp.h branches/shell-experiments/dll/win32/shell32/wine/shellole.c Modified: branches/shell-experiments/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Mon Nov 3 12:17:30 2014 @@ -42,7 +42,6 @@ iconcache.cpp pidl.cpp shell32.cpp - shell32_main.cpp shellitem.cpp shelllink.cpp shellord.cpp @@ -76,6 +75,7 @@ add_library(shell32 SHARED ${SOURCE} + wine/shell32_main.c wine/shellole.c wine/shellstring.c vista.c Modified: branches/shell-experiments/dll/win32/shell32/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/precomp.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/precomp.h [iso-8859-1] Mon Nov 3 12:17:30 2014 @@ -37,7 +37,7 @@ #include "pidl.h" #include "debughlp.h" #include "undocshell.h" -#include "shell32_main.h" +#include "wine/shell32_main.h" #include "shresdef.h" #include "cpanel.h" #include "enumidlist.h" Removed: branches/shell-experiments/dll/win32/shell32/shell32_main.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/shell32_main.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shell32_main.cpp (removed) @@ -1,1343 +0,0 @@ -/* - * Shell basics - * - * Copyright 1998 Marcus Meissner - * Copyright 1998 Juergen Schmied (jsch) * <juergen.schmied(a)metronet.de> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "precomp.h" - -#include <reactos/version.h> - -WINE_DEFAULT_DEBUG_CHANNEL(shell); - -const char * const SHELL_Authors[] = { "Copyright 1993-"COPYRIGHT_YEAR" WINE team", "Copyright 1998-"COPYRIGHT_YEAR" ReactOS Team", 0 }; - -#define MORE_DEBUG 1 -/************************************************************************* - * CommandLineToArgvW [SHELL32.@] - * - * We must interpret the quotes in the command line to rebuild the argv - * array correctly: - * - arguments are separated by spaces or tabs - * - quotes serve as optional argument delimiters - * '"a b"' -> 'a b' - * - escaped quotes must be converted back to '"' - * '\"' -> '"' - * - consecutive backslashes preceding a quote see their number halved with - * the remainder escaping the quote: - * 2n backslashes + quote -> n backslashes + quote as an argument delimiter - * 2n+1 backslashes + quote -> n backslashes + literal quote - * - backslashes that are not followed by a quote are copied literally: - * 'a\b' -> 'a\b' - * 'a\\b' -> 'a\\b' - * - in quoted strings, consecutive quotes see their number divided by three - * with the remainder modulo 3 deciding whether to close the string or not. - * Note that the opening quote must be counted in the consecutive quotes, - * that's the (1+) below: - * (1+) 3n quotes -> n quotes - * (1+) 3n+1 quotes -> n quotes plus closes the quoted string - * (1+) 3n+2 quotes -> n+1 quotes plus closes the quoted string - * - in unquoted strings, the first quote opens the quoted string and the - * remaining consecutive quotes follow the above rule. - */ -LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCmdline, int* numargs) -{ - DWORD argc; - LPWSTR *argv; - LPCWSTR s; - LPWSTR d; - LPWSTR cmdline; - int qcount,bcount; - - if(!numargs) - { - SetLastError(ERROR_INVALID_PARAMETER); - return NULL; - } - - if (*lpCmdline==0) - { - /* Return the path to the executable */ - DWORD len, deslen=MAX_PATH, size; - - size = sizeof(LPWSTR) + deslen*sizeof(WCHAR) + sizeof(LPWSTR); - for (;;) - { - if (!(argv = (LPWSTR *)LocalAlloc(LMEM_FIXED, size))) return NULL; - len = GetModuleFileNameW(0, (LPWSTR)(argv+1), deslen); - if (!len) - { - LocalFree(argv); - return NULL; - } - if (len < deslen) break; - deslen*=2; - size = sizeof(LPWSTR) + deslen*sizeof(WCHAR) + sizeof(LPWSTR); - LocalFree( argv ); - } - argv[0]=(LPWSTR)(argv+1); - *numargs=1; - - return argv; - } - - /* --- First count the arguments */ - argc=1; - s=lpCmdline; - /* The first argument, the executable path, follows special rules */ - if (*s=='"') - { - /* The executable path ends at the next quote, no matter what */ - s++; - while (*s) - if (*s++=='"') - break; - } - else - { - /* The executable path ends at the next space, no matter what */ - while (*s && *s!=' ' && *s!='\t') - s++; - } - /* skip to the first argument, if any */ - while (*s==' ' || *s=='\t') - s++; - if (*s) - argc++; - - /* Analyze the remaining arguments */ - qcount=bcount=0; - while (*s) - { - if ((*s==' ' || *s=='\t') && qcount==0) - { - /* skip to the next argument and count it if any */ - while (*s==' ' || *s=='\t') - s++; - if (*s) - argc++; - bcount=0; - } - else if (*s=='\\') - { - /* '\', count them */ - bcount++; - s++; - } - else if (*s=='"') - { - /* '"' */ - if ((bcount & 1)==0) - qcount++; /* unescaped '"' */ - s++; - bcount=0; - /* consecutive quotes, see comment in copying code below */ - while (*s=='"') - { - qcount++; - s++; - } - qcount=qcount % 3; - if (qcount==2) - qcount=0; - } - else - { - /* a regular character */ - bcount=0; - s++; - } - } - - /* Allocate in a single lump, the string array, and the strings that go - * with it. This way the caller can make a single LocalFree() call to free - * both, as per MSDN. - */ - argv=(LPWSTR *)LocalAlloc(LMEM_FIXED, argc*sizeof(LPWSTR)+(strlenW(lpCmdline)+1)*sizeof(WCHAR)); - if (!argv) - return NULL; - cmdline=(LPWSTR)(argv+argc); - strcpyW(cmdline, lpCmdline); - - /* --- Then split and copy the arguments */ - argv[0]=d=cmdline; - argc=1; - /* The first argument, the executable path, follows special rules */ - if (*d=='"') - { - /* The executable path ends at the next quote, no matter what */ - s=d+1; - while (*s) - { - if (*s=='"') - { - s++; - break; - } - *d++=*s++; - } - } - else - { - /* The executable path ends at the next space, no matter what */ - while (*d && *d!=' ' && *d!='\t') - d++; - s=d; - if (*s) - s++; - } - /* close the executable path */ - *d++=0; - /* skip to the first argument and initialize it if any */ - while (*s==' ' || *s=='\t') - s++; - if (!*s) - { - /* There are no parameters so we are all done */ - *numargs=argc; - return argv; - } - - /* Split and copy the remaining arguments */ - argv[argc++]=d; - qcount=bcount=0; - while (*s) - { - if ((*s==' ' || *s=='\t') && qcount==0) - { - /* close the argument */ - *d++=0; - bcount=0; - - /* skip to the next one and initialize it if any */ - do { - s++; - } while (*s==' ' || *s=='\t'); - if (*s) - argv[argc++]=d; - } - else if (*s=='\\') - { - *d++=*s++; - bcount++; - } - else if (*s=='"') - { - if ((bcount & 1)==0) - { - /* Preceded by an even number of '\', this is half that - * number of '\', plus a quote which we erase. - */ - d-=bcount/2; - qcount++; - } - else - { - /* Preceded by an odd number of '\', this is half that - * number of '\' followed by a '"' - */ - d=d-bcount/2-1; - *d++='"'; - } - s++; - bcount=0; - /* Now count the number of consecutive quotes. Note that qcount - * already takes into account the opening quote if any, as well as - * the quote that lead us here. - */ - while (*s=='"') - { - if (++qcount==3) - { - *d++='"'; - qcount=0; - } - s++; - } - if (qcount==2) - qcount=0; - } - else - { - /* a regular character */ - *d++=*s++; - bcount=0; - } - } - *d='\0'; - *numargs=argc; - - return argv; -} - -static DWORD shgfi_get_exe_type(LPCWSTR szFullPath) -{ - BOOL status = FALSE; - HANDLE hfile; - DWORD BinaryType; - IMAGE_DOS_HEADER mz_header; - IMAGE_NT_HEADERS nt; - DWORD len; - char magic[4]; - - status = GetBinaryTypeW (szFullPath, &BinaryType); - if (!status) - return 0; - if (BinaryType == SCS_DOS_BINARY || BinaryType == SCS_PIF_BINARY) - return 0x4d5a; - - hfile = CreateFileW( szFullPath, GENERIC_READ, FILE_SHARE_READ, - NULL, OPEN_EXISTING, 0, 0 ); - if ( hfile == INVALID_HANDLE_VALUE ) - return 0; - - /* - * The next section is adapted from MODULE_GetBinaryType, as we need - * to examine the image header to get OS and version information. We - * know from calling GetBinaryTypeA that the image is valid and either - * an NE or PE, so much error handling can be omitted. - * Seek to the start of the file and read the header information. - */ - - SetFilePointer( hfile, 0, NULL, SEEK_SET ); - ReadFile( hfile, &mz_header, sizeof(mz_header), &len, NULL ); - - SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); - ReadFile( hfile, magic, sizeof(magic), &len, NULL ); - - if ( *(DWORD*)magic == IMAGE_NT_SIGNATURE ) - { - SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); - ReadFile( hfile, &nt, sizeof(nt), &len, NULL ); - CloseHandle( hfile ); - - /* DLL files are not executable and should return 0 */ - if (nt.FileHeader.Characteristics & IMAGE_FILE_DLL) - return 0; - - if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) - { - return IMAGE_NT_SIGNATURE | - (nt.OptionalHeader.MajorSubsystemVersion << 24) | - (nt.OptionalHeader.MinorSubsystemVersion << 16); - } - return IMAGE_NT_SIGNATURE; - } - else if ( *(WORD*)magic == IMAGE_OS2_SIGNATURE ) - { - IMAGE_OS2_HEADER ne; - SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); - ReadFile( hfile, &ne, sizeof(ne), &len, NULL ); - CloseHandle( hfile ); - - if (ne.ne_exetyp == 2) - return IMAGE_OS2_SIGNATURE | (ne.ne_expver << 16); - return 0; - } - CloseHandle( hfile ); - return 0; -} - -/************************************************************************* - * SHELL_IsShortcut [internal] - * - * Decide if an item id list points to a shell shortcut - */ -BOOL SHELL_IsShortcut(LPCITEMIDLIST pidlLast) -{ - char szTemp[MAX_PATH]; - HKEY keyCls; - BOOL ret = FALSE; - - if (_ILGetExtension(pidlLast, szTemp, MAX_PATH) && - HCR_MapTypeToValueA(szTemp, szTemp, MAX_PATH, TRUE)) - { - if (ERROR_SUCCESS == RegOpenKeyExA(HKEY_CLASSES_ROOT, szTemp, 0, KEY_QUERY_VALUE, &keyCls)) - { - if (ERROR_SUCCESS == RegQueryValueExA(keyCls, "IsShortcut", NULL, NULL, NULL, NULL)) - ret = TRUE; - - RegCloseKey(keyCls); - } - } - - return ret; -} - -#define SHGFI_KNOWN_FLAGS \ - (SHGFI_SMALLICON | SHGFI_OPENICON | SHGFI_SHELLICONSIZE | SHGFI_PIDL | \ - SHGFI_USEFILEATTRIBUTES | SHGFI_ADDOVERLAYS | SHGFI_OVERLAYINDEX | \ - SHGFI_ICON | SHGFI_DISPLAYNAME | SHGFI_TYPENAME | SHGFI_ATTRIBUTES | \ - SHGFI_ICONLOCATION | SHGFI_EXETYPE | SHGFI_SYSICONINDEX | \ - SHGFI_LINKOVERLAY | SHGFI_SELECTED | SHGFI_ATTR_SPECIFIED) - -/************************************************************************* - * SHGetFileInfoW [SHELL32.@] - * - */ -DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, - SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags ) -{ - WCHAR szLocation[MAX_PATH], szFullPath[MAX_PATH]; - int iIndex; - DWORD_PTR ret = TRUE; - DWORD dwAttributes = 0; - CComPtr<IShellFolder> psfParent; - CComPtr<IExtractIconW> pei; - LPITEMIDLIST pidlLast = NULL, pidl = NULL; - HRESULT hr = S_OK; - BOOL IconNotYetLoaded=TRUE; - UINT uGilFlags = 0; - - TRACE("%s fattr=0x%x sfi=%p(attr=0x%08x) size=0x%x flags=0x%x\n", - (flags & SHGFI_PIDL)? "pidl" : debugstr_w(path), dwFileAttributes, - psfi, psfi->dwAttributes, sizeofpsfi, flags); - - if (!path) - return FALSE; - - /* windows initializes these values regardless of the flags */ - if (psfi != NULL) - { - psfi->szDisplayName[0] = '\0'; - psfi->szTypeName[0] = '\0'; - psfi->iIcon = 0; - } - - if (!(flags & SHGFI_PIDL)) - { - /* SHGetFileInfo should work with absolute and relative paths */ - if (PathIsRelativeW(path)) - { - GetCurrentDirectoryW(MAX_PATH, szLocation); - PathCombineW(szFullPath, szLocation, path); - } - else - { - lstrcpynW(szFullPath, path, MAX_PATH); - } - } - - if (flags & SHGFI_EXETYPE) - { - if (flags != SHGFI_EXETYPE) - return 0; - return shgfi_get_exe_type(szFullPath); - } - - /* - * psfi is NULL normally to query EXE type. If it is NULL, none of the - * below makes sense anyway. Windows allows this and just returns FALSE - */ - if (psfi == NULL) - return FALSE; - - /* - * translate the path into a pidl only when SHGFI_USEFILEATTRIBUTES - * is not specified. - * The pidl functions fail on not existing file names - */ - - if (flags & SHGFI_PIDL) - { - pidl = ILClone((LPCITEMIDLIST)path); - } - else if (!(flags & SHGFI_USEFILEATTRIBUTES)) - { - hr = SHILCreateFromPathW(szFullPath, &pidl, &dwAttributes); - } - - if ((flags & SHGFI_PIDL) || !(flags & SHGFI_USEFILEATTRIBUTES)) - { - /* get the parent shellfolder */ - if (pidl) - { - hr = SHBindToParent( pidl, IID_PPV_ARG(IShellFolder, &psfParent), - (LPCITEMIDLIST*)&pidlLast ); - if (SUCCEEDED(hr)) - pidlLast = ILClone(pidlLast); - ILFree(pidl); - } - else - { - ERR("pidl is null!\n"); - return FALSE; - } - } - - /* get the attributes of the child */ - if (SUCCEEDED(hr) && (flags & SHGFI_ATTRIBUTES)) - { - if (!(flags & SHGFI_ATTR_SPECIFIED)) - { - psfi->dwAttributes = 0xffffffff; - } - if (psfParent != NULL) - psfParent->GetAttributesOf(1, (LPCITEMIDLIST*)&pidlLast, - &(psfi->dwAttributes) ); - } - - /* get the displayname */ - if (SUCCEEDED(hr) && (flags & SHGFI_DISPLAYNAME)) - { - if (flags & SHGFI_USEFILEATTRIBUTES) - { - wcscpy (psfi->szDisplayName, PathFindFileNameW(szFullPath)); - } - else - { - STRRET str; - hr = psfParent->GetDisplayNameOf(pidlLast, - SHGDN_INFOLDER, &str); - StrRetToStrNW (psfi->szDisplayName, MAX_PATH, &str, pidlLast); - } - } - - /* get the type name */ - if (SUCCEEDED(hr) && (flags & SHGFI_TYPENAME)) - { - static const WCHAR szFile[] = { 'F','i','l','e',0 }; - static const WCHAR szDashFile[] = { '-','f','i','l','e',0 }; - - if (!(flags & SHGFI_USEFILEATTRIBUTES)) - { - char ftype[80]; - - _ILGetFileType(pidlLast, ftype, 80); - MultiByteToWideChar(CP_ACP, 0, ftype, -1, psfi->szTypeName, 80 ); - } - else - { - if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - wcscat (psfi->szTypeName, szFile); - else - { - WCHAR sTemp[64]; - - wcscpy(sTemp,PathFindExtensionW(szFullPath)); - if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) && - HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE ))) - { - lstrcpynW (psfi->szTypeName, sTemp, 64); - wcscat (psfi->szTypeName, szDashFile); - } - } - } - } - - /* ### icons ###*/ - if (flags & SHGFI_OPENICON) - uGilFlags |= GIL_OPENICON; - - if (flags & SHGFI_LINKOVERLAY) - uGilFlags |= GIL_FORSHORTCUT; - else if ((flags&SHGFI_ADDOVERLAYS) || - (flags&(SHGFI_ICON|SHGFI_SMALLICON))==SHGFI_ICON) - { - if (SHELL_IsShortcut(pidlLast)) - uGilFlags |= GIL_FORSHORTCUT; - } - - if (flags & SHGFI_OVERLAYINDEX) - FIXME("SHGFI_OVERLAYINDEX unhandled\n"); - - if (flags & SHGFI_SELECTED) - FIXME("set icon to selected, stub\n"); - - if (flags & SHGFI_SHELLICONSIZE) - FIXME("set icon to shell size, stub\n"); - - /* get the iconlocation */ - if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION )) - { - UINT uFlags; - - if (flags & SHGFI_USEFILEATTRIBUTES) - { - if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - { - wcscpy(psfi->szDisplayName, swShell32Name); - psfi->iIcon = -IDI_SHELL_FOLDER; - } - else - { - WCHAR* szExt; - static const WCHAR p1W[] = {'%','1',0}; - WCHAR sTemp [MAX_PATH]; - - szExt = PathFindExtensionW(szFullPath); - TRACE("szExt=%s\n", debugstr_w(szExt)); - if ( szExt && - HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && - HCR_GetIconW(sTemp, sTemp, NULL, MAX_PATH, &psfi->iIcon)) - { - if (lstrcmpW(p1W, sTemp)) - wcscpy(psfi->szDisplayName, sTemp); - else - { - /* the icon is in the file */ - wcscpy(psfi->szDisplayName, szFullPath); - } - } - else - ret = FALSE; - } - } - else - { - hr = psfParent->GetUIObjectOf(0, 1, - (LPCITEMIDLIST*)&pidlLast, IID_NULL_PPV_ARG(IExtractIconW, &pei)); - if (SUCCEEDED(hr)) - { - hr = pei->GetIconLocation(uGilFlags, - szLocation, MAX_PATH, &iIndex, &uFlags); - - if (uFlags & GIL_NOTFILENAME) - ret = FALSE; - else - { - wcscpy (psfi->szDisplayName, szLocation); - psfi->iIcon = iIndex; - } - } - } - } - - /* get icon index (or load icon)*/ - if (SUCCEEDED(hr) && (flags & (SHGFI_ICON | SHGFI_SYSICONINDEX))) - { - if (flags & SHGFI_USEFILEATTRIBUTES && !(flags & SHGFI_PIDL)) - { - WCHAR sTemp [MAX_PATH]; - WCHAR * szExt; - int icon_idx=0; - - lstrcpynW(sTemp, szFullPath, MAX_PATH); - - if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - psfi->iIcon = SIC_GetIconIndex(swShell32Name, -IDI_SHELL_FOLDER, 0); - else - { - static const WCHAR p1W[] = {'%','1',0}; - - psfi->iIcon = 0; - szExt = PathFindExtensionW(sTemp); - if ( szExt && - HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && - HCR_GetIconW(sTemp, sTemp, NULL, MAX_PATH, &icon_idx)) - { - if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */ - wcscpy(sTemp, szFullPath); - - if (flags & SHGFI_SYSICONINDEX) - { - psfi->iIcon = SIC_GetIconIndex(sTemp,icon_idx,0); - if (psfi->iIcon == -1) - psfi->iIcon = 0; - } - else - { - UINT ret; - if (flags & SHGFI_SMALLICON) - ret = PrivateExtractIconsW( sTemp,icon_idx, - GetSystemMetrics( SM_CXSMICON ), - GetSystemMetrics( SM_CYSMICON ), - &psfi->hIcon, 0, 1, 0); - else - ret = PrivateExtractIconsW( sTemp, icon_idx, - GetSystemMetrics( SM_CXICON), - GetSystemMetrics( SM_CYICON), - &psfi->hIcon, 0, 1, 0); - - if (ret != 0 && ret != 0xFFFFFFFF) - { - IconNotYetLoaded=FALSE; - psfi->iIcon = icon_idx; - } - } - } - } - } - else - { - if (!(PidlToSicIndex(psfParent, pidlLast, !(flags & SHGFI_SMALLICON), - uGilFlags, &(psfi->iIcon)))) - { - ret = FALSE; - } - } - if (ret && (flags & SHGFI_SYSICONINDEX)) - { - if (flags & SHGFI_SMALLICON) - ret = (DWORD_PTR) ShellSmallIconList; - else - ret = (DWORD_PTR) ShellBigIconList; - } - } - - /* icon handle */ - if (SUCCEEDED(hr) && (flags & SHGFI_ICON) && IconNotYetLoaded) - { - if (flags & SHGFI_SMALLICON) - psfi->hIcon = ImageList_GetIcon( ShellSmallIconList, psfi->iIcon, ILD_NORMAL); - else - psfi->hIcon = ImageList_GetIcon( ShellBigIconList, psfi->iIcon, ILD_NORMAL); - } - - if (flags & ~SHGFI_KNOWN_FLAGS) - FIXME("unknown flags %08x\n", flags & ~SHGFI_KNOWN_FLAGS); - - if (hr != S_OK) - ret = FALSE; - - SHFree(pidlLast); - -#ifdef MORE_DEBUG - TRACE ("icon=%p index=0x%08x attr=0x%08x name=%s type=%s ret=0x%08lx\n", - psfi->hIcon, psfi->iIcon, psfi->dwAttributes, - debugstr_w(psfi->szDisplayName), debugstr_w(psfi->szTypeName), ret); -#endif - - return ret; -} - -/************************************************************************* - * SHGetFileInfoA [SHELL32.@] - * - * Note: - * MSVBVM60.__vbaNew2 expects this function to return a value in range - * 1 .. 0x7fff when the function succeeds and flags does not contain - * SHGFI_EXETYPE or SHGFI_SYSICONINDEX (see bug 7701) - */ -DWORD_PTR WINAPI SHGetFileInfoA(LPCSTR path,DWORD dwFileAttributes, - SHFILEINFOA *psfi, UINT sizeofpsfi, - UINT flags ) -{ - INT len; - LPWSTR temppath = NULL; - LPCWSTR pathW; - DWORD ret; - SHFILEINFOW temppsfi; - - if (flags & SHGFI_PIDL) - { - /* path contains a pidl */ - pathW = (LPCWSTR)path; - } - else - { - len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0); - temppath = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, path, -1, temppath, len); - pathW = temppath; - } - - if (psfi && (flags & SHGFI_ATTR_SPECIFIED)) - temppsfi.dwAttributes=psfi->dwAttributes; - - if (psfi == NULL) - ret = SHGetFileInfoW(pathW, dwFileAttributes, NULL, 0, flags); - else - ret = SHGetFileInfoW(pathW, dwFileAttributes, &temppsfi, sizeof(temppsfi), flags); - - if (psfi) - { - if(flags & SHGFI_ICON) - psfi->hIcon=temppsfi.hIcon; - if(flags & (SHGFI_SYSICONINDEX|SHGFI_ICON|SHGFI_ICONLOCATION)) - psfi->iIcon=temppsfi.iIcon; - if(flags & SHGFI_ATTRIBUTES) - psfi->dwAttributes=temppsfi.dwAttributes; - if(flags & (SHGFI_DISPLAYNAME|SHGFI_ICONLOCATION)) - { - WideCharToMultiByte(CP_ACP, 0, temppsfi.szDisplayName, -1, - psfi->szDisplayName, sizeof(psfi->szDisplayName), NULL, NULL); - } - if(flags & SHGFI_TYPENAME) - { - WideCharToMultiByte(CP_ACP, 0, temppsfi.szTypeName, -1, - psfi->szTypeName, sizeof(psfi->szTypeName), NULL, NULL); - } - } - - HeapFree(GetProcessHeap(), 0, temppath); - - return ret; -} - -/************************************************************************* - * DuplicateIcon [SHELL32.@] - */ -EXTERN_C HICON WINAPI DuplicateIcon( HINSTANCE hInstance, HICON hIcon) -{ - ICONINFO IconInfo; - HICON hDupIcon = 0; - - TRACE("%p %p\n", hInstance, hIcon); - - if (GetIconInfo(hIcon, &IconInfo)) - { - hDupIcon = CreateIconIndirect(&IconInfo); - - /* clean up hbmMask and hbmColor */ - DeleteObject(IconInfo.hbmMask); - DeleteObject(IconInfo.hbmColor); - } - - return hDupIcon; -} - -/************************************************************************* - * ExtractIconA [SHELL32.@] - */ -HICON WINAPI ExtractIconA(HINSTANCE hInstance, LPCSTR lpszFile, UINT nIconIndex) -{ - HICON ret; - INT len = MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, NULL, 0); - LPWSTR lpwstrFile = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - - TRACE("%p %s %d\n", hInstance, lpszFile, nIconIndex); - - MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, lpwstrFile, len); - ret = ExtractIconW(hInstance, lpwstrFile, nIconIndex); - HeapFree(GetProcessHeap(), 0, lpwstrFile); - - return ret; -} - -/************************************************************************* - * ExtractIconW [SHELL32.@] - */ -HICON WINAPI ExtractIconW(HINSTANCE hInstance, LPCWSTR lpszFile, UINT nIconIndex) -{ - HICON hIcon = NULL; - UINT ret; - UINT cx = GetSystemMetrics(SM_CXICON), cy = GetSystemMetrics(SM_CYICON); - - TRACE("%p %s %d\n", hInstance, debugstr_w(lpszFile), nIconIndex); - - if (nIconIndex == 0xFFFFFFFF) - { - ret = PrivateExtractIconsW(lpszFile, 0, cx, cy, NULL, NULL, 0, LR_DEFAULTCOLOR); - if (ret != 0xFFFFFFFF && ret) - return (HICON)(UINT_PTR)ret; - return NULL; - } - else - ret = PrivateExtractIconsW(lpszFile, nIconIndex, cx, cy, &hIcon, NULL, 1, LR_DEFAULTCOLOR); - - if (ret == 0xFFFFFFFF) - return (HICON)1; - else if (ret > 0 && hIcon) - return hIcon; - - return NULL; -} - -/************************************************************************* - * Printer_LoadIconsW [SHELL32.205] - */ -EXTERN_C VOID WINAPI Printer_LoadIconsW(LPCWSTR wsPrinterName, HICON * pLargeIcon, HICON * pSmallIcon) -{ - INT iconindex=IDI_SHELL_PRINTERS_FOLDER; - - TRACE("(%s, %p, %p)\n", debugstr_w(wsPrinterName), pLargeIcon, pSmallIcon); - - /* We should check if wsPrinterName is - 1. the Default Printer or not - 2. connected or not - 3. a Local Printer or a Network-Printer - and use different Icons - */ - if((wsPrinterName != NULL) && (wsPrinterName[0] != 0)) - { - FIXME("(select Icon by PrinterName %s not implemented)\n", debugstr_w(wsPrinterName)); - } - - if(pLargeIcon != NULL) - *pLargeIcon = (HICON)LoadImageW(shell32_hInstance, - (LPCWSTR) MAKEINTRESOURCE(iconindex), IMAGE_ICON, - 0, 0, LR_DEFAULTCOLOR|LR_DEFAULTSIZE); - - if(pSmallIcon != NULL) - *pSmallIcon = (HICON)LoadImageW(shell32_hInstance, - (LPCWSTR) MAKEINTRESOURCE(iconindex), IMAGE_ICON, - 16, 16, LR_DEFAULTCOLOR); -} - -/************************************************************************* - * Printers_RegisterWindowW [SHELL32.213] - * used by "printui.dll": - * find the Window of the given Type for the specific Printer and - * return the already existent hwnd or open a new window - */ -EXTERN_C BOOL WINAPI Printers_RegisterWindowW(LPCWSTR wsPrinter, DWORD dwType, - HANDLE * phClassPidl, HWND * phwnd) -{ - FIXME("(%s, %x, %p (%p), %p (%p)) stub!\n", debugstr_w(wsPrinter), dwType, - phClassPidl, (phClassPidl != NULL) ? *(phClassPidl) : NULL, - phwnd, (phwnd != NULL) ? *(phwnd) : NULL); - - return FALSE; -} - -/************************************************************************* - * Printers_UnregisterWindow [SHELL32.214] - */ -EXTERN_C VOID WINAPI Printers_UnregisterWindow(HANDLE hClassPidl, HWND hwnd) -{ - FIXME("(%p, %p) stub!\n", hClassPidl, hwnd); -} - -/*************************************************************************/ - -typedef struct -{ - LPCWSTR szApp; - LPCWSTR szOtherStuff; - HICON hIcon; -} ABOUT_INFO; - -#define DROP_FIELD_TOP (-15) -#define DROP_FIELD_HEIGHT 15 - -/************************************************************************* - * SHAppBarMessage [SHELL32.@] - */ -UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data) -{ - int width=data->rc.right - data->rc.left; - int height=data->rc.bottom - data->rc.top; - RECT rec=data->rc; - - TRACE("msg=%d, data={cb=%d, hwnd=%p, callback=%x, edge=%d, rc=%s, lparam=%lx}\n", - msg, data->cbSize, data->hWnd, data->uCallbackMessage, data->uEdge, - wine_dbgstr_rect(&data->rc), data->lParam); - - switch (msg) - { - case ABM_GETSTATE: - return ABS_ALWAYSONTOP | ABS_AUTOHIDE; - - case ABM_GETTASKBARPOS: - GetWindowRect(data->hWnd, &rec); - data->rc=rec; - return TRUE; - - case ABM_ACTIVATE: - SetActiveWindow(data->hWnd); - return TRUE; - - case ABM_GETAUTOHIDEBAR: - return 0; /* pretend there is no autohide bar */ - - case ABM_NEW: - /* cbSize, hWnd, and uCallbackMessage are used. All other ignored */ - SetWindowPos(data->hWnd,HWND_TOP,0,0,0,0,SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE); - return TRUE; - - case ABM_QUERYPOS: - GetWindowRect(data->hWnd, &(data->rc)); - return TRUE; - - case ABM_REMOVE: - FIXME("ABM_REMOVE broken\n"); - /* FIXME: this is wrong; should it be DestroyWindow instead? */ - /*CloseHandle(data->hWnd);*/ - return TRUE; - - case ABM_SETAUTOHIDEBAR: - SetWindowPos(data->hWnd,HWND_TOP,rec.left+1000,rec.top, - width,height,SWP_SHOWWINDOW); - return TRUE; - - case ABM_SETPOS: - data->uEdge=(ABE_RIGHT | ABE_LEFT); - SetWindowPos(data->hWnd,HWND_TOP,data->rc.left,data->rc.top, - width,height,SWP_SHOWWINDOW); - return TRUE; - - case ABM_WINDOWPOSCHANGED: - return TRUE; - } - - return FALSE; -} - -/************************************************************************* - * SHHelpShortcuts_RunDLLA [SHELL32.@] - * - */ -EXTERN_C DWORD WINAPI SHHelpShortcuts_RunDLLA(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4) -{ - FIXME("(%x, %x, %x, %x) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4); - return 0; -} - -/************************************************************************* - * SHHelpShortcuts_RunDLLA [SHELL32.@] - * - */ -EXTERN_C DWORD WINAPI SHHelpShortcuts_RunDLLW(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4) -{ - FIXME("(%x, %x, %x, %x) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4); - return 0; -} - -/************************************************************************* - * SHLoadInProc [SHELL32.@] - * Create an instance of specified object class from within - * the shell process and release it immediately - */ -EXTERN_C HRESULT WINAPI SHLoadInProc (REFCLSID rclsid) -{ - CComPtr<IUnknown> ptr; - - TRACE("%s\n", debugstr_guid(&rclsid)); - - CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void **)&ptr); - if (ptr) - return S_OK; - return DISP_E_MEMBERNOTFOUND; -} - -static VOID SetRegTextData(HWND hWnd, HKEY hKey, LPCWSTR Value, UINT uID) -{ - DWORD dwBufferSize; - DWORD dwType; - LPWSTR lpBuffer; - - if( RegQueryValueExW(hKey, Value, NULL, &dwType, NULL, &dwBufferSize) == ERROR_SUCCESS ) - { - if(dwType == REG_SZ) - { - lpBuffer = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, dwBufferSize); - - if(lpBuffer) - { - if( RegQueryValueExW(hKey, Value, NULL, &dwType, (LPBYTE)lpBuffer, &dwBufferSize) == ERROR_SUCCESS ) - { - SetDlgItemTextW(hWnd, uID, lpBuffer); - } - - HeapFree(GetProcessHeap(), 0, lpBuffer); - } - } - } -} - -INT_PTR CALLBACK AboutAuthorsDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) -{ - switch(msg) - { - case WM_INITDIALOG: - { - const char* const *pstr = SHELL_Authors; - - // Add the authors to the list - SendDlgItemMessageW( hWnd, IDC_ABOUT_AUTHORS_LISTBOX, WM_SETREDRAW, FALSE, 0 ); - - while (*pstr) - { - WCHAR name[64]; - - /* authors list is in utf-8 format */ - MultiByteToWideChar( CP_UTF8, 0, *pstr, -1, name, sizeof(name)/sizeof(WCHAR) ); - SendDlgItemMessageW( hWnd, IDC_ABOUT_AUTHORS_LISTBOX, LB_ADDSTRING, (WPARAM)-1, (LPARAM)name ); - pstr++; - } - - SendDlgItemMessageW( hWnd, IDC_ABOUT_AUTHORS_LISTBOX, WM_SETREDRAW, TRUE, 0 ); - - return TRUE; - } - } - - return FALSE; -} -/************************************************************************* - * AboutDlgProc (internal) - */ -static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) -{ - static DWORD cxLogoBmp; - static DWORD cyLogoBmp; - static HBITMAP hLogoBmp; - static HWND hWndAuthors; - - switch(msg) - { - case WM_INITDIALOG: - { - ABOUT_INFO *info = (ABOUT_INFO *)lParam; - - if (info) - { - const WCHAR szRegKey[] = L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"; - HKEY hRegKey; - MEMORYSTATUSEX MemStat; - WCHAR szAppTitle[512]; - WCHAR szAppTitleTemplate[512]; - WCHAR szAuthorsText[20]; - - // Preload the ROS bitmap - hLogoBmp = (HBITMAP)LoadImage(shell32_hInstance, MAKEINTRESOURCE(IDB_REACTOS), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); - - if(hLogoBmp) - { - BITMAP bmpLogo; - - GetObject( hLogoBmp, sizeof(BITMAP), &bmpLogo ); - - cxLogoBmp = bmpLogo.bmWidth; - cyLogoBmp = bmpLogo.bmHeight; - } - - // Set App-specific stuff (icon, app name, szOtherStuff string) - SendDlgItemMessageW(hWnd, IDC_ABOUT_ICON, STM_SETICON, (WPARAM)info->hIcon, 0); - - GetWindowTextW( hWnd, szAppTitleTemplate, sizeof(szAppTitleTemplate) / sizeof(WCHAR) ); - swprintf( szAppTitle, szAppTitleTemplate, info->szApp ); - SetWindowTextW( hWnd, szAppTitle ); - - SetDlgItemTextW( hWnd, IDC_ABOUT_APPNAME, info->szApp ); - SetDlgItemTextW( hWnd, IDC_ABOUT_OTHERSTUFF, info->szOtherStuff ); - - // Set the registered user and organization name - if(RegOpenKeyExW( HKEY_LOCAL_MACHINE, szRegKey, 0, KEY_QUERY_VALUE, &hRegKey ) == ERROR_SUCCESS) - { - SetRegTextData( hWnd, hRegKey, L"RegisteredOwner", IDC_ABOUT_REG_USERNAME ); - SetRegTextData( hWnd, hRegKey, L"RegisteredOrganization", IDC_ABOUT_REG_ORGNAME ); - - RegCloseKey( hRegKey ); - } - - // Set the value for the installed physical memory - MemStat.dwLength = sizeof(MemStat); - if( GlobalMemoryStatusEx(&MemStat) ) - { - WCHAR szBuf[12]; - - if (MemStat.ullTotalPhys > 1024 * 1024 * 1024) - { - double dTotalPhys; - WCHAR szDecimalSeparator[4]; - WCHAR szUnits[3]; - - // We're dealing with GBs or more - MemStat.ullTotalPhys /= 1024 * 1024; - - if (MemStat.ullTotalPhys > 1024 * 1024) - { - // We're dealing with TBs or more - MemStat.ullTotalPhys /= 1024; - - if (MemStat.ullTotalPhys > 1024 * 1024) - { - // We're dealing with PBs or more - MemStat.ullTotalPhys /= 1024; - - dTotalPhys = (double)MemStat.ullTotalPhys / 1024; - wcscpy( szUnits, L"PB" ); - } - else - { - dTotalPhys = (double)MemStat.ullTotalPhys / 1024; - wcscpy( szUnits, L"TB" ); - } - } - else - { - dTotalPhys = (double)MemStat.ullTotalPhys / 1024; - wcscpy( szUnits, L"GB" ); - } - - // We need the decimal point of the current locale to display the RAM size correctly - if (GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, - szDecimalSeparator, - sizeof(szDecimalSeparator) / sizeof(WCHAR)) > 0) - { - UCHAR uDecimals; - UINT uIntegral; - - uIntegral = (UINT)dTotalPhys; - uDecimals = (UCHAR)((UINT)(dTotalPhys * 100) - uIntegral * 100); - - // Display the RAM size with 2 decimals - swprintf(szBuf, L"%u%s%02u %s", uIntegral, szDecimalSeparator, uDecimals, szUnits); - } - } - else - { - // We're dealing with MBs, don't show any decimals - swprintf( szBuf, L"%u MB", (UINT)MemStat.ullTotalPhys / 1024 / 1024 ); - } - - SetDlgItemTextW( hWnd, IDC_ABOUT_PHYSMEM, szBuf); - } - - // Add the Authors dialog - hWndAuthors = CreateDialogW( shell32_hInstance, MAKEINTRESOURCEW(IDD_ABOUT_AUTHORS), hWnd, AboutAuthorsDlgProc ); - LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) ); - SetDlgItemTextW( hWnd, IDC_ABOUT_AUTHORS, szAuthorsText ); - } - - return TRUE; - } - - case WM_PAINT: - { - if(hLogoBmp) - { - PAINTSTRUCT ps; - HDC hdc; - HDC hdcMem; - - hdc = BeginPaint(hWnd, &ps); - hdcMem = CreateCompatibleDC(hdc); - - if(hdcMem) - { - SelectObject(hdcMem, hLogoBmp); - BitBlt(hdc, 0, 0, cxLogoBmp, cyLogoBmp, hdcMem, 0, 0, SRCCOPY); - - DeleteDC(hdcMem); - } - - EndPaint(hWnd, &ps); - } - }; break; - - case WM_COMMAND: - { - switch(wParam) - { - case IDOK: - case IDCANCEL: - EndDialog(hWnd, TRUE); - return TRUE; - - case IDC_ABOUT_AUTHORS: - { - static BOOL bShowingAuthors = FALSE; - WCHAR szAuthorsText[20]; - - if(bShowingAuthors) - { - LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_AUTHORS, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) ); - ShowWindow( hWndAuthors, SW_HIDE ); - } - else - { - LoadStringW( shell32_hInstance, IDS_SHELL_ABOUT_BACK, szAuthorsText, sizeof(szAuthorsText) / sizeof(WCHAR) ); - ShowWindow( hWndAuthors, SW_SHOW ); - } - - SetDlgItemTextW( hWnd, IDC_ABOUT_AUTHORS, szAuthorsText ); - bShowingAuthors = !bShowingAuthors; - return TRUE; - } - } - }; break; - - case WM_CLOSE: - EndDialog(hWnd, TRUE); - break; - } - - return FALSE; -} - - -/************************************************************************* - * ShellAboutA [SHELL32.288] - */ -BOOL WINAPI ShellAboutA( HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon ) -{ - BOOL ret; - LPWSTR appW = NULL, otherW = NULL; - int len; - - if (szApp) - { - len = MultiByteToWideChar(CP_ACP, 0, szApp, -1, NULL, 0); - appW = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, szApp, -1, appW, len); - } - if (szOtherStuff) - { - len = MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, NULL, 0); - otherW = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, otherW, len); - } - - ret = ShellAboutW(hWnd, appW, otherW, hIcon); - - HeapFree(GetProcessHeap(), 0, otherW); - HeapFree(GetProcessHeap(), 0, appW); - return ret; -} - - -/************************************************************************* - * ShellAboutW [SHELL32.289] - */ -BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, - HICON hIcon ) -{ - ABOUT_INFO info; - HRSRC hRes; - DLGTEMPLATE *DlgTemplate; - BOOL bRet; - - TRACE("\n"); - - // DialogBoxIndirectParamW will be called with the hInstance of the calling application, so we have to preload the dialog template - hRes = FindResourceW(shell32_hInstance, MAKEINTRESOURCEW(IDD_ABOUT), (LPWSTR)RT_DIALOG); - if(!hRes) - return FALSE; - - DlgTemplate = (DLGTEMPLATE *)LoadResource(shell32_hInstance, hRes); - if(!DlgTemplate) - return FALSE; - - info.szApp = szApp; - info.szOtherStuff = szOtherStuff; - info.hIcon = hIcon ? hIcon : LoadIconW( 0, (LPWSTR)IDI_WINLOGO ); - - bRet = DialogBoxIndirectParamW((HINSTANCE)GetWindowLongPtrW( hWnd, GWLP_HINSTANCE ), - DlgTemplate, hWnd, AboutDlgProc, (LPARAM)&info ); - return bRet; -} - -/************************************************************************* - * FreeIconList (SHELL32.@) - */ -EXTERN_C void WINAPI FreeIconList( DWORD dw ) -{ - FIXME("%x: stub\n",dw); -} - -/************************************************************************* - * SHLoadNonloadedIconOverlayIdentifiers (SHELL32.@) - */ -EXTERN_C HRESULT WINAPI SHLoadNonloadedIconOverlayIdentifiers(VOID) -{ - FIXME("stub\n"); - return S_OK; -} Removed: branches/shell-experiments/dll/win32/shell32/shell32_main.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/shell32_main.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shell32_main.h (removed) @@ -1,199 +0,0 @@ -/* - * internal Shell32 Library definitions - * - * Copyright 1998 Marcus Meissner - * Copyright 1998 Juergen Schmied (jsch) * <juergen.schmied(a)metronet.de> - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_SHELL_MAIN_H -#define __WINE_SHELL_MAIN_H - -/******************************************* -* global SHELL32.DLL variables -*/ -extern HMODULE huser32; -extern HINSTANCE shell32_hInstance; -extern HIMAGELIST ShellSmallIconList; -extern HIMAGELIST ShellBigIconList; - -BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList); - -/* Iconcache */ -#define INVALID_INDEX -1 -BOOL SIC_Initialize(void); -void SIC_Destroy(void); -BOOL PidlToSicIndex (IShellFolder * sh, LPCITEMIDLIST pidl, BOOL bBigIcon, UINT uFlags, int * pIndex); -INT SIC_GetIconIndex (LPCWSTR sSourceFile, INT dwSourceIndex, DWORD dwFlags ); - -/* Classes Root */ -BOOL HCR_MapTypeToValueW(LPCWSTR szExtension, LPWSTR szFileType, LONG len, BOOL bPrependDot); -BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len ); -BOOL HCR_GetExecuteCommandW( HKEY hkeyClass, LPCWSTR szClass, LPCWSTR szVerb, LPWSTR szDest, DWORD len ); -BOOL HCR_GetIconW(LPCWSTR szClass, LPWSTR szDest, LPCWSTR szName, DWORD len, int* picon_idx); -BOOL HCR_GetIconFromGUIDW(REFIID riid, LPWSTR szDest, LPWSTR szName, DWORD len, int* picon_idx); -BOOL HCR_GetClassNameW(REFIID riid, LPWSTR szDest, DWORD len); - -/* ANSI versions of above functions, supposed to go away as soon as they are not used anymore */ -BOOL HCR_MapTypeToValueA(LPCSTR szExtension, LPSTR szFileType, LONG len, BOOL bPrependDot); -BOOL HCR_GetIconA(LPCSTR szClass, LPSTR szDest, LPCSTR sName, DWORD len, int* picon_idx); -BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len); - -BOOL HCR_GetFolderAttributes(LPCITEMIDLIST pidlFolder, LPDWORD dwAttributes); -DWORD WINAPI ParseFieldA(LPCSTR src, DWORD nField, LPSTR dst, DWORD len); -DWORD WINAPI ParseFieldW(LPCWSTR src, DWORD nField, LPWSTR dst, DWORD len); - -/**************************************************************************** - * Class constructors - */ -HRESULT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidl, UINT cidl, IDataObject **dataObject); -HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **enumerator); - -LPCLASSFACTORY IClassFactory_Constructor(REFCLSID); -IContextMenu2 * ISvItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, const LPCITEMIDLIST *aPidls, UINT uItemCount); -HRESULT WINAPI INewItem_Constructor(IUnknown * pUnkOuter, REFIID riif, LPVOID *ppv); -IContextMenu2 * ISvStaticItemCm_Constructor(LPSHELLFOLDER pSFParent, LPCITEMIDLIST pidl, LPCITEMIDLIST *apidl, UINT cidl, HKEY hKey); -IContextMenu2 * ISvBgCm_Constructor(LPSHELLFOLDER pSFParent, BOOL bDesktop); -HRESULT WINAPI IShellView_Constructor(IShellFolder *pFolder, IShellView **newView); - -HRESULT WINAPI IShellLink_ConstructFromFile(IUnknown * pUnkOuter, REFIID riid, LPCITEMIDLIST pidl, LPVOID * ppv); -HRESULT WINAPI IFileSystemBindData_Constructor(const WIN32_FIND_DATAW *pfd, LPBC *ppV); -extern HRESULT CPanel_GetIconLocationW(LPCITEMIDLIST, LPWSTR, UINT, int*); -HRESULT WINAPI CPanel_ExtractIconA(LPITEMIDLIST pidl, LPCSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); -HRESULT WINAPI CPanel_ExtractIconW(LPITEMIDLIST pidl, LPCWSTR pszFile, UINT nIconIndex, HICON *phiconLarge, HICON *phiconSmall, UINT nIconSize); - -LPEXTRACTICONA IExtractIconA_Constructor(LPCITEMIDLIST); -LPEXTRACTICONW IExtractIconW_Constructor(LPCITEMIDLIST); - -/* initialisation for FORMATETC */ -#define InitFormatEtc(fe, cf, med) \ - {\ - (fe).cfFormat=cf;\ - (fe).dwAspect=DVASPECT_CONTENT;\ - (fe).ptd=NULL;\ - (fe).tymed=med;\ - (fe).lindex=-1;\ - }; - -#define KeyStateToDropEffect(kst)\ - ((((kst)&(MK_CONTROL|MK_SHIFT))==(MK_CONTROL|MK_SHIFT)) ? DROPEFFECT_LINK :\ - (((kst)&(MK_CONTROL)) ? DROPEFFECT_COPY :\ - (((kst)&(MK_SHIFT)) ? DROPEFFECT_MOVE :\ - DROPEFFECT_NONE))) - - -HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl); -HGLOBAL RenderSHELLIDLIST (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl); -HGLOBAL RenderSHELLIDLISTOFFSET (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl); -HGLOBAL RenderFILECONTENTS (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl); -HGLOBAL RenderFILEDESCRIPTOR (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl); -HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl); -HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl); -HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags); - -/* Change Notification */ -void InitChangeNotifications(void); -void FreeChangeNotifications(void); -void InitIconOverlays(void); - -/* file operation */ -#define ASK_DELETE_FILE 1 -#define ASK_DELETE_FOLDER 2 -#define ASK_DELETE_MULTIPLE_ITEM 3 -#define ASK_CREATE_FOLDER 4 -#define ASK_OVERWRITE_FILE 5 -#define ASK_DELETE_SELECTED 6 -#define ASK_TRASH_FILE 7 -#define ASK_TRASH_FOLDER 8 -#define ASK_TRASH_MULTIPLE_ITEM 9 -#define ASK_CANT_TRASH_ITEM 10 -#define ASK_OVERWRITE_FOLDER 11 - -BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pwszDir, BOOL bShowUI); -BOOL SHELL_ConfirmYesNoW(HWND hWnd, int nKindOfDialog, LPCWSTR szDir); - -void WINAPI _InsertMenuItemW (HMENU hmenu, UINT indexMenu, BOOL fByPosition, - UINT wID, UINT fType, LPCWSTR dwTypeData, UINT fState); - -static __inline BOOL SHELL_OsIsUnicode(void) -{ - /* if high-bit of version is 0, we are emulating NT */ - return !(GetVersion() & 0x80000000); -} - -#define __SHFreeAndNil(ptr) \ - {\ - SHFree(*ptr); \ - *ptr = NULL; \ - }; -static __inline void __SHCloneStrA(char **target, const char *source) -{ - *target = (char *)SHAlloc(strlen(source) + 1); - strcpy(*target, source); -} - -static __inline void __SHCloneStrWtoA(char **target, const WCHAR *source) -{ - int len = WideCharToMultiByte(CP_ACP, 0, source, -1, NULL, 0, NULL, NULL); - *target = (char *)SHAlloc(len); - WideCharToMultiByte(CP_ACP, 0, source, -1, *target, len, NULL, NULL); -} - -static __inline void __SHCloneStrW(WCHAR **target, const WCHAR *source) -{ - *target = (WCHAR *)SHAlloc((lstrlenW(source) + 1) * sizeof(WCHAR) ); - lstrcpyW(*target, source); -} - -static __inline LPWSTR __SHCloneStrAtoW(WCHAR **target, const char *source) -{ - int len = MultiByteToWideChar(CP_ACP, 0, source, -1, NULL, 0); - *target = (WCHAR *)SHAlloc(len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, source, -1, *target, len); - return *target; -} - -/* handle conversions */ -#define HICON_16(h32) (LOWORD(h32)) -#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16)) -#define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16)) -#define HINSTANCE_16(h32) (LOWORD(h32)) - -extern WCHAR swShell32Name[MAX_PATH]; - -BOOL UNIXFS_is_rooted_at_desktop(void); -extern const GUID CLSID_UnixFolder; -extern const GUID CLSID_UnixDosFolder; - -/* Default shell folder value registration */ -EXTERN_C HRESULT SHELL_RegisterShellFolders(void); - -/* Detect Shell Links */ -BOOL SHELL_IsShortcut(LPCITEMIDLIST); - -INT_PTR CALLBACK SH_FileGeneralDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -INT_PTR CALLBACK SH_FileVersionDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); -HPROPSHEETPAGE SH_CreatePropertySheetPage(WORD wDialogId, DLGPROC pfnDlgProc, LPARAM lParam, LPCWSTR pwszTitle); -BOOL SH_ShowDriveProperties(WCHAR *drive, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *apidl); -BOOL SH_ShowRecycleBinProperties(WCHAR sDrive); -BOOL SH_ShowPropertiesDialog(LPCWSTR pwszPath, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *apidl); -BOOL SH_ShowFolderProperties(LPWSTR pwszFolder, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *apidl); -LPWSTR SH_FormatFileSizeWithBytes(PULARGE_INTEGER lpQwSize, LPWSTR pszBuf, UINT cchBuf); - -EXTERN_C HRESULT WINAPI DoRegisterServer(void); -EXTERN_C HRESULT WINAPI DoUnregisterServer(void); - -#endif /* __WINE_SHELL_MAIN_H */ Copied: branches/shell-experiments/dll/win32/shell32/wine/shell32_main.c (from r65215, branches/shell-experiments/dll/win32/shell32/shell32_main.cpp) URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/shell32_main.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/wine/shell32_main.c [iso-8859-1] Mon Nov 3 12:17:30 2014 @@ -19,7 +19,25 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "precomp.h" +#include <wine/config.h> + +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COBJMACROS + +#include <windef.h> +#include <winbase.h> +#include <shellapi.h> +#include <shlobj.h> +#include <shlwapi.h> + +#include "undocshell.h" +#include "pidl.h" +#include "shell32_main.h" +#include "shresdef.h" + +#include <wine/debug.h> +#include <wine/unicode.h> #include <reactos/version.h> @@ -27,7 +45,6 @@ const char * const SHELL_Authors[] = { "Copyright 1993-"COPYRIGHT_YEAR" WINE team", "Copyright 1998-"COPYRIGHT_YEAR" ReactOS Team", 0 }; -#define MORE_DEBUG 1 /************************************************************************* * CommandLineToArgvW [SHELL32.@] * @@ -75,11 +92,11 @@ /* Return the path to the executable */ DWORD len, deslen=MAX_PATH, size; - size = sizeof(LPWSTR) + deslen*sizeof(WCHAR) + sizeof(LPWSTR); + size = sizeof(LPWSTR)*2 + deslen*sizeof(WCHAR); for (;;) { - if (!(argv = (LPWSTR *)LocalAlloc(LMEM_FIXED, size))) return NULL; - len = GetModuleFileNameW(0, (LPWSTR)(argv+1), deslen); + if (!(argv = LocalAlloc(LMEM_FIXED, size))) return NULL; + len = GetModuleFileNameW(0, (LPWSTR)(argv+2), deslen); if (!len) { LocalFree(argv); @@ -87,10 +104,11 @@ } if (len < deslen) break; deslen*=2; - size = sizeof(LPWSTR) + deslen*sizeof(WCHAR) + sizeof(LPWSTR); + size = sizeof(LPWSTR)*2 + deslen*sizeof(WCHAR); LocalFree( argv ); } - argv[0]=(LPWSTR)(argv+1); + argv[0]=(LPWSTR)(argv+2); + argv[1]=NULL; *numargs=1; return argv; @@ -168,10 +186,10 @@ * with it. This way the caller can make a single LocalFree() call to free * both, as per MSDN. */ - argv=(LPWSTR *)LocalAlloc(LMEM_FIXED, argc*sizeof(LPWSTR)+(strlenW(lpCmdline)+1)*sizeof(WCHAR)); + argv=LocalAlloc(LMEM_FIXED, (argc+1)*sizeof(LPWSTR)+(strlenW(lpCmdline)+1)*sizeof(WCHAR)); if (!argv) return NULL; - cmdline=(LPWSTR)(argv+argc); + cmdline=(LPWSTR)(argv+argc+1); strcpyW(cmdline, lpCmdline); /* --- Then split and copy the arguments */ @@ -209,6 +227,7 @@ if (!*s) { /* There are no parameters so we are all done */ + argv[argc]=NULL; *numargs=argc; return argv; } @@ -280,6 +299,7 @@ } } *d='\0'; + argv[argc]=NULL; *numargs=argc; return argv; @@ -319,20 +339,17 @@ SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); ReadFile( hfile, magic, sizeof(magic), &len, NULL ); - if ( *(DWORD*)magic == IMAGE_NT_SIGNATURE ) { SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); ReadFile( hfile, &nt, sizeof(nt), &len, NULL ); CloseHandle( hfile ); - /* DLL files are not executable and should return 0 */ if (nt.FileHeader.Characteristics & IMAGE_FILE_DLL) return 0; - if (nt.OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI) { - return IMAGE_NT_SIGNATURE | + return IMAGE_NT_SIGNATURE | (nt.OptionalHeader.MajorSubsystemVersion << 24) | (nt.OptionalHeader.MinorSubsystemVersion << 16); } @@ -344,7 +361,6 @@ SetFilePointer( hfile, mz_header.e_lfanew, NULL, SEEK_SET ); ReadFile( hfile, &ne, sizeof(ne), &len, NULL ); CloseHandle( hfile ); - if (ne.ne_exetyp == 2) return IMAGE_OS2_SIGNATURE | (ne.ne_expver << 16); return 0; @@ -354,7 +370,7 @@ } /************************************************************************* - * SHELL_IsShortcut [internal] + * SHELL_IsShortcut [internal] * * Decide if an item id list points to a shell shortcut */ @@ -397,8 +413,8 @@ int iIndex; DWORD_PTR ret = TRUE; DWORD dwAttributes = 0; - CComPtr<IShellFolder> psfParent; - CComPtr<IExtractIconW> pei; + IShellFolder * psfParent = NULL; + IExtractIconW * pei = NULL; LPITEMIDLIST pidlLast = NULL, pidl = NULL; HRESULT hr = S_OK; BOOL IconNotYetLoaded=TRUE; @@ -409,7 +425,7 @@ psfi, psfi->dwAttributes, sizeofpsfi, flags); if (!path) - return FALSE; + return FALSE; /* windows initializes these values regardless of the flags */ if (psfi != NULL) @@ -467,7 +483,7 @@ /* get the parent shellfolder */ if (pidl) { - hr = SHBindToParent( pidl, IID_PPV_ARG(IShellFolder, &psfParent), + hr = SHBindToParent( pidl, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&pidlLast ); if (SUCCEEDED(hr)) pidlLast = ILClone(pidlLast); @@ -487,22 +503,22 @@ { psfi->dwAttributes = 0xffffffff; } - if (psfParent != NULL) - psfParent->GetAttributesOf(1, (LPCITEMIDLIST*)&pidlLast, + if (psfParent) + IShellFolder_GetAttributesOf( psfParent, 1, (LPCITEMIDLIST*)&pidlLast, &(psfi->dwAttributes) ); } /* get the displayname */ if (SUCCEEDED(hr) && (flags & SHGFI_DISPLAYNAME)) { - if (flags & SHGFI_USEFILEATTRIBUTES) - { - wcscpy (psfi->szDisplayName, PathFindFileNameW(szFullPath)); + if (flags & SHGFI_USEFILEATTRIBUTES && !(flags & SHGFI_PIDL)) + { + lstrcpyW (psfi->szDisplayName, PathFindFileNameW(szFullPath)); } else { STRRET str; - hr = psfParent->GetDisplayNameOf(pidlLast, + hr = IShellFolder_GetDisplayNameOf( psfParent, pidlLast, SHGDN_INFOLDER, &str); StrRetToStrNW (psfi->szDisplayName, MAX_PATH, &str, pidlLast); } @@ -514,7 +530,7 @@ static const WCHAR szFile[] = { 'F','i','l','e',0 }; static const WCHAR szDashFile[] = { '-','f','i','l','e',0 }; - if (!(flags & SHGFI_USEFILEATTRIBUTES)) + if (!(flags & SHGFI_USEFILEATTRIBUTES) || (flags & SHGFI_PIDL)) { char ftype[80]; @@ -524,17 +540,17 @@ else { if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - wcscat (psfi->szTypeName, szFile); - else + strcatW (psfi->szTypeName, szFile); + else { WCHAR sTemp[64]; - wcscpy(sTemp,PathFindExtensionW(szFullPath)); + lstrcpyW(sTemp,PathFindExtensionW(szFullPath)); if (!( HCR_MapTypeToValueW(sTemp, sTemp, 64, TRUE) && HCR_MapTypeToValueW(sTemp, psfi->szTypeName, 80, FALSE ))) { lstrcpynW (psfi->szTypeName, sTemp, 64); - wcscat (psfi->szTypeName, szDashFile); + strcatW (psfi->szTypeName, szDashFile); } } } @@ -565,13 +581,13 @@ /* get the iconlocation */ if (SUCCEEDED(hr) && (flags & SHGFI_ICONLOCATION )) { - UINT uFlags; - - if (flags & SHGFI_USEFILEATTRIBUTES) + UINT uDummy,uFlags; + + if (flags & SHGFI_USEFILEATTRIBUTES && !(flags & SHGFI_PIDL)) { if (dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - wcscpy(psfi->szDisplayName, swShell32Name); + lstrcpyW(psfi->szDisplayName, swShell32Name); psfi->iIcon = -IDI_SHELL_FOLDER; } else @@ -587,11 +603,11 @@ HCR_GetIconW(sTemp, sTemp, NULL, MAX_PATH, &psfi->iIcon)) { if (lstrcmpW(p1W, sTemp)) - wcscpy(psfi->szDisplayName, sTemp); + strcpyW(psfi->szDisplayName, sTemp); else { /* the icon is in the file */ - wcscpy(psfi->szDisplayName, szFullPath); + strcpyW(psfi->szDisplayName, szFullPath); } } else @@ -600,20 +616,22 @@ } else { - hr = psfParent->GetUIObjectOf(0, 1, - (LPCITEMIDLIST*)&pidlLast, IID_NULL_PPV_ARG(IExtractIconW, &pei)); + hr = IShellFolder_GetUIObjectOf(psfParent, 0, 1, + (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconW, + &uDummy, (LPVOID*)&pei); if (SUCCEEDED(hr)) { - hr = pei->GetIconLocation(uGilFlags, + hr = IExtractIconW_GetIconLocation(pei, uGilFlags, szLocation, MAX_PATH, &iIndex, &uFlags); if (uFlags & GIL_NOTFILENAME) ret = FALSE; else { - wcscpy (psfi->szDisplayName, szLocation); + lstrcpyW (psfi->szDisplayName, szLocation); psfi->iIcon = iIndex; } + IExtractIconW_Release(pei); } } } @@ -642,15 +660,15 @@ HCR_GetIconW(sTemp, sTemp, NULL, MAX_PATH, &icon_idx)) { if (!lstrcmpW(p1W,sTemp)) /* icon is in the file */ - wcscpy(sTemp, szFullPath); - - if (flags & SHGFI_SYSICONINDEX) + strcpyW(sTemp, szFullPath); + + if (flags & SHGFI_SYSICONINDEX) { psfi->iIcon = SIC_GetIconIndex(sTemp,icon_idx,0); if (psfi->iIcon == -1) psfi->iIcon = 0; } - else + else { UINT ret; if (flags & SHGFI_SMALLICON) @@ -663,8 +681,7 @@ GetSystemMetrics( SM_CXICON), GetSystemMetrics( SM_CYICON), &psfi->hIcon, 0, 1, 0); - - if (ret != 0 && ret != 0xFFFFFFFF) + if (ret != 0 && ret != (UINT)-1) { IconNotYetLoaded=FALSE; psfi->iIcon = icon_idx; @@ -707,11 +724,9 @@ SHFree(pidlLast); -#ifdef MORE_DEBUG TRACE ("icon=%p index=0x%08x attr=0x%08x name=%s type=%s ret=0x%08lx\n", psfi->hIcon, psfi->iIcon, psfi->dwAttributes, debugstr_w(psfi->szDisplayName), debugstr_w(psfi->szTypeName), ret); -#endif return ret; } @@ -731,7 +746,7 @@ INT len; LPWSTR temppath = NULL; LPCWSTR pathW; - DWORD ret; + DWORD_PTR ret; SHFILEINFOW temppsfi; if (flags & SHGFI_PIDL) @@ -742,7 +757,7 @@ else { len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0); - temppath = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + temppath = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, path, -1, temppath, len); pathW = temppath; } @@ -783,7 +798,7 @@ /************************************************************************* * DuplicateIcon [SHELL32.@] */ -EXTERN_C HICON WINAPI DuplicateIcon( HINSTANCE hInstance, HICON hIcon) +HICON WINAPI DuplicateIcon( HINSTANCE hInstance, HICON hIcon) { ICONINFO IconInfo; HICON hDupIcon = 0; @@ -806,10 +821,10 @@ * ExtractIconA [SHELL32.@] */ HICON WINAPI ExtractIconA(HINSTANCE hInstance, LPCSTR lpszFile, UINT nIconIndex) -{ +{ HICON ret; INT len = MultiByteToWideChar(CP_ACP, 0, lpszFile, -1, NULL, 0); - LPWSTR lpwstrFile = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + LPWSTR lpwstrFile = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); TRACE("%p %s %d\n", hInstance, lpszFile, nIconIndex); @@ -831,17 +846,17 @@ TRACE("%p %s %d\n", hInstance, debugstr_w(lpszFile), nIconIndex); - if (nIconIndex == 0xFFFFFFFF) + if (nIconIndex == (UINT)-1) { ret = PrivateExtractIconsW(lpszFile, 0, cx, cy, NULL, NULL, 0, LR_DEFAULTCOLOR); - if (ret != 0xFFFFFFFF && ret) + if (ret != (UINT)-1 && ret) return (HICON)(UINT_PTR)ret; return NULL; } else ret = PrivateExtractIconsW(lpszFile, nIconIndex, cx, cy, &hIcon, NULL, 1, LR_DEFAULTCOLOR); - if (ret == 0xFFFFFFFF) + if (ret == (UINT)-1) return (HICON)1; else if (ret > 0 && hIcon) return hIcon; @@ -852,7 +867,7 @@ /************************************************************************* * Printer_LoadIconsW [SHELL32.205] */ -EXTERN_C VOID WINAPI Printer_LoadIconsW(LPCWSTR wsPrinterName, HICON * pLargeIcon, HICON * pSmallIcon) +VOID WINAPI Printer_LoadIconsW(LPCWSTR wsPrinterName, HICON * pLargeIcon, HICON * pSmallIcon) { INT iconindex=IDI_SHELL_PRINTERS_FOLDER; @@ -870,12 +885,12 @@ } if(pLargeIcon != NULL) - *pLargeIcon = (HICON)LoadImageW(shell32_hInstance, + *pLargeIcon = LoadImageW(shell32_hInstance, (LPCWSTR) MAKEINTRESOURCE(iconindex), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR|LR_DEFAULTSIZE); if(pSmallIcon != NULL) - *pSmallIcon = (HICON)LoadImageW(shell32_hInstance, + *pSmallIcon = LoadImageW(shell32_hInstance, (LPCWSTR) MAKEINTRESOURCE(iconindex), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); } @@ -883,10 +898,10 @@ /************************************************************************* * Printers_RegisterWindowW [SHELL32.213] * used by "printui.dll": - * find the Window of the given Type for the specific Printer and + * find the Window of the given Type for the specific Printer and * return the already existent hwnd or open a new window */ -EXTERN_C BOOL WINAPI Printers_RegisterWindowW(LPCWSTR wsPrinter, DWORD dwType, +BOOL WINAPI Printers_RegisterWindowW(LPCWSTR wsPrinter, DWORD dwType, HANDLE * phClassPidl, HWND * phwnd) { FIXME("(%s, %x, %p (%p), %p (%p)) stub!\n", debugstr_w(wsPrinter), dwType, @@ -894,12 +909,12 @@ phwnd, (phwnd != NULL) ? *(phwnd) : NULL); return FALSE; -} +} /************************************************************************* * Printers_UnregisterWindow [SHELL32.214] */ -EXTERN_C VOID WINAPI Printers_UnregisterWindow(HANDLE hClassPidl, HWND hwnd) +VOID WINAPI Printers_UnregisterWindow(HANDLE hClassPidl, HWND hwnd) { FIXME("(%p, %p) stub!\n", hClassPidl, hwnd); } @@ -983,7 +998,7 @@ * SHHelpShortcuts_RunDLLA [SHELL32.@] * */ -EXTERN_C DWORD WINAPI SHHelpShortcuts_RunDLLA(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4) +DWORD WINAPI SHHelpShortcuts_RunDLLA(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4) { FIXME("(%x, %x, %x, %x) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4); return 0; @@ -993,7 +1008,7 @@ * SHHelpShortcuts_RunDLLA [SHELL32.@] * */ -EXTERN_C DWORD WINAPI SHHelpShortcuts_RunDLLW(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4) +DWORD WINAPI SHHelpShortcuts_RunDLLW(DWORD dwArg1, DWORD dwArg2, DWORD dwArg3, DWORD dwArg4) { FIXME("(%x, %x, %x, %x) stub!\n", dwArg1, dwArg2, dwArg3, dwArg4); return 0; @@ -1004,13 +1019,13 @@ * Create an instance of specified object class from within * the shell process and release it immediately */ -EXTERN_C HRESULT WINAPI SHLoadInProc (REFCLSID rclsid) -{ - CComPtr<IUnknown> ptr; - - TRACE("%s\n", debugstr_guid(&rclsid)); - - CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, IID_IUnknown, (void **)&ptr); +HRESULT WINAPI SHLoadInProc (REFCLSID rclsid) +{ + void *ptr = NULL; + + TRACE("%s\n", debugstr_guid(rclsid)); + + CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown,&ptr); if (ptr) return S_OK; return DISP_E_MEMBERNOTFOUND; @@ -1260,7 +1275,7 @@ break; } - return FALSE; + return 0; } @@ -1276,13 +1291,13 @@ if (szApp) { len = MultiByteToWideChar(CP_ACP, 0, szApp, -1, NULL, 0); - appW = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + appW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, szApp, -1, appW, len); } if (szOtherStuff) { len = MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, NULL, 0); - otherW = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + otherW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, szOtherStuff, -1, otherW, len); } @@ -1328,7 +1343,7 @@ /************************************************************************* * FreeIconList (SHELL32.@) */ -EXTERN_C void WINAPI FreeIconList( DWORD dw ) +void WINAPI FreeIconList( DWORD dw ) { FIXME("%x: stub\n",dw); } @@ -1336,7 +1351,7 @@ /************************************************************************* * SHLoadNonloadedIconOverlayIdentifiers (SHELL32.@) */ -EXTERN_C HRESULT WINAPI SHLoadNonloadedIconOverlayIdentifiers(VOID) +HRESULT WINAPI SHLoadNonloadedIconOverlayIdentifiers( VOID ) { FIXME("stub\n"); return S_OK; Copied: branches/shell-experiments/dll/win32/shell32/wine/shell32_main.h (from r65212, branches/shell-experiments/dll/win32/shell32/shell32_main.h) URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/shell32_main.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/wine/shell32_main.h [iso-8859-1] Mon Nov 3 12:17:30 2014 @@ -21,6 +21,10 @@ #ifndef __WINE_SHELL_MAIN_H #define __WINE_SHELL_MAIN_H + +#ifdef __cplusplus +extern "C" { +#endif /******************************************* * global SHELL32.DLL variables @@ -179,7 +183,7 @@ extern const GUID CLSID_UnixDosFolder; /* Default shell folder value registration */ -EXTERN_C HRESULT SHELL_RegisterShellFolders(void); +HRESULT SHELL_RegisterShellFolders(void); /* Detect Shell Links */ BOOL SHELL_IsShortcut(LPCITEMIDLIST); @@ -193,7 +197,11 @@ BOOL SH_ShowFolderProperties(LPWSTR pwszFolder, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *apidl); LPWSTR SH_FormatFileSizeWithBytes(PULARGE_INTEGER lpQwSize, LPWSTR pszBuf, UINT cchBuf); -EXTERN_C HRESULT WINAPI DoRegisterServer(void); -EXTERN_C HRESULT WINAPI DoUnregisterServer(void); +HRESULT WINAPI DoRegisterServer(void); +HRESULT WINAPI DoUnregisterServer(void); + +#ifdef __cplusplus +} /* extern "C" */ +#endif #endif /* __WINE_SHELL_MAIN_H */ Modified: branches/shell-experiments/dll/win32/shell32/wine/shellole.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/wine/shellole.c [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/wine/shellole.c [iso-8859-1] Mon Nov 3 12:17:30 2014 @@ -36,10 +36,11 @@ #include <shlobj.h> #include <shlwapi.h> #include <debughlp.h> -#include <shell32_main.h> #include <wine/debug.h> #include <wine/unicode.h> + +#include "shell32_main.h" WINE_DEFAULT_DEBUG_CHANNEL(shell);
10 years, 1 month
1
0
0
0
[akhaldi] 65216: [SHELL] * Mark _ILGetExtension and _ILGetFileType as EXTERN_C. * __inline before return type. * Some tiny style consistency fixes.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Mon Nov 3 12:13:40 2014 New Revision: 65216 URL:
http://svn.reactos.org/svn/reactos?rev=65216&view=rev
Log: [SHELL] * Mark _ILGetExtension and _ILGetFileType as EXTERN_C. * __inline before return type. * Some tiny style consistency fixes. Modified: branches/shell-experiments/dll/win32/shell32/pidl.h Modified: branches/shell-experiments/dll/win32/shell32/pidl.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/pidl.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/pidl.h [iso-8859-1] Mon Nov 3 12:13:40 2014 @@ -213,8 +213,8 @@ DWORD _ILSimpleGetTextW (LPCITEMIDLIST pidl, LPWSTR pOut, UINT uOutSize); BOOL _ILGetFileDate (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); DWORD _ILGetFileSize (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); -BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); -void _ILGetFileType (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); +EXTERN_C BOOL _ILGetExtension (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); +EXTERN_C void _ILGetFileType (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); DWORD _ILGetFileAttributes (LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize); BOOL _ILGetFileDateTime (LPCITEMIDLIST pidl, FILETIME *ft); @@ -238,15 +238,14 @@ BOOL _ILIsSpecialFolder (LPCITEMIDLIST pidl); BOOL _ILIsPidlSimple (LPCITEMIDLIST pidl); BOOL _ILIsCPanelStruct (LPCITEMIDLIST pidl); -static BOOL __inline _ILIsEqualSimple (LPCITEMIDLIST pidlA, LPCITEMIDLIST pidlB) +static __inline +BOOL _ILIsEqualSimple (LPCITEMIDLIST pidlA, LPCITEMIDLIST pidlB) { return (pidlA->mkid.cb > 0 && !memcmp(pidlA, pidlB, pidlA->mkid.cb)) || - (!pidlA->mkid.cb && !pidlB->mkid.cb); + (!pidlA->mkid.cb && !pidlB->mkid.cb); } -static -BOOL __inline _ILIsEmpty (LPCITEMIDLIST pidl) { - return _ILIsDesktop(pidl); -} +static __inline +BOOL _ILIsEmpty (LPCITEMIDLIST pidl) { return _ILIsDesktop(pidl); } /* * simple pidls
10 years, 1 month
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
38
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Results per page:
10
25
50
100
200