[ros-diffs] [dchapyshev] 32955: - Add compstui, printui and ntdsapi from Wine

dchapyshev at svn.reactos.org dchapyshev at svn.reactos.org
Mon Apr 14 15:11:01 CEST 2008


Author: dchapyshev
Date: Mon Apr 14 08:11:01 2008
New Revision: 32955

URL: http://svn.reactos.org/svn/reactos?rev=32955&view=rev
Log:
- Add compstui, printui and ntdsapi from Wine

Added:
    trunk/reactos/dll/win32/compstui/
    trunk/reactos/dll/win32/compstui/compstui.rbuild   (with props)
    trunk/reactos/dll/win32/compstui/compstui.spec   (with props)
    trunk/reactos/dll/win32/compstui/compstui_main.c   (with props)
    trunk/reactos/dll/win32/ntdsapi/
    trunk/reactos/dll/win32/ntdsapi/ntdsapi.c   (with props)
    trunk/reactos/dll/win32/ntdsapi/ntdsapi.rbuild   (with props)
    trunk/reactos/dll/win32/ntdsapi/ntdsapi.spec   (with props)
    trunk/reactos/dll/win32/printui/
    trunk/reactos/dll/win32/printui/printui.c   (with props)
    trunk/reactos/dll/win32/printui/printui.rbuild   (with props)
    trunk/reactos/dll/win32/printui/printui.rc   (with props)
    trunk/reactos/dll/win32/printui/printui.spec   (with props)
    trunk/reactos/dll/win32/printui/printui_private.h   (with props)
Modified:
    trunk/reactos/dll/win32/win32.rbuild

Added: trunk/reactos/dll/win32/compstui/compstui.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/compstui/compstui.rbuild?rev=32955&view=auto
==============================================================================
--- trunk/reactos/dll/win32/compstui/compstui.rbuild (added)
+++ trunk/reactos/dll/win32/compstui/compstui.rbuild [iso-8859-1] Mon Apr 14 08:11:01 2008
@@ -1,0 +1,16 @@
+<module name="compstui" type="win32dll" baseaddress="${BASEADDRESS_COMPSTUI}" installbase="system32" installname="compstui.dll" allowwarnings="true" entrypoint="0">
+        <importlibrary definition="compstui.spec.def" />
+        <include base="compstui">.</include>
+        <include base="ReactOS">include/reactos/wine</include>
+        <define name="__REACTOS__" />
+        <define name="__WINESRC__" />
+        <define name="__USE_W32API" />
+        <define name="_WIN32_IE">0x600</define>
+        <define name="_WIN32_WINNT">0x501</define>
+        <define name="WINVER">0x501</define>
+        <library>wine</library>
+        <library>kernel32</library>
+        <library>ntdll</library>
+        <file>compstui_main.c</file>
+        <file>compstui.spec</file>
+</module>

Propchange: trunk/reactos/dll/win32/compstui/compstui.rbuild
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/compstui/compstui.spec
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/compstui/compstui.spec?rev=32955&view=auto
==============================================================================
--- trunk/reactos/dll/win32/compstui/compstui.spec (added)
+++ trunk/reactos/dll/win32/compstui/compstui.spec [iso-8859-1] Mon Apr 14 08:11:01 2008
@@ -1,0 +1,4 @@
+@ stdcall CommonPropertySheetUIA(long ptr long ptr)
+@ stdcall CommonPropertySheetUIW(long ptr long ptr)
+@ stdcall GetCPSUIUserData(long)
+@ stdcall SetCPSUIUserData(long ptr)

