winehq.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
2025
February
January
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
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2008
----- 2025 -----
February 2025
January 2025
----- 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
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
839 discussions
Start a n
N
ew thread
Paul Vriens : advapi32/tests: Add helper function to get function pointers.
by Alexandre Julliard
22 Aug '08
22 Aug '08
Module: wine Branch: master Commit: 6381303c019c9d9b9a7119a1db8fb7dae68c867c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6381303c019c9d9b9a7119a1d…
Author: Paul Vriens <paul.vriens.wine(a)gmail.com> Date: Wed Aug 20 20:13:59 2008 +0200 advapi32/tests: Add helper function to get function pointers. --- dlls/advapi32/tests/service.c | 23 ++++++++++++++++------- 1 files changed, 16 insertions(+), 7 deletions(-) diff --git a/dlls/advapi32/tests/service.c b/dlls/advapi32/tests/service.c index 829cfe7..306f000 100644 --- a/dlls/advapi32/tests/service.c +++ b/dlls/advapi32/tests/service.c @@ -33,6 +33,19 @@ static const CHAR spooler[] = "Spooler"; /* Should be available on all platforms */ +static BOOL (WINAPI *pChangeServiceConfig2A)(SC_HANDLE,DWORD,LPVOID); +static BOOL (WINAPI *pQueryServiceConfig2A)(SC_HANDLE,DWORD,LPBYTE,DWORD,LPDWORD); +static BOOL (WINAPI *pQueryServiceConfig2W)(SC_HANDLE,DWORD,LPBYTE,DWORD,LPDWORD); + +static void init_function_pointers(void) +{ + HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll"); + + pChangeServiceConfig2A = (void*)GetProcAddress(hadvapi32, "ChangeServiceConfig2A"); + pQueryServiceConfig2A= (void*)GetProcAddress(hadvapi32, "QueryServiceConfig2A"); + pQueryServiceConfig2W= (void*)GetProcAddress(hadvapi32, "QueryServiceConfig2W"); +} + static void test_open_scm(void) { SC_HANDLE scm_handle; @@ -958,13 +971,7 @@ static void test_queryconfig2(void) static const CHAR dependencies[] = "Master1\0Master2\0+MasterGroup1\0"; static const CHAR password [] = ""; static const CHAR description [] = "Description"; - HMODULE dllhandle = GetModuleHandleA("advapi32.dll"); - BOOL (WINAPI *pChangeServiceConfig2A)(SC_HANDLE,DWORD,LPVOID) - = (void*)GetProcAddress(dllhandle, "ChangeServiceConfig2A"); - BOOL (WINAPI *pQueryServiceConfig2A)(SC_HANDLE,DWORD,LPBYTE,DWORD,LPDWORD) - = (void*)GetProcAddress(dllhandle, "QueryServiceConfig2A"); - BOOL (WINAPI *pQueryServiceConfig2W)(SC_HANDLE,DWORD,LPBYTE,DWORD,LPDWORD) - = (void*)GetProcAddress(dllhandle, "QueryServiceConfig2W"); + if(!pQueryServiceConfig2A) { skip("function QueryServiceConfig2A not present\n"); @@ -1250,6 +1257,8 @@ START_TEST(service) } CloseServiceHandle(scm_handle); + init_function_pointers(); + /* First some parameter checking */ test_open_scm(); test_open_svc();
1
0
0
0
Alexander Nicolaysen Sørnes : dpnet: Add stubbed DirectPlay8Peer interface.
by Alexandre Julliard
22 Aug '08
22 Aug '08
Module: wine Branch: master Commit: bae5e6e1e5ddde12e59a5663bc43e57f69cb1af7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bae5e6e1e5ddde12e59a5663b…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Date: Wed Aug 20 15:18:57 2008 +0200 dpnet: Add stubbed DirectPlay8Peer interface. --- dlls/dpnet/dpnet_private.h | 11 ++ dlls/dpnet/peer.c | 328 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 337 insertions(+), 2 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=bae5e6e1e5ddde12e59a5…
1
0
0
0
Alexander Nicolaysen Sørnes : regedit: Convert AddEntryToTree to unicode.
by Alexandre Julliard
22 Aug '08
22 Aug '08
Module: wine Branch: master Commit: 74cae34da8cac146fafc1e477f6edc3be26ec9ef URL:
http://source.winehq.org/git/wine.git/?a=commit;h=74cae34da8cac146fafc1e477…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Date: Fri Aug 22 00:12:09 2008 +0200 regedit: Convert AddEntryToTree to unicode. --- programs/regedit/treeview.c | 67 +++++++++++++++++++++++------------------- 1 files changed, 37 insertions(+), 30 deletions(-) diff --git a/programs/regedit/treeview.c b/programs/regedit/treeview.c index 61c13ad..dcfb7fa 100644 --- a/programs/regedit/treeview.c +++ b/programs/regedit/treeview.c @@ -232,26 +232,30 @@ BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem) } /* Add an entry to the tree. Only give hKey for root nodes (HKEY_ constants) */ -static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPTSTR label, HKEY hKey, DWORD dwChildren) +static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPWSTR label, HKEY hKey, DWORD dwChildren) { TVINSERTSTRUCT tvins; + CHAR* labelA = GetMultiByteString(label); + HTREEITEM ret; if (hKey) { - if (RegQueryInfoKey(hKey, 0, 0, 0, &dwChildren, 0, 0, 0, 0, 0, 0, 0) != ERROR_SUCCESS) { + if (RegQueryInfoKeyW(hKey, 0, 0, 0, &dwChildren, 0, 0, 0, 0, 0, 0, 0) != ERROR_SUCCESS) { dwChildren = 0; } } tvins.u.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM; - tvins.u.item.pszText = label; - tvins.u.item.cchTextMax = lstrlen(label); + tvins.u.item.pszText = labelA; + tvins.u.item.cchTextMax = lstrlen(labelA); tvins.u.item.iImage = Image_Closed; tvins.u.item.iSelectedImage = Image_Open; tvins.u.item.cChildren = dwChildren; tvins.u.item.lParam = (LPARAM)hKey; tvins.hInsertAfter = (HTREEITEM)(hKey ? TVI_LAST : TVI_SORT); tvins.hParent = hParent; - return TreeView_InsertItem(hwndTV, &tvins); + ret = TreeView_InsertItem(hwndTV, &tvins); + HeapFree(GetProcessHeap(), 0, labelA); + return ret; } static BOOL match_string(LPCTSTR sstring1, LPCTSTR sstring2, int mode) @@ -388,20 +392,20 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem) { HKEY hRoot, hKey, hSubKey; HTREEITEM childItem; - LPTSTR KeyPath; + LPWSTR KeyPath; DWORD dwCount, dwIndex, dwMaxSubKeyLen; - LPSTR Name; + LPWSTR Name; TVITEM tvItem; hRoot = NULL; - KeyPath = GetItemPath(hwndTV, hItem, &hRoot); + KeyPath = GetItemPathW(hwndTV, hItem, &hRoot); if (!KeyPath || !hRoot) return FALSE; if (*KeyPath) { - if (RegOpenKeyEx(hRoot, KeyPath, 0, KEY_READ, &hKey) != ERROR_SUCCESS) { - WINE_TRACE("RegOpenKeyEx failed, \"%s\" was probably removed.\n", KeyPath); + if (RegOpenKeyExW(hRoot, KeyPath, 0, KEY_READ, &hKey) != ERROR_SUCCESS) { + WINE_TRACE("RegOpenKeyEx failed, %s was probably removed.\n", wine_dbgstr_w(KeyPath)); return FALSE; } } else { @@ -409,7 +413,7 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem) } HeapFree(GetProcessHeap(), 0, KeyPath); - if (RegQueryInfoKey(hKey, 0, 0, 0, &dwCount, &dwMaxSubKeyLen, 0, 0, 0, 0, 0, 0) != ERROR_SUCCESS) { + if (RegQueryInfoKeyW(hKey, 0, 0, 0, &dwCount, &dwMaxSubKeyLen, 0, 0, 0, 0, 0, 0) != ERROR_SUCCESS) { return FALSE; } @@ -428,7 +432,7 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem) } dwMaxSubKeyLen++; /* account for the \0 terminator */ - if (!(Name = HeapAlloc(GetProcessHeap(), 0, dwMaxSubKeyLen * sizeof(TCHAR)))) { + if (!(Name = HeapAlloc(GetProcessHeap(), 0, dwMaxSubKeyLen * sizeof(WCHAR)))) { return FALSE; } tvItem.cchTextMax = dwMaxSubKeyLen; @@ -440,38 +444,43 @@ static BOOL RefreshTreeItem(HWND hwndTV, HTREEITEM hItem) for (dwIndex = 0; dwIndex < dwCount; dwIndex++) { DWORD cName = dwMaxSubKeyLen, dwSubCount; BOOL found; + CHAR* NameA; found = FALSE; - if (RegEnumKeyEx(hKey, dwIndex, Name, &cName, 0, 0, 0, NULL) != ERROR_SUCCESS) { + if (RegEnumKeyExW(hKey, dwIndex, Name, &cName, 0, 0, 0, NULL) != ERROR_SUCCESS) { continue; } /* Find the number of children of the node. */ dwSubCount = 0; - if (RegOpenKeyEx(hKey, Name, 0, KEY_QUERY_VALUE, &hSubKey) == ERROR_SUCCESS) { + if (RegOpenKeyExW(hKey, Name, 0, KEY_QUERY_VALUE, &hSubKey) == ERROR_SUCCESS) { if (RegQueryInfoKey(hSubKey, 0, 0, 0, &dwSubCount, 0, 0, 0, 0, 0, 0, 0) != ERROR_SUCCESS) { dwSubCount = 0; } RegCloseKey(hSubKey); } + NameA = GetMultiByteString(Name); + /* Check if the node is already in there. */ for (childItem = TreeView_GetChild(hwndTV, hItem); childItem; childItem = TreeView_GetNextSibling(hwndTV, childItem)) { tvItem.mask = TVIF_TEXT; tvItem.hItem = childItem; if (!TreeView_GetItem(hwndTV, &tvItem)) { + HeapFree(GetProcessHeap(), 0, NameA); return FALSE; } - if (!stricmp(tvItem.pszText, Name)) { + if (!stricmp(tvItem.pszText, NameA)) { found = TRUE; + HeapFree(GetProcessHeap(), 0, NameA); break; } } if (found == FALSE) { - WINE_TRACE("New subkey %s\n", Name); + WINE_TRACE("New subkey %s\n", NameA); AddEntryToTree(hwndTV, hItem, Name, NULL, dwSubCount); } } @@ -527,9 +536,7 @@ HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name) if (!hItem) hItem = TreeView_GetSelection(hwndTV); if (!hItem) return FALSE; if (TreeView_GetItemState(hwndTV, hItem, TVIS_EXPANDEDONCE)) { - char* nameA = GetMultiByteString(name); - hNewItem = AddEntryToTree(hwndTV, hItem, nameA, 0, 0); - HeapFree(GetProcessHeap(), 0, nameA); + hNewItem = AddEntryToTree(hwndTV, hItem, name, 0, 0); } else { item.mask = TVIF_CHILDREN | TVIF_HANDLE; item.hItem = hItem; @@ -568,7 +575,7 @@ static BOOL InitTreeViewItems(HWND hwndTV, LPTSTR pHostName) { TVINSERTSTRUCT tvins; HTREEITEM hRoot; - static TCHAR hkcr[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T',0}, + static WCHAR hkcr[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T',0}, hkcu[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R',0}, hklm[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E',0}, hku[] = {'H','K','E','Y','_','U','S','E','R','S',0}, @@ -646,8 +653,8 @@ BOOL UpdateExpandingTree(HWND hwndTV, HTREEITEM hItem, int state) { DWORD dwCount, dwIndex, dwMaxSubKeyLen; HKEY hRoot, hNewKey, hKey; - LPTSTR keyPath; - LPTSTR Name; + LPWSTR keyPath; + LPWSTR Name; LONG errCode; HCURSOR hcursorOld; @@ -658,32 +665,32 @@ BOOL UpdateExpandingTree(HWND hwndTV, HTREEITEM hItem, int state) } expanding = TRUE; hcursorOld = SetCursor(LoadCursor(NULL, IDC_WAIT)); - SendMessage(hwndTV, WM_SETREDRAW, FALSE, 0); + SendMessageW(hwndTV, WM_SETREDRAW, FALSE, 0); - keyPath = GetItemPath(hwndTV, hItem, &hRoot); + keyPath = GetItemPathW(hwndTV, hItem, &hRoot); if (!keyPath) goto done; if (*keyPath) { - errCode = RegOpenKeyEx(hRoot, keyPath, 0, KEY_READ, &hNewKey); + errCode = RegOpenKeyExW(hRoot, keyPath, 0, KEY_READ, &hNewKey); if (errCode != ERROR_SUCCESS) goto done; } else { hNewKey = hRoot; } - errCode = RegQueryInfoKey(hNewKey, 0, 0, 0, &dwCount, &dwMaxSubKeyLen, 0, 0, 0, 0, 0, 0); + errCode = RegQueryInfoKeyW(hNewKey, 0, 0, 0, &dwCount, &dwMaxSubKeyLen, 0, 0, 0, 0, 0, 0); if (errCode != ERROR_SUCCESS) goto done; dwMaxSubKeyLen++; /* account for the \0 terminator */ - Name = HeapAlloc(GetProcessHeap(), 0, dwMaxSubKeyLen * sizeof(TCHAR)); + Name = HeapAlloc(GetProcessHeap(), 0, dwMaxSubKeyLen * sizeof(WCHAR)); if (!Name) goto done; for (dwIndex = 0; dwIndex < dwCount; dwIndex++) { DWORD cName = dwMaxSubKeyLen, dwSubCount; - errCode = RegEnumKeyEx(hNewKey, dwIndex, Name, &cName, 0, 0, 0, 0); + errCode = RegEnumKeyExW(hNewKey, dwIndex, Name, &cName, 0, 0, 0, 0); if (errCode != ERROR_SUCCESS) continue; - errCode = RegOpenKeyEx(hNewKey, Name, 0, KEY_QUERY_VALUE, &hKey); + errCode = RegOpenKeyExW(hNewKey, Name, 0, KEY_QUERY_VALUE, &hKey); if (errCode == ERROR_SUCCESS) { - errCode = RegQueryInfoKey(hKey, 0, 0, 0, &dwSubCount, 0, 0, 0, 0, 0, 0, 0); + errCode = RegQueryInfoKeyW(hKey, 0, 0, 0, &dwSubCount, 0, 0, 0, 0, 0, 0, 0); RegCloseKey(hKey); } if (errCode != ERROR_SUCCESS) dwSubCount = 0;
1
0
0
0
Alexander Nicolaysen Sørnes : regedit: Convert key creation to unicode.
by Alexandre Julliard
22 Aug '08
22 Aug '08
Module: wine Branch: master Commit: a6a4109dd446a6306bbe9c6ed88a1533d7c8be6f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a6a4109dd446a6306bbe9c6ed…
Author: Alexander Nicolaysen Sørnes <alex(a)thehandofagony.com> Date: Thu Aug 21 23:49:34 2008 +0200 regedit: Convert key creation to unicode. --- programs/regedit/edit.c | 14 +++++++------- programs/regedit/framewnd.c | 13 +++++++++---- programs/regedit/main.h | 4 ++-- programs/regedit/treeview.c | 14 +++++++++----- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/programs/regedit/edit.c b/programs/regedit/edit.c index f9a5abf..1c26baa 100644 --- a/programs/regedit/edit.c +++ b/programs/regedit/edit.c @@ -242,33 +242,33 @@ done: return NULL; } -BOOL CreateKey(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, LPTSTR keyName) +BOOL CreateKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPWSTR keyName) { BOOL result = FALSE; LONG lRet = ERROR_SUCCESS; HKEY retKey = NULL; - TCHAR newKey[MAX_NEW_KEY_LEN - 4]; + WCHAR newKey[MAX_NEW_KEY_LEN - 4]; int keyNum; HKEY hKey; - lRet = RegOpenKeyEx(hKeyRoot, keyPath, 0, KEY_CREATE_SUB_KEY, &hKey); + lRet = RegOpenKeyExW(hKeyRoot, keyPath, 0, KEY_CREATE_SUB_KEY, &hKey); if (lRet != ERROR_SUCCESS) { error_code_messagebox(hwnd, lRet); goto done; } - if (!LoadString(GetModuleHandle(0), IDS_NEWKEY, newKey, COUNT_OF(newKey))) goto done; + if (!LoadStringW(GetModuleHandle(0), IDS_NEWKEY, newKey, COUNT_OF(newKey))) goto done; /* try to find out a name for the newly create key (max 100 times) */ for (keyNum = 1; keyNum < 100; keyNum++) { - wsprintf(keyName, newKey, keyNum); - lRet = RegOpenKey(hKey, keyName, &retKey); + wsprintfW(keyName, newKey, keyNum); + lRet = RegOpenKeyW(hKey, keyName, &retKey); if (lRet != ERROR_SUCCESS) break; RegCloseKey(retKey); } if (lRet == ERROR_SUCCESS) goto done; - lRet = RegCreateKey(hKey, keyName, &retKey); + lRet = RegCreateKeyW(hKey, keyName, &retKey); if (lRet != ERROR_SUCCESS) { error_code_messagebox(hwnd, lRet); goto done; diff --git a/programs/regedit/framewnd.c b/programs/regedit/framewnd.c index 51c94cc..e8a6bf5 100644 --- a/programs/regedit/framewnd.c +++ b/programs/regedit/framewnd.c @@ -761,10 +761,15 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) break; } case ID_EDIT_NEW_KEY: - if (CreateKey(hWnd, hKeyRoot, keyPath, newKey)) { - if (InsertNode(g_pChildWnd->hTreeWnd, 0, newKey)) - StartKeyRename(g_pChildWnd->hTreeWnd); - } + { + WCHAR newKeyW[MAX_NEW_KEY_LEN]; + WCHAR* keyPathW = GetWideString(keyPath); + if (CreateKey(hWnd, hKeyRoot, keyPathW, newKeyW)) { + if (InsertNode(g_pChildWnd->hTreeWnd, 0, newKeyW)) + StartKeyRename(g_pChildWnd->hTreeWnd); + } + HeapFree(GetProcessHeap(), 0, keyPathW); + } break; case ID_EDIT_NEW_STRINGVALUE: valueType = REG_SZ; diff --git a/programs/regedit/main.h b/programs/regedit/main.h index 6b5a098..885ab0d 100644 --- a/programs/regedit/main.h +++ b/programs/regedit/main.h @@ -134,13 +134,13 @@ extern BOOL OnTreeExpanding(HWND hWnd, NMTREEVIEW* pnmtv); extern LPTSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey); extern LPWSTR GetItemPathW(HWND hwndTV, HTREEITEM hItem, HKEY* phRootKey); extern BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem); -extern HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPTSTR name); +extern HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name); extern HWND StartKeyRename(HWND hwndTV); extern HTREEITEM FindPathInTree(HWND hwndTV, LPCTSTR lpKeyName); extern HTREEITEM FindNext(HWND hwndTV, HTREEITEM hItem, LPCTSTR sstring, int mode, int *row); /* edit.c */ -extern BOOL CreateKey(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, LPTSTR newKeyName); +extern BOOL CreateKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPWSTR newKeyName); extern BOOL CreateValue(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, DWORD valueType, LPTSTR valueName); extern BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath, LPCTSTR valueName); extern BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath); diff --git a/programs/regedit/treeview.c b/programs/regedit/treeview.c index 3261a66..61c13ad 100644 --- a/programs/regedit/treeview.c +++ b/programs/regedit/treeview.c @@ -518,7 +518,7 @@ BOOL RefreshTreeView(HWND hwndTV) return TRUE; } -HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPTSTR name) +HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPWSTR name) { TCHAR buf[MAX_NEW_KEY_LEN]; HTREEITEM hNewItem = 0; @@ -527,7 +527,9 @@ HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPTSTR name) if (!hItem) hItem = TreeView_GetSelection(hwndTV); if (!hItem) return FALSE; if (TreeView_GetItemState(hwndTV, hItem, TVIS_EXPANDEDONCE)) { - hNewItem = AddEntryToTree(hwndTV, hItem, name, 0, 0); + char* nameA = GetMultiByteString(name); + hNewItem = AddEntryToTree(hwndTV, hItem, nameA, 0, 0); + HeapFree(GetProcessHeap(), 0, nameA); } else { item.mask = TVIF_CHILDREN | TVIF_HANDLE; item.hItem = hItem; @@ -535,19 +537,21 @@ HTREEITEM InsertNode(HWND hwndTV, HTREEITEM hItem, LPTSTR name) item.cChildren = 1; if (!TreeView_SetItem(hwndTV, &item)) return FALSE; } - SendMessage(hwndTV, TVM_EXPAND, TVE_EXPAND, (LPARAM)hItem ); + SendMessageW(hwndTV, TVM_EXPAND, TVE_EXPAND, (LPARAM)hItem ); if (!hNewItem) { + char* nameA = GetMultiByteString(name); for(hNewItem = TreeView_GetChild(hwndTV, hItem); hNewItem; hNewItem = TreeView_GetNextSibling(hwndTV, hNewItem)) { item.mask = TVIF_HANDLE | TVIF_TEXT; item.hItem = hNewItem; item.pszText = buf; item.cchTextMax = COUNT_OF(buf); if (!TreeView_GetItem(hwndTV, &item)) continue; - if (lstrcmp(name, item.pszText) == 0) break; + if (lstrcmp(nameA, item.pszText) == 0) break; } + HeapFree(GetProcessHeap(), 0, nameA); } if (hNewItem) - SendMessage(hwndTV, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hNewItem); + SendMessageW(hwndTV, TVM_SELECTITEM, TVGN_CARET, (LPARAM)hNewItem); return hNewItem; }
1
0
0
0
Roy Shea : mstask: Implemented partial stub for (Set|Get)AccountInformation .
by Alexandre Julliard
22 Aug '08
22 Aug '08
Module: wine Branch: master Commit: f208025228852d2286ffcd8de7ba880216413d16 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f208025228852d2286ffcd8de…
Author: Roy Shea <royshea(a)gmail.com> Date: Thu Aug 21 13:07:00 2008 -0700 mstask: Implemented partial stub for (Set|Get)AccountInformation. --- dlls/mstask/mstask_private.h | 1 + dlls/mstask/task.c | 39 +++++++++++++++++++++++++++++++++++---- dlls/mstask/tests/task.c | 28 +++++++++++++++------------- 3 files changed, 51 insertions(+), 17 deletions(-) diff --git a/dlls/mstask/mstask_private.h b/dlls/mstask/mstask_private.h index 998bb71..71a675e 100644 --- a/dlls/mstask/mstask_private.h +++ b/dlls/mstask/mstask_private.h @@ -62,6 +62,7 @@ typedef struct LPWSTR parameters; LPWSTR comment; DWORD maxRunTime; + LPWSTR accountName; } TaskImpl; extern HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj); diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index 707b943..2c70ef5 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -29,6 +29,7 @@ static inline TaskImpl *impl_from_IPersistFile( IPersistFile *iface ) static void TaskDestructor(TaskImpl *This) { TRACE("%p\n", This); + HeapFree(GetProcessHeap(), 0, This->accountName); HeapFree(GetProcessHeap(), 0, This->comment); HeapFree(GetProcessHeap(), 0, This->parameters); HeapFree(GetProcessHeap(), 0, This->taskName); @@ -355,17 +356,46 @@ static HRESULT WINAPI MSTASK_ITask_SetAccountInformation( LPCWSTR pwszAccountName, LPCWSTR pwszPassword) { - FIXME("(%p, %s, %s): stub\n", iface, debugstr_w(pwszAccountName), + DWORD n; + TaskImpl *This = (TaskImpl *)iface; + LPWSTR tmp_account_name; + + TRACE("(%p, %s, %s): partial stub\n", iface, debugstr_w(pwszAccountName), debugstr_w(pwszPassword)); - return E_NOTIMPL; + + if (pwszPassword) + FIXME("Partial stub ignores passwords\n"); + + n = (lstrlenW(pwszAccountName) + 1); + tmp_account_name = HeapAlloc(GetProcessHeap(), 0, n * sizeof(WCHAR)); + if (!tmp_account_name) + return E_OUTOFMEMORY; + lstrcpyW(tmp_account_name, pwszAccountName); + HeapFree(GetProcessHeap(), 0, This->accountName); + This->accountName = tmp_account_name; + return S_OK; } static HRESULT WINAPI MSTASK_ITask_GetAccountInformation( ITask* iface, LPWSTR *ppwszAccountName) { - FIXME("(%p, %p): stub\n", iface, ppwszAccountName); - return E_NOTIMPL; + DWORD n; + TaskImpl *This = (TaskImpl *)iface; + + TRACE("(%p, %p): partial stub\n", iface, ppwszAccountName); + + /* This implements the WinXP behavior when accountName has not yet + * set. Win2K behaves differently, returning SCHED_E_CANNOT_OPEN_TASK */ + if (!This->accountName) + return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); + + n = (lstrlenW(This->accountName) + 1); + *ppwszAccountName = CoTaskMemAlloc(n * sizeof(WCHAR)); + if (!*ppwszAccountName) + return E_OUTOFMEMORY; + lstrcpyW(*ppwszAccountName, This->accountName); + return S_OK; } static HRESULT WINAPI MSTASK_ITask_SetApplicationName( @@ -728,6 +758,7 @@ HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj) This->applicationName = NULL; This->parameters = NULL; This->comment = NULL; + This->accountName = NULL; /* Default time is 3 days = 259200000 ms */ This->maxRunTime = 259200000; diff --git a/dlls/mstask/tests/task.c b/dlls/mstask/tests/task.c index 8dfa675..9e4dfe2 100644 --- a/dlls/mstask/tests/task.c +++ b/dlls/mstask/tests/task.c @@ -434,6 +434,8 @@ static void test_SetAccountInformation_GetAccountInformation(void) LPWSTR account_name; const WCHAR dummy_account_name[] = {'N', 'o', 'S', 'u', 'c', 'h', 'A', 'c', 'c', 'o', 'u', 'n', 't', 0}; + const WCHAR dummy_account_name_b[] = {'N', 'o', 'S', 'u', 'c', 'h', + 'A', 'c', 'c', 'o', 'u', 'n', 't', 'B', 0}; setup = setup_task(); ok(setup, "Failed to setup test_task\n"); @@ -447,20 +449,20 @@ static void test_SetAccountInformation_GetAccountInformation(void) hres = ITask_GetAccountInformation(test_task, &account_name); /* WinXP returns HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND): 0x80070002 but * Win2K returns SCHED_E_CANNOT_OPEN_TASK: 0x8004130d */ - todo_wine ok(hres == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || + ok(hres == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || hres == SCHED_E_CANNOT_OPEN_TASK, "Unset account name generated: 0x%08x\n", hres); /* Attempt to set to a dummy account without a password */ /* This test passes on WinXP but fails on Win2K */ hres = ITask_SetAccountInformation(test_task, dummy_account_name, NULL); - todo_wine ok(hres == S_OK, + ok(hres == S_OK, "Failed setting dummy account with no password: %08x\n", hres); hres = ITask_GetAccountInformation(test_task, &account_name); - todo_wine ok(hres == S_OK, "GetAccountInformation failed: %08x\n", hres); + ok(hres == S_OK, "GetAccountInformation failed: %08x\n", hres); if (hres == S_OK) { - todo_wine ok(!lstrcmpW(account_name, dummy_account_name), + ok(!lstrcmpW(account_name, dummy_account_name), "Got %s, expected %s\n", dbgstr_w(account_name), dbgstr_w(dummy_account_name)); CoTaskMemFree(account_name); @@ -468,28 +470,28 @@ static void test_SetAccountInformation_GetAccountInformation(void) /* Attempt to set to a dummy account with a (invalid) password */ /* This test passes on WinXP but fails on Win2K */ - hres = ITask_SetAccountInformation(test_task, dummy_account_name, - dummy_account_name); - todo_wine ok(hres == S_OK, + hres = ITask_SetAccountInformation(test_task, dummy_account_name_b, + dummy_account_name_b); + ok(hres == S_OK, "Failed setting dummy account with password: %08x\n", hres); hres = ITask_GetAccountInformation(test_task, &account_name); - todo_wine ok(hres == S_OK, "GetAccountInformation failed: %08x\n", hres); + ok(hres == S_OK, "GetAccountInformation failed: %08x\n", hres); if (hres == S_OK) { - todo_wine ok(!lstrcmpW(account_name, dummy_account_name), + ok(!lstrcmpW(account_name, dummy_account_name_b), "Got %s, expected %s\n", dbgstr_w(account_name), - dbgstr_w(dummy_account_name)); + dbgstr_w(dummy_account_name_b)); CoTaskMemFree(account_name); } /* Attempt to set to the local system account */ hres = ITask_SetAccountInformation(test_task, empty, NULL); - todo_wine ok(hres == S_OK, "Failed setting system account: %08x\n", hres); + ok(hres == S_OK, "Failed setting system account: %08x\n", hres); hres = ITask_GetAccountInformation(test_task, &account_name); - todo_wine ok(hres == S_OK, "GetAccountInformation failed: %08x\n", hres); + ok(hres == S_OK, "GetAccountInformation failed: %08x\n", hres); if (hres == S_OK) { - todo_wine ok(!lstrcmpW(account_name, empty), + ok(!lstrcmpW(account_name, empty), "Got %s, expected empty string\n", dbgstr_w(account_name)); CoTaskMemFree(account_name); }
1
0
0
0
Roy Shea : mstask: Implemented (Set|Get)MaxRunTime.
by Alexandre Julliard
22 Aug '08
22 Aug '08
Module: wine Branch: master Commit: a597d9eaed00489ba44cfb0ab339e7b60bd230ba URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a597d9eaed00489ba44cfb0ab…
Author: Roy Shea <royshea(a)gmail.com> Date: Thu Aug 21 13:06:19 2008 -0700 mstask: Implemented (Set|Get)MaxRunTime. --- dlls/mstask/mstask_private.h | 1 + dlls/mstask/task.c | 19 +++++++++++++++---- dlls/mstask/tests/task.c | 28 ++++++++++++++-------------- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/dlls/mstask/mstask_private.h b/dlls/mstask/mstask_private.h index 05e7b0c..998bb71 100644 --- a/dlls/mstask/mstask_private.h +++ b/dlls/mstask/mstask_private.h @@ -61,6 +61,7 @@ typedef struct LPWSTR applicationName; LPWSTR parameters; LPWSTR comment; + DWORD maxRunTime; } TaskImpl; extern HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj); diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index 149869a..707b943 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -540,16 +540,24 @@ static HRESULT WINAPI MSTASK_ITask_SetMaxRunTime( ITask* iface, DWORD dwMaxRunTime) { - FIXME("(%p, %d): stub\n", iface, dwMaxRunTime); - return E_NOTIMPL; + TaskImpl *This = (TaskImpl *)iface; + + TRACE("(%p, %d)\n", iface, dwMaxRunTime); + + This->maxRunTime = dwMaxRunTime; + return S_OK; } static HRESULT WINAPI MSTASK_ITask_GetMaxRunTime( ITask* iface, DWORD *pdwMaxRunTime) { - FIXME("(%p, %p): stub\n", iface, pdwMaxRunTime); - return E_NOTIMPL; + TaskImpl *This = (TaskImpl *)iface; + + TRACE("(%p, %p)\n", iface, pdwMaxRunTime); + + *pdwMaxRunTime = This->maxRunTime; + return S_OK; } static HRESULT WINAPI MSTASK_IPersistFile_QueryInterface( @@ -721,6 +729,9 @@ HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj) This->parameters = NULL; This->comment = NULL; + /* Default time is 3 days = 259200000 ms */ + This->maxRunTime = 259200000; + *ppObj = &This->lpVtbl; InterlockedIncrement(&dll_ref); return S_OK; diff --git a/dlls/mstask/tests/task.c b/dlls/mstask/tests/task.c index 349b110..8dfa675 100644 --- a/dlls/mstask/tests/task.c +++ b/dlls/mstask/tests/task.c @@ -388,40 +388,40 @@ static void test_SetMaxRunTime_GetMaxRunTime(void) * 3 days * 24 hours * 60 minutes * 60 seconds * 1000 ms = 259200000 */ max_run_time = 0; hres = ITask_GetMaxRunTime(test_task, &max_run_time); - todo_wine ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); - todo_wine ok(max_run_time == 259200000, "Expected 259200000: %d\n", max_run_time); + ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); + ok(max_run_time == 259200000, "Expected 259200000: %d\n", max_run_time); /* Basic set test */ max_run_time = 0; hres = ITask_SetMaxRunTime(test_task, 1234); - todo_wine ok(hres == S_OK, "Failed to set max runtime: 0x%08x\n", hres); + ok(hres == S_OK, "Failed to set max runtime: 0x%08x\n", hres); hres = ITask_GetMaxRunTime(test_task, &max_run_time); - todo_wine ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); - todo_wine ok(max_run_time == 1234, "Expected 1234: %d\n", max_run_time); + ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); + ok(max_run_time == 1234, "Expected 1234: %d\n", max_run_time); /* Verify that time can be set to zero */ max_run_time = 1; hres = ITask_SetMaxRunTime(test_task, 0); - todo_wine ok(hres == S_OK, "Failed to set max runtime: 0x%08x\n", hres); + ok(hres == S_OK, "Failed to set max runtime: 0x%08x\n", hres); hres = ITask_GetMaxRunTime(test_task, &max_run_time); - todo_wine ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); - todo_wine ok(max_run_time == 0, "Expected 0: %d\n", max_run_time); + ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); + ok(max_run_time == 0, "Expected 0: %d\n", max_run_time); /* Check resolution by setting time to one */ max_run_time = 0; hres = ITask_SetMaxRunTime(test_task, 1); - todo_wine ok(hres == S_OK, "Failed to set max runtime: 0x%08x\n", hres); + ok(hres == S_OK, "Failed to set max runtime: 0x%08x\n", hres); hres = ITask_GetMaxRunTime(test_task, &max_run_time); - todo_wine ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); - todo_wine ok(max_run_time == 1, "Expected 1: %d\n", max_run_time); + ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); + ok(max_run_time == 1, "Expected 1: %d\n", max_run_time); /* Verify that time can be set to INFINITE */ max_run_time = 0; hres = ITask_SetMaxRunTime(test_task, INFINITE); - todo_wine ok(hres == S_OK, "Failed to set max runtime: 0x%08x\n", hres); + ok(hres == S_OK, "Failed to set max runtime: 0x%08x\n", hres); hres = ITask_GetMaxRunTime(test_task, &max_run_time); - todo_wine ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); - todo_wine ok(max_run_time == INFINITE, "Expected INFINITE: %d\n", max_run_time); + ok(hres == S_OK, "Failed to get max runtime: 0x%08x\n", hres); + ok(max_run_time == INFINITE, "Expected INFINITE: %d\n", max_run_time); cleanup_task(); return;
1
0
0
0
Roy Shea : mstask: Implemented (Set|Get)Comment.
by Alexandre Julliard
22 Aug '08
22 Aug '08
Module: wine Branch: master Commit: 37708b1e5c9923817384f5d51b9bd5e887d956a9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=37708b1e5c9923817384f5d51…
Author: Roy Shea <royshea(a)gmail.com> Date: Thu Aug 21 13:05:43 2008 -0700 mstask: Implemented (Set|Get)Comment. --- dlls/mstask/mstask_private.h | 1 + dlls/mstask/task.c | 46 ++++++++++++++++++++++++++++++++++++++--- dlls/mstask/tests/task.c | 22 ++++++++++---------- 3 files changed, 54 insertions(+), 15 deletions(-) diff --git a/dlls/mstask/mstask_private.h b/dlls/mstask/mstask_private.h index 8920707..05e7b0c 100644 --- a/dlls/mstask/mstask_private.h +++ b/dlls/mstask/mstask_private.h @@ -60,6 +60,7 @@ typedef struct LPWSTR taskName; LPWSTR applicationName; LPWSTR parameters; + LPWSTR comment; } TaskImpl; extern HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj); diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index 235c5fc..149869a 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -29,6 +29,7 @@ static inline TaskImpl *impl_from_IPersistFile( IPersistFile *iface ) static void TaskDestructor(TaskImpl *This) { TRACE("%p\n", This); + HeapFree(GetProcessHeap(), 0, This->comment); HeapFree(GetProcessHeap(), 0, This->parameters); HeapFree(GetProcessHeap(), 0, This->taskName); HeapFree(GetProcessHeap(), 0, This); @@ -219,16 +220,52 @@ static HRESULT WINAPI MSTASK_ITask_SetComment( ITask* iface, LPCWSTR pwszComment) { - FIXME("(%p, %s): stub\n", iface, debugstr_w(pwszComment)); - return E_NOTIMPL; + DWORD n; + TaskImpl *This = (TaskImpl *)iface; + LPWSTR tmp_comment; + + TRACE("(%p, %s)\n", iface, debugstr_w(pwszComment)); + + /* Empty comment */ + if (pwszComment[0] == 0) + { + HeapFree(GetProcessHeap(), 0, This->comment); + This->comment = NULL; + return S_OK; + } + + /* Set to pwszComment */ + n = (lstrlenW(pwszComment) + 1); + tmp_comment = HeapAlloc(GetProcessHeap(), 0, n * sizeof(WCHAR)); + if (!tmp_comment) + return E_OUTOFMEMORY; + lstrcpyW(tmp_comment, pwszComment); + HeapFree(GetProcessHeap(), 0, This->comment); + This->comment = tmp_comment; + + return S_OK; } static HRESULT WINAPI MSTASK_ITask_GetComment( ITask* iface, LPWSTR *ppwszComment) { - FIXME("(%p, %p): stub\n", iface, ppwszComment); - return E_NOTIMPL; + DWORD n; + TaskImpl *This = (TaskImpl *)iface; + + TRACE("(%p, %p)\n", iface, ppwszComment); + + n = This->comment ? lstrlenW(This->comment) + 1 : 1; + *ppwszComment = CoTaskMemAlloc(n * sizeof(WCHAR)); + if (!*ppwszComment) + return E_OUTOFMEMORY; + + if (!This->comment) + *ppwszComment[0] = 0; + else + lstrcpyW(*ppwszComment, This->comment); + + return S_OK; } static HRESULT WINAPI MSTASK_ITask_SetCreator( @@ -682,6 +719,7 @@ HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj) lstrcpyW(This->taskName, pwszTaskName); This->applicationName = NULL; This->parameters = NULL; + This->comment = NULL; *ppObj = &This->lpVtbl; InterlockedIncrement(&dll_ref); diff --git a/dlls/mstask/tests/task.c b/dlls/mstask/tests/task.c index 7d1b44d..349b110 100644 --- a/dlls/mstask/tests/task.c +++ b/dlls/mstask/tests/task.c @@ -319,49 +319,49 @@ static void test_SetComment_GetComment(void) /* Get comment before setting it*/ hres = ITask_GetComment(test_task, &comment); - todo_wine ok(hres == S_OK, "GetComment failed: %08x\n", hres); + ok(hres == S_OK, "GetComment failed: %08x\n", hres); if (hres == S_OK) { - todo_wine ok(!lstrcmpW(comment, empty), + ok(!lstrcmpW(comment, empty), "Got %s, expected empty string\n", dbgstr_w(comment)); CoTaskMemFree(comment); } /* Set comment to a simple string */ hres = ITask_SetComment(test_task, comment_a); - todo_wine ok(hres == S_OK, "Failed setting comment %s: %08x\n", + ok(hres == S_OK, "Failed setting comment %s: %08x\n", dbgstr_w(comment_a), hres); hres = ITask_GetComment(test_task, &comment); - todo_wine ok(hres == S_OK, "GetComment failed: %08x\n", hres); + ok(hres == S_OK, "GetComment failed: %08x\n", hres); if (hres == S_OK) { - todo_wine ok(!lstrcmpW(comment, comment_a), "Got %s, expected %s\n", + ok(!lstrcmpW(comment, comment_a), "Got %s, expected %s\n", dbgstr_w(comment), dbgstr_w(comment_a)); CoTaskMemFree(comment); } /* Update comment to a different simple string */ hres = ITask_SetComment(test_task, comment_b); - todo_wine ok(hres == S_OK, "Failed setting comment %s: %08x\n", + ok(hres == S_OK, "Failed setting comment %s: %08x\n", dbgstr_w(comment_b), hres); hres = ITask_GetComment(test_task, &comment); - todo_wine ok(hres == S_OK, "GetComment failed: %08x\n", hres); + ok(hres == S_OK, "GetComment failed: %08x\n", hres); if (hres == S_OK) { - todo_wine ok(!lstrcmpW(comment, comment_b), "Got %s, expected %s\n", + ok(!lstrcmpW(comment, comment_b), "Got %s, expected %s\n", dbgstr_w(comment), dbgstr_w(comment_b)); CoTaskMemFree(comment); } /* Clear comment */ hres = ITask_SetComment(test_task, empty); - todo_wine ok(hres == S_OK, "Failed setting comment %s: %08x\n", + ok(hres == S_OK, "Failed setting comment %s: %08x\n", dbgstr_w(empty), hres); hres = ITask_GetComment(test_task, &comment); - todo_wine ok(hres == S_OK, "GetComment failed: %08x\n", hres); + ok(hres == S_OK, "GetComment failed: %08x\n", hres); if (hres == S_OK) { - todo_wine ok(!lstrcmpW(comment, empty), + ok(!lstrcmpW(comment, empty), "Got %s, expected empty string\n", dbgstr_w(comment)); CoTaskMemFree(comment); }
1
0
0
0
Roy Shea : mstask: Implement (Set|Get)Parameters.
by Alexandre Julliard
22 Aug '08
22 Aug '08
Module: wine Branch: master Commit: 2f95e5123be7b967d261a75a69ca27f7cfe03970 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2f95e5123be7b967d261a75a6…
Author: Roy Shea <royshea(a)gmail.com> Date: Thu Aug 21 13:05:07 2008 -0700 mstask: Implement (Set|Get)Parameters. --- dlls/mstask/mstask_private.h | 1 + dlls/mstask/task.c | 45 ++++++++++++++++++++++++++++++++++++++--- dlls/mstask/tests/task.c | 22 ++++++++++---------- 3 files changed, 53 insertions(+), 15 deletions(-) diff --git a/dlls/mstask/mstask_private.h b/dlls/mstask/mstask_private.h index b0892fe..8920707 100644 --- a/dlls/mstask/mstask_private.h +++ b/dlls/mstask/mstask_private.h @@ -59,6 +59,7 @@ typedef struct LONG ref; LPWSTR taskName; LPWSTR applicationName; + LPWSTR parameters; } TaskImpl; extern HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj); diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index 5cef29f..235c5fc 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -29,6 +29,7 @@ static inline TaskImpl *impl_from_IPersistFile( IPersistFile *iface ) static void TaskDestructor(TaskImpl *This) { TRACE("%p\n", This); + HeapFree(GetProcessHeap(), 0, This->parameters); HeapFree(GetProcessHeap(), 0, This->taskName); HeapFree(GetProcessHeap(), 0, This); InterlockedDecrement(&dll_ref); @@ -403,16 +404,51 @@ static HRESULT WINAPI MSTASK_ITask_SetParameters( ITask* iface, LPCWSTR pwszParameters) { - FIXME("(%p, %s): stub\n", iface, debugstr_w(pwszParameters)); - return E_NOTIMPL; + DWORD n; + TaskImpl *This = (TaskImpl *)iface; + LPWSTR tmp_parameters; + + TRACE("(%p, %s)\n", iface, debugstr_w(pwszParameters)); + + /* Empty parameter list */ + if (pwszParameters[0] == 0) + { + HeapFree(GetProcessHeap(), 0, This->parameters); + This->parameters = NULL; + return S_OK; + } + + /* Set to pwszParameters */ + n = (lstrlenW(pwszParameters) + 1); + tmp_parameters = HeapAlloc(GetProcessHeap(), 0, n * sizeof(WCHAR)); + if (!tmp_parameters) + return E_OUTOFMEMORY; + lstrcpyW(tmp_parameters, pwszParameters); + HeapFree(GetProcessHeap(), 0, This->parameters); + This->parameters = tmp_parameters; + return S_OK; } static HRESULT WINAPI MSTASK_ITask_GetParameters( ITask* iface, LPWSTR *ppwszParameters) { - FIXME("(%p, %p): stub\n", iface, ppwszParameters); - return E_NOTIMPL; + DWORD n; + TaskImpl *This = (TaskImpl *)iface; + + TRACE("(%p, %p)\n", iface, ppwszParameters); + + n = This->parameters ? lstrlenW(This->parameters) + 1 : 1; + *ppwszParameters = CoTaskMemAlloc(n * sizeof(WCHAR)); + if (!*ppwszParameters) + return E_OUTOFMEMORY; + + if (!This->parameters) + *ppwszParameters[0] = 0; + else + lstrcpyW(*ppwszParameters, This->parameters); + + return S_OK; } static HRESULT WINAPI MSTASK_ITask_SetWorkingDirectory( @@ -645,6 +681,7 @@ HRESULT TaskConstructor(LPCWSTR pwszTaskName, LPVOID *ppObj) } lstrcpyW(This->taskName, pwszTaskName); This->applicationName = NULL; + This->parameters = NULL; *ppObj = &This->lpVtbl; InterlockedIncrement(&dll_ref); diff --git a/dlls/mstask/tests/task.c b/dlls/mstask/tests/task.c index ff35f52..7d1b44d 100644 --- a/dlls/mstask/tests/task.c +++ b/dlls/mstask/tests/task.c @@ -249,49 +249,49 @@ static void test_SetParameters_GetParameters(void) /* Get parameters before setting them */ hres = ITask_GetParameters(test_task, ¶meters); - todo_wine ok(hres == S_OK, "GetParameters failed: %08x\n", hres); + ok(hres == S_OK, "GetParameters failed: %08x\n", hres); if (hres == S_OK) { - todo_wine ok(!lstrcmpW(parameters, empty), + ok(!lstrcmpW(parameters, empty), "Got %s, expected empty string\n", dbgstr_w(parameters)); CoTaskMemFree(parameters); } /* Set parameters to a simple string */ hres = ITask_SetParameters(test_task, parameters_a); - todo_wine ok(hres == S_OK, "Failed setting parameters %s: %08x\n", + ok(hres == S_OK, "Failed setting parameters %s: %08x\n", dbgstr_w(parameters_a), hres); hres = ITask_GetParameters(test_task, ¶meters); - todo_wine ok(hres == S_OK, "GetParameters failed: %08x\n", hres); + ok(hres == S_OK, "GetParameters failed: %08x\n", hres); if (hres == S_OK) { - todo_wine ok(!lstrcmpW(parameters, parameters_a), "Got %s, expected %s\n", + ok(!lstrcmpW(parameters, parameters_a), "Got %s, expected %s\n", dbgstr_w(parameters), dbgstr_w(parameters_a)); CoTaskMemFree(parameters); } /* Update parameters to a different simple string */ hres = ITask_SetParameters(test_task, parameters_b); - todo_wine ok(hres == S_OK, "Failed setting parameters %s: %08x\n", + ok(hres == S_OK, "Failed setting parameters %s: %08x\n", dbgstr_w(parameters_b), hres); hres = ITask_GetParameters(test_task, ¶meters); - todo_wine ok(hres == S_OK, "GetParameters failed: %08x\n", hres); + ok(hres == S_OK, "GetParameters failed: %08x\n", hres); if (hres == S_OK) { - todo_wine ok(!lstrcmpW(parameters, parameters_b), "Got %s, expected %s\n", + ok(!lstrcmpW(parameters, parameters_b), "Got %s, expected %s\n", dbgstr_w(parameters), dbgstr_w(parameters_b)); CoTaskMemFree(parameters); } /* Clear parameters */ hres = ITask_SetParameters(test_task, empty); - todo_wine ok(hres == S_OK, "Failed setting parameters %s: %08x\n", + ok(hres == S_OK, "Failed setting parameters %s: %08x\n", dbgstr_w(empty), hres); hres = ITask_GetParameters(test_task, ¶meters); - todo_wine ok(hres == S_OK, "GetParameters failed: %08x\n", hres); + ok(hres == S_OK, "GetParameters failed: %08x\n", hres); if (hres == S_OK) { - todo_wine ok(!lstrcmpW(parameters, empty), + ok(!lstrcmpW(parameters, empty), "Got %s, expected empty string\n", dbgstr_w(parameters)); CoTaskMemFree(parameters); }
1
0
0
0
Roy Shea : mstask: Task PersistFile AddRef, QueryInterface, and Release.
by Alexandre Julliard
22 Aug '08
22 Aug '08
Module: wine Branch: master Commit: aec0eb87de7d71ab4d3160f3b2b0fb1250937243 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=aec0eb87de7d71ab4d3160f3b…
Author: Roy Shea <royshea(a)gmail.com> Date: Thu Aug 21 08:54:01 2008 -0700 mstask: Task PersistFile AddRef, QueryInterface, and Release. --- dlls/mstask/task.c | 32 ++++++++++++++++++++++++++------ 1 files changed, 26 insertions(+), 6 deletions(-) diff --git a/dlls/mstask/task.c b/dlls/mstask/task.c index f1f5426..5cef29f 100644 --- a/dlls/mstask/task.c +++ b/dlls/mstask/task.c @@ -21,6 +21,11 @@ WINE_DEFAULT_DEBUG_CHANNEL(mstask); +static inline TaskImpl *impl_from_IPersistFile( IPersistFile *iface ) +{ + return (TaskImpl*) ((char*)(iface) - FIELD_OFFSET(TaskImpl, persistVtbl)); +} + static void TaskDestructor(TaskImpl *This) { TRACE("%p\n", This); @@ -47,6 +52,12 @@ static HRESULT WINAPI MSTASK_ITask_QueryInterface( ITask_AddRef(iface); return S_OK; } + else if (IsEqualGUID(riid, &IID_IPersistFile)) + { + *ppvObject = &This->persistVtbl; + ITask_AddRef(iface); + return S_OK; + } WARN("Unknown interface: %s\n", debugstr_guid(riid)); *ppvObject = NULL; @@ -473,22 +484,31 @@ static HRESULT WINAPI MSTASK_IPersistFile_QueryInterface( REFIID riid, void **ppvObject) { - FIXME("(%p, %s, %p): stub\n", iface, debugstr_guid(riid), ppvObject); - return E_NOTIMPL; + TaskImpl *This = impl_from_IPersistFile(iface); + TRACE("(%p, %s, %p)\n", iface, debugstr_guid(riid), ppvObject); + return ITask_QueryInterface((ITask *) This, riid, ppvObject); } static ULONG WINAPI MSTASK_IPersistFile_AddRef( IPersistFile* iface) { - FIXME("(%p): stub\n", iface); - return E_NOTIMPL; + TaskImpl *This = impl_from_IPersistFile(iface); + ULONG ref; + TRACE("\n"); + ref = InterlockedIncrement(&This->ref); + return ref; } static ULONG WINAPI MSTASK_IPersistFile_Release( IPersistFile* iface) { - FIXME("(%p): stub\n", iface); - return E_NOTIMPL; + TaskImpl *This = impl_from_IPersistFile(iface); + ULONG ref; + TRACE("\n"); + ref = InterlockedDecrement(&This->ref); + if (ref == 0) + TaskDestructor(This); + return ref; } static HRESULT WINAPI MSTASK_IPersistFile_GetClassID(
1
0
0
0
Piotr Caban : msxml3: Added IDispatchEx QueryInterface test.
by Alexandre Julliard
22 Aug '08
22 Aug '08
Module: wine Branch: master Commit: 2841755c16d26507a1be3326999f13c9b9eb6960 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2841755c16d26507a1be33269…
Author: Piotr Caban <piotr.caban(a)gmail.com> Date: Thu Aug 21 23:38:03 2008 +0200 msxml3: Added IDispatchEx QueryInterface test. --- dlls/msxml3/tests/domdoc.c | 10 ++++++++++ dlls/msxml3/tests/schema.c | 1 + 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 8d64804..8a48882 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -26,6 +26,7 @@ #include "ole2.h" #include "xmldom.h" #include "msxml2.h" +#include "dispex.h" #include <stdio.h> #include <assert.h> @@ -1298,6 +1299,7 @@ static void test_refs(void) r = IXMLDOMElement_get_childNodes( element, &node_list ); ok( r == S_OK, "rets %08x\n", r); + ref = IXMLDOMNodeList_AddRef( node_list ); ok( ref == 2, "ref %d\n", ref ); IXMLDOMNodeList_Release( node_list ); @@ -1518,6 +1520,7 @@ static void test_getElementsByTagName(void) VARIANT_BOOL b; IXMLDOMDocument *doc; IXMLDOMNodeList *node_list; + IDispatchEx *dispex; long len; r = CoCreateInstance( &CLSID_DOMDocument, NULL, @@ -1537,6 +1540,13 @@ static void test_getElementsByTagName(void) r = IXMLDOMNodeList_get_length( node_list, &len ); ok( r == S_OK, "ret %08x\n", r ); ok( len == 6, "len %ld\n", len ); + + r = IXMLDOMNodeList_QueryInterface( node_list, &IID_IDispatchEx, (void**)&dispex ); + ok( r == S_OK, "rets %08x\n", r); + if( r == S_OK ) + IDispatchEx_Release( dispex ); + + IXMLDOMNodeList_Release( node_list ); SysFreeString( str ); diff --git a/dlls/msxml3/tests/schema.c b/dlls/msxml3/tests/schema.c index 6767924..d4fb6f7 100644 --- a/dlls/msxml3/tests/schema.c +++ b/dlls/msxml3/tests/schema.c @@ -26,6 +26,7 @@ #include "ole2.h" #include "xmldom.h" #include "msxml2.h" +#include "dispex.h" #include "wine/test.h"
1
0
0
0
← Newer
1
...
29
30
31
32
33
34
35
...
84
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Results per page:
10
25
50
100
200