Module: wine
Branch: refs/heads/master
Commit: e29dd373b2ab5e7f9be123d048cfcc23f9c9441f
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=e29dd373b2ab5e7f9be123d…
Author: Paul Vriens <paul.vriens(a)xs4all.nl>
Date: Thu Apr 6 14:34:14 2006 +0200
netapi32: Add (stubbed) NetSessionEnum.
---
dlls/netapi32/Makefile.in | 1 +
dlls/netapi32/netapi32.spec | 2 +
dlls/netapi32/share.c | 58 +++++++++++++++++++++++++++++++++++++++++++
include/lmshare.h | 4 +++
4 files changed, 64 insertions(+), 1 deletions(-)
create mode 100644 dlls/netapi32/share.c
diff --git a/dlls/netapi32/Makefile.in b/dlls/netapi32/Makefile.in
index b898d10..d172ce7 100644
--- a/dlls/netapi32/Makefile.in
+++ b/dlls/netapi32/Makefile.in
@@ -17,6 +17,7 @@ C_SRCS = \
nbt.c \
netapi32.c \
netbios.c \
+ share.c \
wksta.c
SUBDIRS = tests
diff --git a/dlls/netapi32/netapi32.spec b/dlls/netapi32/netapi32.spec
index dbb42c4..c92b59a 100644
--- a/dlls/netapi32/netapi32.spec
+++ b/dlls/netapi32/netapi32.spec
@@ -184,7 +184,7 @@
@ stub NetServiceGetInfo
@ stub NetServiceInstall
@ stub NetSessionDel
-@ stub NetSessionEnum
+@ stdcall NetSessionEnum(wstr wstr wstr long ptr long ptr ptr ptr)
@ stub NetSessionGetInfo
@ stub NetShareAdd
@ stub NetShareCheck
diff --git a/dlls/netapi32/share.c b/dlls/netapi32/share.c
new file mode 100644
index 0000000..c81381e
--- /dev/null
+++ b/dlls/netapi32/share.c
@@ -0,0 +1,58 @@
+/* Copyright 2006 Paul Vriens
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "wine/debug.h"
+#include "lm.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(share);
+
+/************************************************************
+ * NetSessionEnum (NETAPI32.@)
+ *
+ * PARAMS
+ * servername [I] Pointer to a string with the name of the server
+ * UncClientName [I] Pointer to a string with the name of the session
+ * username [I] Pointer to a string with the name of the user
+ * level [I] Data information level
+ * bufptr [O] Buffer to the data
+ * prefmaxlen [I] Preferred maximum length of the data
+ * entriesread [O] Pointer to the number of entries enumerated
+ * totalentries [O] Pointer to the possible number of entries
+ * resume_handle [I/O] Pointer to a handle for subsequent searches
+ *
+ * RETURNS
+ * If successful, the function returns NERR_Success
+ * On failure it returns:
+ * ERROR_ACCESS_DENIED User has no access to the requested information
+ * ERROR_INVALID_LEVEL Value of 'level' is not correct
+ * ERROR_INVALID_PARAMETER Wrong parameter
+ * ERROR_MORE_DATA Need a larger buffer
+ * ERROR_NOT_ENOUGH_MEMORY Not enough memory
+ * NERR_ClientNameNotFound A session does not exist on a given computer
+ * NERR_InvalidComputer Invalid computer name
+ * NERR_UserNotFound User name could not be found.
+ */
+NET_API_STATUS WINAPI NetSessionEnum(LPWSTR servername, LPWSTR UncClientName,
+ LPWSTR username, DWORD level, LPBYTE* bufptr, DWORD prefmaxlen, LPDWORD entriesread,
+ LPDWORD totalentries, LPDWORD resume_handle)
+{
+ FIXME("Stub (%s %s %s %ld %p %ld %p %p %p)\n", debugstr_w(servername),
+ debugstr_w(UncClientName), debugstr_w(username),
+ level, bufptr, prefmaxlen, entriesread, totalentries, resume_handle);
+
+ return NERR_Success;
+}
diff --git a/include/lmshare.h b/include/lmshare.h
index 9cace8e..8c7c83c 100644
--- a/include/lmshare.h
+++ b/include/lmshare.h
@@ -42,6 +42,10 @@ NET_API_STATUS WINAPI NetShareEnum(LMSTR
#define STYPE_IPC 3
#define STYPE_SPECIAL 0x80000000
+NET_API_STATUS NET_API_FUNCTION NetSessionEnum(LMSTR servername, LMSTR UncClientName,
+ LMSTR username, DWORD level, LPBYTE *bufptr, DWORD prefmaxlen, LPDWORD entriesread,
+ LPDWORD totalentries, LPDWORD resume_handle);
+
#ifdef __cplusplus
}
#endif
Module: wine
Branch: refs/heads/master
Commit: 517b85f989b3adf446dc6cdfdd84f12a702a49af
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=517b85f989b3adf446dc6cd…
Author: Huw Davies <huw(a)codeweavers.com>
Date: Thu Apr 6 16:55:32 2006 +0100
comctl32: Set the sheet caption before invoking the sheet callback and before creating the pages.
---
dlls/comctl32/propsheet.c | 31 ++++++-----
dlls/comctl32/tests/.gitignore | 2 +
dlls/comctl32/tests/Makefile.in | 3 +
dlls/comctl32/tests/propsheet.c | 107 ++++++++++++++++++++++++++++++++++++++
dlls/comctl32/tests/propsheet.rc | 29 ++++++++++
5 files changed, 157 insertions(+), 15 deletions(-)
create mode 100644 dlls/comctl32/tests/propsheet.c
create mode 100644 dlls/comctl32/tests/propsheet.rc
diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c
index 78fdc43..141b794 100644
--- a/dlls/comctl32/propsheet.c
+++ b/dlls/comctl32/propsheet.c
@@ -3427,21 +3427,6 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
}
}
- if (psInfo->useCallback)
- (*(psInfo->ppshheader.pfnCallback))(hwnd,
- PSCB_INITIALIZED, (LPARAM)0);
-
- idx = psInfo->active_page;
- ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[idx].hpage;
- psInfo->active_page = -1;
-
- PROPSHEET_SetCurSel(hwnd, idx, 1, psInfo->proppage[idx].hpage);
-
- /* doing TCM_SETCURSEL seems to be needed even in case of PSH_WIZARD,
- * as some programs call TCM_GETCURSEL to get the current selection
- * from which to switch to the next page */
- SendMessageW(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0);
-
if (!HIWORD(psInfo->ppshheader.pszCaption) &&
psInfo->ppshheader.hInstance)
{
@@ -3457,6 +3442,22 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMs
psInfo->ppshheader.pszCaption);
}
+
+ if (psInfo->useCallback)
+ (*(psInfo->ppshheader.pfnCallback))(hwnd,
+ PSCB_INITIALIZED, (LPARAM)0);
+
+ idx = psInfo->active_page;
+ ppshpage = (LPCPROPSHEETPAGEW)psInfo->proppage[idx].hpage;
+ psInfo->active_page = -1;
+
+ PROPSHEET_SetCurSel(hwnd, idx, 1, psInfo->proppage[idx].hpage);
+
+ /* doing TCM_SETCURSEL seems to be needed even in case of PSH_WIZARD,
+ * as some programs call TCM_GETCURSEL to get the current selection
+ * from which to switch to the next page */
+ SendMessageW(hwndTabCtrl, TCM_SETCURSEL, psInfo->active_page, 0);
+
return TRUE;
}
diff --git a/dlls/comctl32/tests/.gitignore b/dlls/comctl32/tests/.gitignore
index c4d729a..e6d715e 100644
--- a/dlls/comctl32/tests/.gitignore
+++ b/dlls/comctl32/tests/.gitignore
@@ -6,6 +6,8 @@ imagelist.ok
monthcal.ok
mru.ok
progress.ok
+propsheet.ok
+propsheet.res
subclass.ok
tab.ok
testlist.c
diff --git a/dlls/comctl32/tests/Makefile.in b/dlls/comctl32/tests/Makefile.in
index 87af63c..c277bd4 100644
--- a/dlls/comctl32/tests/Makefile.in
+++ b/dlls/comctl32/tests/Makefile.in
@@ -13,6 +13,7 @@ CTESTS = \
monthcal.c \
mru.c \
progress.c \
+ propsheet.c \
subclass.c \
tab.c \
toolbar.c \
@@ -20,6 +21,8 @@ CTESTS = \
treeview.c \
updown.c
+RC_SRCS = propsheet.rc
+
@MAKE_TEST_RULES@
### Dependencies:
diff --git a/dlls/comctl32/tests/propsheet.c b/dlls/comctl32/tests/propsheet.c
new file mode 100644
index 0000000..a273ad0
--- /dev/null
+++ b/dlls/comctl32/tests/propsheet.c
@@ -0,0 +1,107 @@
+/* Unit test suite for property sheet control.
+ *
+ * Copyright 2006 Huw Davies
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#define NONAMELESSUNION
+#define NONAMELESSSTRUCT
+
+#include <windows.h>
+#include <commctrl.h>
+
+#include "wine/test.h"
+
+static int CALLBACK sheet_callback(HWND hwnd, UINT msg, LPARAM lparam)
+{
+ switch(msg)
+ {
+ case PSCB_INITIALIZED:
+ {
+ char caption[256];
+ GetWindowTextA(hwnd, caption, sizeof(caption));
+ ok(!strcmp(caption,"test caption"), "caption: %s\n", caption);
+ return 0;
+ }
+ }
+ return 0;
+}
+
+static INT_PTR CALLBACK page_dlg_proc(HWND hwnd, UINT msg, WPARAM wparam,
+ LPARAM lparam)
+{
+ switch(msg)
+ {
+ case WM_INITDIALOG:
+ {
+ HWND sheet = GetParent(hwnd);
+ char caption[256];
+ GetWindowTextA(sheet, caption, sizeof(caption));
+ ok(!strcmp(caption,"test caption"), "caption: %s\n", caption);
+ return TRUE;
+ }
+
+ case WM_NOTIFY:
+ {
+ NMHDR *nmhdr = (NMHDR *)lparam;
+ switch(nmhdr->code)
+ {
+ case PSN_APPLY:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+ }
+ default:
+ return FALSE;
+ }
+}
+
+static void test_title(void)
+{
+ HPROPSHEETPAGE hpsp[1];
+ PROPSHEETPAGEA psp;
+ PROPSHEETHEADERA psh;
+ HWND hdlg;
+
+ memset(&psp, 0, sizeof(psp));
+ psp.dwSize = sizeof(psp);
+ psp.dwFlags = 0;
+ psp.hInstance = GetModuleHandleW(NULL);
+ psp.u.pszTemplate = "prop_page1";
+ psp.u2.pszIcon = NULL;
+ psp.pfnDlgProc = page_dlg_proc;
+ psp.lParam = 0;
+
+ hpsp[0] = CreatePropertySheetPageA(&psp);
+
+ memset(&psh, 0, sizeof(psh));
+ psh.dwSize = sizeof(psh);
+ psh.dwFlags = PSH_MODELESS | PSH_USECALLBACK;
+ psh.pszCaption = "test caption";
+ psh.nPages = 1;
+ psh.hwndParent = GetDesktopWindow();
+ psh.u3.phpage = hpsp;
+ psh.pfnCallback = sheet_callback;
+
+ hdlg = (HWND)PropertySheetA(&psh);
+ DestroyWindow(hdlg);
+}
+
+START_TEST(propsheet)
+{
+ test_title();
+}
diff --git a/dlls/comctl32/tests/propsheet.rc b/dlls/comctl32/tests/propsheet.rc
new file mode 100644
index 0000000..93b8ce7
--- /dev/null
+++ b/dlls/comctl32/tests/propsheet.rc
@@ -0,0 +1,29 @@
+/* Resources for the unit test suite for property sheet control.
+ *
+ * Copyright 2006 Huw Davies
+ *
+ * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "windef.h"
+#include "winuser.h"
+
+PROP_PAGE1 DIALOG LOADONCALL MOVEABLE DISCARDABLE 5, 43, 227, 215
+STYLE WS_POPUP | WS_CAPTION | WS_CLIPSIBLINGS | WS_VISIBLE
+CAPTION "Page1"
+FONT 8, "MS Shell Dlg"
+{
+ LTEXT "Test", -1, 10, 6, 100, 8
+}