Propchange: trunk/reactos/dll/win32/compstui/compstui.spec
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/compstui/compstui_main.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/compstui/compstui_main.c?rev=32955&view=auto
==============================================================================
--- trunk/reactos/dll/win32/compstui/compstui_main.c (added)
+++ trunk/reactos/dll/win32/compstui/compstui_main.c [iso-8859-1] Mon Apr 14 08:11:01 2008
@@ -1,0 +1,93 @@
+/*
+ * Implementation of the Common Property Sheets User Interface
+ *
+ * Copyright 2006 Detlef Riekenberg
+ *
+ * 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 <stdarg.h>
+
+#define COBJMACROS
+#define NONAMELESSUNION
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ddk/compstui.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(compstui);
+
+/*****************************************************
+ *      DllMain
+ */
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+    TRACE("(%p, %d, %p)\n",hinstDLL, fdwReason, lpvReserved);
+
+    switch(fdwReason)
+    {
+        case DLL_WINE_PREATTACH:
+            return FALSE;  /* prefer native version */
+
+        case DLL_PROCESS_ATTACH:
+            DisableThreadLibraryCalls( hinstDLL );
+            break;
+    }
+    return TRUE;
+}
+
+/******************************************************************
+ *      CommonPropertySheetUIA (COMPSTUI.@)
+ *
+ */
+LONG WINAPI CommonPropertySheetUIA(HWND hWnd, PFNPROPSHEETUI pfnPropSheetUI, LPARAM lparam, LPDWORD pResult)
+{
+    FIXME("(%p, %p, 0x%lx, %p)\n", hWnd, pfnPropSheetUI, lparam, pResult);
+    return CPSUI_CANCEL;
+}
+
+/******************************************************************
+ *      CommonPropertySheetUIW (COMPSTUI.@)
+ *
+ */
+LONG WINAPI CommonPropertySheetUIW(HWND hWnd, PFNPROPSHEETUI pfnPropSheetUI, LPARAM lparam, LPDWORD pResult)
+{
+    FIXME("(%p, %p, 0x%lx, %p)\n", hWnd, pfnPropSheetUI, lparam, pResult);
+    return CPSUI_CANCEL;
+}
+
+/******************************************************************
+ *      GetCPSUIUserData (COMPSTUI.@)
+ *
+ */
+ULONG_PTR WINAPI GetCPSUIUserData(HWND hDlg)
+{
+    FIXME("(%p): stub\n", hDlg);
+    return 0;
+}
+
+/******************************************************************
+ *      SetCPSUIUserData (COMPSTUI.@)
+ *
+ */
+BOOL WINAPI SetCPSUIUserData(HWND hDlg, ULONG_PTR UserData )
+{
+    FIXME("(%p, %08lx): stub\n", hDlg, UserData);
+    return TRUE;
+}

Propchange: trunk/reactos/dll/win32/compstui/compstui_main.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/ntdsapi/ntdsapi.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ntdsapi/ntdsapi.c?rev=32955&view=auto
==============================================================================
--- trunk/reactos/dll/win32/ntdsapi/ntdsapi.c (added)
+++ trunk/reactos/dll/win32/ntdsapi/ntdsapi.c [iso-8859-1] Mon Apr 14 08:11:01 2008
@@ -1,0 +1,152 @@
+/*
+ * Copyright (C) 2006 Dmitry Timoshkov
+ *
+ * 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 <stdarg.h>
+
+#include "windef.h"
+#include "winbase.h"
+#include "winerror.h"
+#include "winuser.h"
+#include "ntdsapi.h"
+#include "wine/debug.h"
+#include "wine/unicode.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(ntdsapi);
+
+/*****************************************************
+ *      DllMain
+ */
+BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, LPVOID reserved)
+{
+    TRACE("(%p, %d, %p)\n", hinst, reason, reserved);
+
+    switch(reason)
+    {
+    case DLL_WINE_PREATTACH:
+        return FALSE;  /* prefer native version */
+
+    case DLL_PROCESS_ATTACH:
+        DisableThreadLibraryCalls( hinst );
+        break;
+    }
+    return TRUE;
+}
+
+/***********************************************************************
+ *             DsMakeSpnW (NTDSAPI.@)
+ */
+DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name,
+                        LPCWSTR inst_name, USHORT inst_port,
+                        LPCWSTR ref, DWORD *spn_length, LPWSTR spn)
+{
+    DWORD new_spn_length;
+    INT len;
+    LPWSTR p;
+
+    TRACE("(%s,%s,%s,%d,%s,%p,%p)\n", debugstr_w(svc_class),
+            debugstr_w(svc_name), debugstr_w(inst_name), inst_port,
+            debugstr_w(ref), spn_length, spn);
+
+    if (!svc_class || !svc_name)
+        return ERROR_INVALID_PARAMETER;
+
+    new_spn_length = strlenW(svc_class) + 1 /* for '/' */ + 1 /* for terminating '\0' */;
+    if (inst_name)
+        new_spn_length += strlenW(inst_name);
+    else
+        new_spn_length += strlenW(svc_name);
+    if (inst_port)
+    {
+        USHORT n = inst_port;
+        new_spn_length += 1 /* for ':' */;
+        do
+        {
+            n /= 10;
+            new_spn_length++;
+        } while (n != 0);
+    }
+    if (inst_name)
+        new_spn_length += 1 /* for '/' */ + strlenW(svc_name);
+
+    if (*spn_length < new_spn_length)
+    {
+        *spn_length = new_spn_length;
+        return ERROR_BUFFER_OVERFLOW;
+    }
+    *spn_length = new_spn_length;
+
+    p = spn;
+    len = strlenW(svc_class);
+    memcpy(p, svc_class, len * sizeof(WCHAR));
+    p += len;
+    *p = '/';
+    p++;
+    if (inst_name)
+    {
+        len = strlenW(inst_name);
+        memcpy(p, inst_name, len * sizeof(WCHAR));
+        p += len;
+        *p = '\0';
+    }
+    else
+    {
+        len = strlenW(svc_name);
+        memcpy(p, svc_name, len * sizeof(WCHAR));
+        p += len;
+        *p = '\0';
+    }
+
+    if (inst_port)
+    {
+        static const WCHAR percentU[] = {'%','u',0};
+        *p = ':';
+        p++;
+        wsprintfW(p, percentU, inst_port);
+        p += strlenW(p);
+    }
+
+    if (inst_name)
+    {
+        *p = '/';
+        p++;
+        len = strlenW(svc_name);
+        memcpy(p, svc_name, len * sizeof(WCHAR));
+        p += len;
+        *p = '\0';
+    }
+
+    TRACE("spn = %s\n", debugstr_w(spn));
+
+    return ERROR_SUCCESS;
+}
+
+/***********************************************************************
+ *             DsMakeSpnA (NTDSAPI.@)
+ *
+ * See DsMakeSpnW.
+ */
+DWORD WINAPI DsMakeSpnA(LPCSTR svc_class, LPCSTR svc_name,
+                        LPCSTR inst_name, USHORT inst_port,
+                        LPCSTR ref, DWORD *spn_length, LPSTR spn)
+{
+    FIXME("(%s,%s,%s,%d,%s,%p,%p): stub!\n", debugstr_a(svc_class),
+            debugstr_a(svc_name), debugstr_a(inst_name), inst_port,
+            debugstr_a(ref), spn_length, spn);
+
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}

Propchange: trunk/reactos/dll/win32/ntdsapi/ntdsapi.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/ntdsapi/ntdsapi.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ntdsapi/ntdsapi.rbuild?rev=32955&view=auto
==============================================================================
--- trunk/reactos/dll/win32/ntdsapi/ntdsapi.rbuild (added)
+++ trunk/reactos/dll/win32/ntdsapi/ntdsapi.rbuild [iso-8859-1] Mon Apr 14 08:11:01 2008
@@ -1,0 +1,17 @@
+<module name="ntdsapi" type="win32dll" baseaddress="${BASEADDRESS_NTDSAPI}" installbase="system32" installname="ntdsapi.dll" allowwarnings="true" entrypoint="0">
+        <importlibrary definition="ntdsapi.spec.def" />
+        <include base="ntdsapi">.</include>
+        <include base="ReactOS">include/reactos/wine</include>
+        <define name="__REACTOS__" />
+        <define name="__WINESRC__" />
+        <define name="__USE_W32API" />
+        <define name="_WIN32_IE">0x600</define>
+        <define name="_WIN32_WINNT">0x501</define>
+        <define name="WINVER">0x501</define>
+        <library>wine</library>
+        <library>user32</library>
+        <library>kernel32</library>
+        <library>ntdll</library>
+        <file>ntdsapi.c</file>
+        <file>ntdsapi.spec</file>
+</module>

Propchange: trunk/reactos/dll/win32/ntdsapi/ntdsapi.rbuild
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/ntdsapi/ntdsapi.spec
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/ntdsapi/ntdsapi.spec?rev=32955&view=auto
==============================================================================
--- trunk/reactos/dll/win32/ntdsapi/ntdsapi.spec (added)
+++ trunk/reactos/dll/win32/ntdsapi/ntdsapi.spec [iso-8859-1] Mon Apr 14 08:11:01 2008
@@ -1,0 +1,96 @@
+@ stub DsAddSidHistoryA
+@ stub DsAddSidHistoryW
+@ stub DsBindA
+@ stub DsBindW
+@ stub DsBindWithCredA
+@ stub DsBindWithCredW
+@ stub DsBindWithSpnA
+@ stub DsBindWithSpnW
+@ stub DsClientMakeSpnForTargetServerA
+@ stub DsClientMakeSpnForTargetServerW
+@ stub DsCrackNamesA
+@ stub DsCrackNamesW
+@ stub DsCrackSpn2A
+@ stub DsCrackSpn2W
+@ stub DsCrackSpn3W
+@ stub DsCrackSpnA
+@ stub DsCrackSpnW
+@ stub DsCrackUnquotedMangledRdnA
+@ stub DsCrackUnquotedMangledRdnW
+@ stub DsFreeDomainControllerInfoA
+@ stub DsFreeDomainControllerInfoW
+@ stub DsFreeNameResultA
+@ stub DsFreeNameResultW
+@ stub DsFreePasswordCredentials
+@ stub DsFreeSchemaGuidMapA
+@ stub DsFreeSchemaGuidMapW
+@ stub DsFreeSpnArrayA
+@ stub DsFreeSpnArrayW
+@ stub DsGetDomainControllerInfoA
+@ stub DsGetDomainControllerInfoW
+@ stub DsGetRdnW
+@ stub DsGetSpnA
+@ stub DsGetSpnW
+@ stub DsInheritSecurityIdentityA
+@ stub DsInheritSecurityIdentityW
+@ stub DsIsMangledDnA
+@ stub DsIsMangledDnW
+@ stub DsIsMangledRdnValueA
+@ stub DsIsMangledRdnValueW
+@ stub DsListDomainsInSiteA
+@ stub DsListDomainsInSiteW
+@ stub DsListInfoForServerA
+@ stub DsListInfoForServerW
+@ stub DsListRolesA
+@ stub DsListRolesW
+@ stub DsListServersForDomainInSiteA
+@ stub DsListServersForDomainInSiteW
+@ stub DsListServersInSiteA
+@ stub DsListServersInSiteW
+@ stub DsListSitesA
+@ stub DsListSitesW
+@ stub DsLogEntry
+@ stub DsMakePasswordCredentialsA
+@ stub DsMakePasswordCredentialsW
+@ stdcall DsMakeSpnA(str str str long str ptr ptr)
+@ stdcall DsMakeSpnW(wstr wstr wstr long wstr ptr ptr)
+@ stub DsMapSchemaGuidsA
+@ stub DsMapSchemaGuidsW
+@ stub DsQuoteRdnValueA
+@ stub DsQuoteRdnValueW
+@ stub DsRemoveDsDomainA
+@ stub DsRemoveDsDomainW
+@ stub DsRemoveDsServerA
+@ stub DsRemoveDsServerW
+@ stub DsReplicaAddA
+@ stub DsReplicaAddW
+@ stub DsReplicaConsistencyCheck
+@ stub DsReplicaDelA
+@ stub DsReplicaDelW
+@ stub DsReplicaFreeInfo
+@ stub DsReplicaGetInfo2W
+@ stub DsReplicaGetInfoW
+@ stub DsReplicaModifyA
+@ stub DsReplicaModifyW
+@ stub DsReplicaSyncA
+@ stub DsReplicaSyncAllA
+@ stub DsReplicaSyncAllW
+@ stub DsReplicaSyncW
+@ stub DsReplicaUpdateRefsA
+@ stub DsReplicaUpdateRefsW
+@ stub DsReplicaVerifyObjectsA
+@ stub DsReplicaVerifyObjectsW
+@ stub DsServerRegisterSpnA
+@ stub DsServerRegisterSpnW
+@ stub DsUnBindA
+@ stub DsUnBindW
+@ stub DsUnquoteRdnValueA
+@ stub DsUnquoteRdnValueW
+@ stub DsWriteAccountSpnA
+@ stub DsWriteAccountSpnW
+@ stub DsaopBind
+@ stub DsaopBindWithCred
+@ stub DsaopBindWithSpn
+@ stub DsaopExecuteScript
+@ stub DsaopPrepareScript
+@ stub DsaopUnBind

Propchange: trunk/reactos/dll/win32/ntdsapi/ntdsapi.spec
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/printui/printui.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/printui/printui.c?rev=32955&view=auto
==============================================================================
--- trunk/reactos/dll/win32/printui/printui.c (added)
+++ trunk/reactos/dll/win32/printui/printui.c [iso-8859-1] Mon Apr 14 08:11:01 2008
@@ -1,0 +1,283 @@
+/*
+ * Implementation of the Printer User Interface Dialogs
+ *
+ * Copyright 2006-2007 Detlef Riekenberg
+ *
+ * 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 <stdarg.h>
+
+#define COBJMACROS
+#define NONAMELESSUNION
+
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winreg.h"
+#include "winver.h"
+#include "winnls.h"
+#include "shellapi.h"
+
+#include "wine/unicode.h"
+#include "wine/debug.h"
+#include "printui_private.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(printui);
+
+HINSTANCE PRINTUI_hInstance = NULL;
+
+/* ################################# */
+
+/* Must be in order with OPT_*      */
+static const WCHAR optionsW[OPT_MAX+1]={'a','b','c','f','h','j','l','m','n','t','r','v',0};
+
+/* Must be in order with FLAG_*     */
+static const WCHAR flagsW[FLAG_MAX+1]={'q','w','y','z','Z',0};
+
+
+/* ################################
+ * get_next_wstr() [Internal]
+ *
+ * Get the next WSTR, when available
+ *
+ */
+
+static LPWSTR get_next_wstr(context_t * cx)
+{
+    LPWSTR  ptr;
+
+    ptr = cx->pNextCharW;
+    if (ptr && ptr[0]) {
+        cx->pNextCharW = NULL;
+        return ptr;
+    }
+
+    /* Get the next Parameter, when available */
+    if (cx->next_arg < cx->argc) {
+        ptr = cx->argv[cx->next_arg];
+        cx->next_arg++;
+        cx->pNextCharW = NULL;
+        return ptr;
+    }
+    return NULL;
+}
+
+
+/* ################################
+ * get_next_wchar() [Internal]
+ *
+ * Get the next WCHAR from the Commandline or from the File (@ Filename)
+ *
+ * ToDo: Support Parameter from a File ( "@Filename" )
+ *
+ */
+
+static WCHAR get_next_wchar(context_t * cx, BOOL use_next_parameter)
+{
+    WCHAR   c;
+
+    /* Try the next WCHAR in the actual Parameter */
+    if (cx->pNextCharW) {
+        c = *cx->pNextCharW;
+        if (c) {
+            cx->pNextCharW++;
+            return c;
+        }
+        /* We reached the end of the Parameter */
+        cx->pNextCharW = NULL;
+    }
+
+    /* Get the next Parameter, when available and allowed */
+    if ((cx->pNextCharW == NULL) && (cx->next_arg < cx->argc) && (use_next_parameter)) {
+        cx->pNextCharW = cx->argv[cx->next_arg];
+        cx->next_arg++;
+    }
+
+    if (cx->pNextCharW) {
+        c = *cx->pNextCharW;
+        if (c) {
+            cx->pNextCharW++;
+        }
+        else
+        {
+            /* We reached the end of the Parameter */
+            cx->pNextCharW = NULL;
+        }
+        return c;
+    }
+    return '\0';
+}
+
+/* ################################ */
+static BOOL parse_rundll(context_t * cx)
+{
+    LPWSTR  ptr;
+    DWORD   index;
+    WCHAR   txtW[2];
+    WCHAR   c;
+
+
+    c = get_next_wchar(cx, TRUE);
+    txtW[1] = '\0';
+
+    while (c)
+    {
+
+        while ( (c == ' ') || (c == '\t'))
+        {
+            c = get_next_wchar(cx, TRUE);
+        }
+        txtW[0] = c;
+
+        if (c == '@') {
+            /* read commands from a File */
+            ptr = get_next_wstr(cx);
+            FIXME("redir not supported: %s\n", debugstr_w(ptr));
+            return FALSE;
+        }
+        else if (c == '/') {
+            c = get_next_wchar(cx, FALSE);
+            while ( c )
+            {
+                txtW[0] = c;
+                ptr = strchrW(optionsW, c);
+                if (ptr) {
+                    index = ptr - optionsW;
+                    cx->options[index] = get_next_wstr(cx);
+                    TRACE(" opt: %s  %s\n", debugstr_w(txtW), debugstr_w(cx->options[index]));
+                    c = 0;
+                }
+                else
+                {
+                    ptr = strchrW(flagsW, c);
+                    if (ptr) {
+                        index = ptr - flagsW;
+                        cx->flags[index] = TRUE;
+                        TRACE("flag: %s\n", debugstr_w(txtW));
+                    }
+                    else
+                    {
+                        cx->command = c;
+                        cx->subcommand = '\0';
+                        TRACE(" cmd: %s\n", debugstr_w(txtW));
+                    }
+
+                    /* help has priority over all commands */
+                    if (c == '?') {
+                        return TRUE;
+                    }
+
+                    c = get_next_wchar(cx, FALSE);
+
+                    /* Some commands use two wchar */
+                    if ((cx->command == 'd') || (cx->command == 'g') || (cx->command == 'i') ||
+                        (cx->command == 'S') || (cx->command == 'X') ){
+                        cx->subcommand = c;
+                        txtW[0] = c;
+                        TRACE(" sub: %s\n", debugstr_w(txtW));
+                        c = get_next_wchar(cx, FALSE);
+                    }
+                }
+            }
+            c = get_next_wchar(cx, TRUE);
+
+        }
+        else
+        {
+            /* The commands 'S' and 'X' have additional Parameter */
+            if ((cx->command == 'S') || (cx->command == 'X')) {
+
+                /* the actual WCHAR is the start from the extra Parameter */
+                cx->pNextCharW--;
+                TRACE("%d extra Parameter, starting with %s\n", 1 + (cx->argc - cx->next_arg), debugstr_w(cx->pNextCharW));
+                return TRUE;
+            }
+            FIXME("0x%x: %s is unknown\n", c, debugstr_wn(&c, 1));
+            return FALSE;
+        }
+
+    }
+    return TRUE;
+}
+
+/*****************************************************
+ *      DllMain
+ */
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+    TRACE("(%p, %d, %p)\n",hinstDLL, fdwReason, lpvReserved);
+
+    switch(fdwReason)
+    {
+        case DLL_WINE_PREATTACH:
+            return FALSE;           /* prefer native version */
+
+        case DLL_PROCESS_ATTACH:
+            PRINTUI_hInstance = hinstDLL;
+            DisableThreadLibraryCalls( hinstDLL );
+            break;
+    }
+    return TRUE;
+}
+
+
+/*****************************************************
+ *  PrintUIEntryW                [printui.@]
+ *  Commandline-Interface for using printui.dll with rundll32.exe
+ *
+ */
+void WINAPI PrintUIEntryW(HWND hWnd, HINSTANCE hInst, LPCWSTR pCommand, DWORD nCmdShow)
+{
+    context_t cx;
+    BOOL  res = FALSE;
+
+    TRACE("(%p, %p, %s, 0x%x)\n", hWnd, hInst, debugstr_w(pCommand), nCmdShow);
+
+    memset(&cx, 0, sizeof(context_t));
+    cx.hWnd = hWnd;
+    cx.nCmdShow = nCmdShow;
+
+    if ((pCommand) && (pCommand[0])) {
+        /* result is allocated with GlobalAlloc() */
+        cx.argv = CommandLineToArgvW(pCommand, &cx.argc);
+        TRACE("got %d args at %p\n", cx.argc, cx.argv);
+
+        res = parse_rundll(&cx);
+    }
+
+    if (res && cx.command) {
+        switch (cx.command)
+        {
+
+            default:
+            {
+                WCHAR   txtW[3];
+                txtW[0] = cx.command;
+                txtW[1] = cx.subcommand;
+                txtW[2] = '\0';
+                FIXME("command not implemented: %s\n", debugstr_w(txtW));
+            }
+        }
+    }
+
+    if ((res == FALSE) || (cx.command == '\0')) {
+        FIXME("dialog: Printer / The operation was not successful\n");
+    }
+
+    GlobalFree(cx.argv);
+
+}

Propchange: trunk/reactos/dll/win32/printui/printui.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/printui/printui.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/printui/printui.rbuild?rev=32955&view=auto
==============================================================================
--- trunk/reactos/dll/win32/printui/printui.rbuild (added)
+++ trunk/reactos/dll/win32/printui/printui.rbuild [iso-8859-1] Mon Apr 14 08:11:01 2008
@@ -1,0 +1,18 @@
+<module name="printui" type="win32dll" baseaddress="${BASEADDRESS_PRINTUI}" installbase="system32" installname="printui.dll" allowwarnings="true" entrypoint="0">
+        <importlibrary definition="printui.spec.def" />
+        <include base="printui">.</include>
+        <include base="ReactOS">include/reactos/wine</include>
+        <define name="__REACTOS__" />
+        <define name="__WINESRC__" />
+        <define name="__USE_W32API" />
+        <define name="_WIN32_IE">0x600</define>
+        <define name="_WIN32_WINNT">0x501</define>
+        <define name="WINVER">0x501</define>
+        <library>wine</library>
+        <library>shell32</library>
+        <library>kernel32</library>
+        <library>ntdll</library>
+        <file>printui.c</file>
+        <file>printui.rc</file>
+        <file>printui.spec</file>
+</module>

Propchange: trunk/reactos/dll/win32/printui/printui.rbuild
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/printui/printui.rc
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/printui/printui.rc?rev=32955&view=auto
==============================================================================
--- trunk/reactos/dll/win32/printui/printui.rc (added)
+++ trunk/reactos/dll/win32/printui/printui.rc [iso-8859-1] Mon Apr 14 08:11:01 2008
@@ -1,0 +1,37 @@
+/*
+ * Top level resource file for printui.dll
+ *
+ * Copyright 2007 Detlef Riekenberg
+ *
+ * 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 "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "winver.h"
+
+#define WINE_FILENAME_STR "printui.dll"
+#define WINE_FILEDESCRIPTION_STR "User Interface for Printing"
+
+/* Same Version as WinXP_sp2 */
+#define WINE_FILEVERSION      5,1,2600,2180
+#define WINE_FILEVERSION_STR "5.1.2600.2180"
+
+#define WINE_PRODUCTVERSION      5,1,2600,2180
+#define WINE_PRODUCTVERSION_STR "5.1.2600.2180"
+
+#include "wine/wine_common_ver.rc"

Propchange: trunk/reactos/dll/win32/printui/printui.rc
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/printui/printui.spec
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/printui/printui.spec?rev=32955&view=auto
==============================================================================
--- trunk/reactos/dll/win32/printui/printui.spec (added)
+++ trunk/reactos/dll/win32/printui/printui.spec [iso-8859-1] Mon Apr 14 08:11:01 2008
@@ -1,0 +1,23 @@
+@ stub ConnectToPrinterDlg
+@ stub ConnectToPrinterPropertyPage
+@ stub ConstructPrinterFriendlyName
+@ stub DllCanUnloadNow
+@ stub DllGetClassObject
+@ stub DocumentPropertiesWrap
+@ stub PnPInterface
+@ stub PrintNotifyTray_Exit
+@ stub PrintNotifyTray_Init
+@ stdcall PrintUIEntryW(ptr ptr wstr long)
+@ stub PrinterPropPageProvider
+@ stub RegisterPrintNotify
+@ stub ShowErrorMessageHR
+@ stub ShowErrorMessageSC
+@ stub UnregisterPrintNotify
+@ stub bFolderEnumPrinters
+@ stub bFolderGetPrinter
+@ stub bFolderRefresh
+@ stub bPrinterSetup
+@ stub vDocumentDefaults
+@ stub vPrinterPropPages
+@ stub vQueueCreate
+@ stub vServerPropPages

Propchange: trunk/reactos/dll/win32/printui/printui.spec
------------------------------------------------------------------------------
    svn:eol-style = native

Added: trunk/reactos/dll/win32/printui/printui_private.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/printui/printui_private.h?rev=32955&view=auto
==============================================================================
--- trunk/reactos/dll/win32/printui/printui_private.h (added)
+++ trunk/reactos/dll/win32/printui/printui_private.h [iso-8859-1] Mon Apr 14 08:11:01 2008
@@ -1,0 +1,72 @@
+/*
+ * Implementation of the Printer User Interface Dialogs: private Header
+ *
+ * Copyright 2007 Detlef Riekenberg
+ *
+ * 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_PRINTUI_PRIVATE__
+#define __WINE_PRINTUI_PRIVATE__
+
+/* Index for Options with an argument */
+/* Must be in order with optionsW     */
+typedef enum _OPT_INDEX {
+    OPT_A = 0,
+    OPT_B,
+    OPT_C,
+    OPT_F,
+    OPT_H,
+    OPT_J,
+    OPT_L,
+    OPT_M,
+    OPT_N,
+    OPT_R,
+    OPT_T,
+    OPT_V,
+    OPT_MAX
+} OPT_INDEX;
+
+/* Index for Flags without an argument */
+/* Must be in order with flagsW        */
+typedef enum _FLAG_INDEX {
+    FLAG_Q = 0,
+    FLAG_W,
+    FLAG_Y,
+    FLAG_Z,
+    FLAG_ZZ,
+    FLAG_MAX
+} FLAG_INDEX;
+
+
+typedef struct tag_context {
+    HWND    hWnd;
+    DWORD   nCmdShow;
+    LPWSTR  * argv;
+    LPWSTR  pNextCharW;
+    int     argc;
+    int     next_arg;
+    WCHAR   command;
+    WCHAR   subcommand;
+    LPWSTR  options[OPT_MAX];
+    BOOL    flags[FLAG_MAX];
+} context_t;
+
+
+/* ## DLL-wide Globals ## */
+extern HINSTANCE PRINTUI_hInstance;
+
+
+#endif

Propchange: trunk/reactos/dll/win32/printui/printui_private.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/dll/win32/win32.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/win32.rbuild?rev=32955&r1=32954&r2=32955&view=diff
==============================================================================
--- trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/win32.rbuild [iso-8859-1] Mon Apr 14 08:11:01 2008
@@ -52,6 +52,9 @@
 <directory name="comdlg32">
 	<xi:include href="comdlg32/comdlg32.rbuild" />
 </directory>
+<directory name="compstui">
+	<xi:include href="compstui/compstui.rbuild" />
+</directory>
 <directory name="crtdll">
 	<xi:include href="crtdll/crtdll.rbuild" />
 </directory>
@@ -181,6 +184,9 @@
 <directory name="newdev">
 	<xi:include href="newdev/newdev.rbuild" />
 </directory>
+<directory name="ntdsapi">
+	<xi:include href="ntdsapi/ntdsapi.rbuild" />
+</directory>
 <directory name="ntmarta">
 	<xi:include href="ntmarta/ntmarta.rbuild" />
 </directory>
@@ -211,6 +217,9 @@
 <directory name="powrprof">
 	<xi:include href="powrprof/powrprof.rbuild" />
 </directory>
+<directory name="printui">
+	<xi:include href="printui/printui.rbuild" />
+</directory>
 <directory name="psapi">
 	<xi:include href="psapi/psapi.rbuild" />
 </directory>



More information about the Ros-diffs mailing list