- Add my proposed directory tree for the components involved in printing.

- Remove some Wine-imported components which are either entirely not usable for us or only implement so few functions that it's easier to completely reimplement them.
- Move "localui" (Wine-imported) and "spoolsv" (ReactOS stub) to the new directories.

svn path=/branches/colins-printing-for-freedom/; revision=67543
This commit is contained in:
Colin Finck 2015-05-04 13:21:13 +00:00
parent 866f04e377
commit d5fd7aaa19
100 changed files with 23 additions and 7917 deletions

View file

@ -8,6 +8,7 @@ add_subdirectory(hostname)
add_subdirectory(lodctr)
add_subdirectory(mode)
add_subdirectory(more)
#add_subdirectory(print)
add_subdirectory(reg)
add_subdirectory(sort)
add_subdirectory(taskkill)

View file

View file

@ -3,7 +3,6 @@ add_subdirectory(audiosrv)
add_subdirectory(eventlog)
add_subdirectory(rpcss)
add_subdirectory(schedsvc)
add_subdirectory(spoolsv)
add_subdirectory(srvsvc)
add_subdirectory(svchost)
add_subdirectory(tcpsvcs)

View file

@ -71,8 +71,6 @@ add_subdirectory(jsproxy)
add_subdirectory(kernel32)
add_subdirectory(kernel32_vista)
add_subdirectory(loadperf)
add_subdirectory(localspl)
add_subdirectory(localui)
add_subdirectory(lpk)
add_subdirectory(lsasrv)
add_subdirectory(lz32)
@ -192,7 +190,6 @@ add_subdirectory(smdll)
add_subdirectory(sndblst)
add_subdirectory(snmpapi)
add_subdirectory(softpub)
add_subdirectory(spoolss)
add_subdirectory(srclient)
add_subdirectory(stdole2.tlb)
add_subdirectory(stdole32.tlb)
@ -233,7 +230,6 @@ add_subdirectory(winhttp)
add_subdirectory(wininet)
add_subdirectory(winmm)
add_subdirectory(winscard)
add_subdirectory(winspool)
add_subdirectory(winsta)
add_subdirectory(wintrust)
add_subdirectory(wlanapi)

View file

@ -1,22 +0,0 @@
add_definitions(-D__WINESRC__)
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
spec2def(localspl.dll localspl.spec)
list(APPEND SOURCE
localmon.c
localspl_main.c
provider.c
localspl_private.h)
add_library(localspl SHARED
${SOURCE}
localspl.rc
${CMAKE_CURRENT_BINARY_DIR}/localspl_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/localspl.def)
set_module_type(localspl win32dll)
target_link_libraries(localspl wine)
add_importlibs(localspl spoolss user32 advapi32 shlwapi msvcrt kernel32 ntdll)
add_pch(localspl localspl_private.h SOURCE)
add_cd_file(TARGET localspl DESTINATION reactos/system32 FOR all)

View file

@ -1,28 +0,0 @@
/*
* Cefnogaeth iaith Cymraeg
* Welsh language support
*
* Copyright 2010 Ken Sharp
*
* 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
*/
LANGUAGE LANG_WELSH, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_LOCALPORT "Port Lleol"
IDS_LOCALMONITOR "Monitor Lleol"
}

View file

@ -1,27 +0,0 @@
/*
* Danish resources for localspl
*
* Copyright 2008 Jens Albretsen <jens@albretsen.dk>
*
* 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
*/
LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_LOCALPORT "Lokal port"
IDS_LOCALMONITOR "Lokal overvåger"
}

View file

@ -1,30 +0,0 @@
/*
* German resources for localspl
*
* Copyright 2005 Henning Gerhardt
* 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
*/
#pragma code_page(65001)
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
STRINGTABLE
{
IDS_LOCALPORT "Lokaler Anschluss"
IDS_LOCALMONITOR "Lokale Anzeige"
}

View file

@ -1,28 +0,0 @@
/*
* English resources for localspl
*
* Copyright 2005 Huw Davies
* 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
*/
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_LOCALPORT "Local Port"
IDS_LOCALMONITOR "Local Monitor"
}

View file

@ -1,30 +0,0 @@
/*
* Spanish resources for localspl
*
* Copyright 2010 José Manuel Ferrer Ortiz
*
* 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
*/
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
STRINGTABLE
{
IDS_LOCALPORT "Puerto local"
IDS_LOCALMONITOR "Monitor local"
}

View file

@ -1,27 +0,0 @@
/*
* French resources for localspl
*
* Copyright 2007 Jonathan Ernst
*
* 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
*/
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
STRINGTABLE
{
IDS_LOCALPORT "Port local"
IDS_LOCALMONITOR "Moniteur local"
}

View file

@ -1,30 +0,0 @@
/*
* Hebrew resources for localspl
*
* Copyright 2005 Huw Davies
* Copyright 2006 Detlef Riekenberg
*
* Translated by Baruch Rutman
*
* 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
*/
LANGUAGE LANG_HEBREW, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_LOCALPORT "יציאה מקומית"
IDS_LOCALMONITOR "ניטור מקומי"
}

View file

@ -1,30 +0,0 @@
/*
* Hungarian resources for localspl
*
* Copyright 2010 Andras Kovacs
*
* 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
*/
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_LOCALPORT "Helyi Port"
IDS_LOCALMONITOR "Helyi figyelő"
}

View file

@ -1,31 +0,0 @@
/*
* Italian resources for localspl
*
* Copyright 2005 Huw Davies
* 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
*/
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
STRINGTABLE
{
IDS_LOCALPORT "Porta locale"
IDS_LOCALMONITOR "Schermo locale"
}

View file

@ -1,31 +0,0 @@
/*
* Japanese resources for localspl
*
* Copyright 2005 Huw Davies
* 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
*/
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_LOCALPORT "ローカル ポート"
IDS_LOCALMONITOR "ローカル モニタ"
}

View file

@ -1,29 +0,0 @@
/*
* Korean resources for localspl
*
* Copyright 2005 Huw Davies
* Copyright 2006 Detlef Riekenberg
* Copyright 2006 YunSong Hwang
*
* 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
*/
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_LOCALPORT "지역 포트"
IDS_LOCALMONITOR "지역 모니터"
}

View file

@ -1,30 +0,0 @@
/*
* Lithuanian resources for localspl
*
* Copyright 2009 Aurimas Fišeras <aurimas@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_LITHUANIAN, SUBLANG_NEUTRAL
STRINGTABLE
{
IDS_LOCALPORT "Vietinis prievadas"
IDS_LOCALMONITOR "Vietinis monitorius"
}

View file

@ -1,27 +0,0 @@
/*
* Dutch resources for localspl
*
* Copyright 2008 Frans Kool
*
* 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
*/
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
STRINGTABLE
{
IDS_LOCALPORT "Lokale Poort"
IDS_LOCALMONITOR "Lokale Monitor"
}

View file

@ -1,27 +0,0 @@
/*
* Norwegian Bokmål resources for localspl
*
* Copyright 2006 Alexander N. Sørnes <alex@thehandofagony.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
STRINGTABLE
{
IDS_LOCALPORT "Lokal port"
IDS_LOCALMONITOR "Lokal overvåker"
}

View file

@ -1,29 +0,0 @@
/*
* Polish resources for localspl
*
* Copyright 2005 Huw Davies
* Copyright 2006 Detlef Riekenberg
* Copyright 2007 Mikolaj Zalewski
*
* 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
*/
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_LOCALPORT "Port lokalny"
IDS_LOCALMONITOR "Monitor lokalny"
}

View file

@ -1,27 +0,0 @@
/*
* Portuguese resources for localspl
*
* Copyright 2008 Ricardo Filipe
*
* 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
*/
LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
STRINGTABLE
{
IDS_LOCALPORT "Porta local"
IDS_LOCALMONITOR "Monitor Local"
}

View file

@ -1,30 +0,0 @@
/*
* Copyright 2005 Huw Davies
* Copyright 2006 Detlef Riekenberg
* Copyright 2008 Michael Stefaniuc
* 2011 Fulea Ștefan
*
* 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
*/
#pragma code_page(65001)
LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
STRINGTABLE
{
IDS_LOCALPORT "Port local"
IDS_LOCALMONITOR "Ecran local"
}

View file

@ -1,30 +0,0 @@
/*
* Russian resources for localspl
*
* Copyright 2008 Vitaliy Margolen
*
* 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
*/
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_LOCALPORT "Локальный порт"
IDS_LOCALMONITOR "Локальный монитор"
}

View file

@ -1,29 +0,0 @@
/*
* Slovenian resources for localspl
*
* Copyright 2008 Rok Mandeljc
*
* 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
*/
#pragma code_page(65001)
LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_LOCALPORT "Lokalna vrata"
IDS_LOCALMONITOR "Lokalen monitor"
}

View file

@ -1,29 +0,0 @@
/*
* English resources for localspl
*
* Copyright 2005 Huw Davies
* Copyright 2006 Detlef Riekenberg
* Translation: Ardit Dani (ALbanian Translation Resource File)
*
* 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
*/
LANGUAGE LANG_ALBANIAN, SUBLANG_NEUTRAL
STRINGTABLE
{
IDS_LOCALPORT "Porti Vendor"
IDS_LOCALMONITOR "Monitorim Vendor"
}

View file

@ -1,27 +0,0 @@
/*
* Swedish resources for localspl
*
* Copyright 2007 Daniel Nylander
*
* 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
*/
LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
STRINGTABLE
{
IDS_LOCALPORT "Lokal port"
IDS_LOCALMONITOR "Lokal skärm"
}

View file

@ -1,27 +0,0 @@
/*
* Turkish resources for localspl
*
* Copyright: 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_LOCALPORT "Yerli Giriş"
IDS_LOCALMONITOR "Yerli İzleyici"
}

View file

@ -1,30 +0,0 @@
/*
* Ukrainian resources for localspl
*
* Copyright 2010 Igor Paliychuk
*
* 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
*/
/* UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
STRINGTABLE
{
IDS_LOCALPORT "Локальний порт"
IDS_LOCALMONITOR "Локальний монітор"
}

View file

@ -1,38 +0,0 @@
/*
* localspl (Simplified and Traditional Chinese Resources)
*
* Copyright 2008 Hongbo Ni <hongbo.at.njstar.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* Chinese text is encoded in UTF-8 */
#pragma code_page(65001)
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
STRINGTABLE
{
IDS_LOCALPORT "本地端口"
IDS_LOCALMONITOR "本地监视器"
}
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
STRINGTABLE
{
IDS_LOCALPORT "本地端口"
IDS_LOCALMONITOR "本地監視器"
}

View file

@ -1,793 +0,0 @@
/*
* Implementation of the Local Printmonitor
*
* 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 "localspl_private.h"
#include "resource.h"
/*****************************************************/
static CRITICAL_SECTION port_handles_cs;
static CRITICAL_SECTION_DEBUG port_handles_cs_debug =
{
0, 0, &port_handles_cs,
{ &port_handles_cs_debug.ProcessLocksList, &port_handles_cs_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": port_handles_cs") }
};
static CRITICAL_SECTION port_handles_cs = { &port_handles_cs_debug, -1, 0, 0, 0, 0 };
static CRITICAL_SECTION xcv_handles_cs;
static CRITICAL_SECTION_DEBUG xcv_handles_cs_debug =
{
0, 0, &xcv_handles_cs,
{ &xcv_handles_cs_debug.ProcessLocksList, &xcv_handles_cs_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": xcv_handles_cs") }
};
static CRITICAL_SECTION xcv_handles_cs = { &xcv_handles_cs_debug, -1, 0, 0, 0, 0 };
/* ############################### */
typedef struct {
struct list entry;
DWORD type;
WCHAR nameW[1];
} port_t;
typedef struct {
struct list entry;
ACCESS_MASK GrantedAccess;
WCHAR nameW[1];
} xcv_t;
static struct list port_handles = LIST_INIT( port_handles );
static struct list xcv_handles = LIST_INIT( xcv_handles );
/* ############################### */
static const WCHAR cmd_AddPortW[] = {'A','d','d','P','o','r','t',0};
static const WCHAR cmd_DeletePortW[] = {'D','e','l','e','t','e','P','o','r','t',0};
static const WCHAR cmd_ConfigureLPTPortCommandOKW[] = {'C','o','n','f','i','g','u','r','e',
'L','P','T','P','o','r','t',
'C','o','m','m','a','n','d','O','K',0};
static const WCHAR cmd_GetDefaultCommConfigW[] = {'G','e','t',
'D','e','f','a','u','l','t',
'C','o','m','m','C','o','n','f','i','g',0};
static const WCHAR cmd_GetTransmissionRetryTimeoutW[] = {'G','e','t',
'T','r','a','n','s','m','i','s','s','i','o','n',
'R','e','t','r','y','T','i','m','e','o','u','t',0};
static const WCHAR cmd_MonitorUIW[] = {'M','o','n','i','t','o','r','U','I',0};
static const WCHAR cmd_PortIsValidW[] = {'P','o','r','t','I','s','V','a','l','i','d',0};
static const WCHAR cmd_SetDefaultCommConfigW[] = {'S','e','t',
'D','e','f','a','u','l','t',
'C','o','m','m','C','o','n','f','i','g',0};
static const WCHAR dllnameuiW[] = {'l','o','c','a','l','u','i','.','d','l','l',0};
static const WCHAR emptyW[] = {0};
static const WCHAR LocalPortW[] = {'L','o','c','a','l',' ','P','o','r','t',0};
static const WCHAR portname_LPT[] = {'L','P','T',0};
static const WCHAR portname_COM[] = {'C','O','M',0};
static const WCHAR portname_FILE[] = {'F','I','L','E',':',0};
static const WCHAR portname_CUPS[] = {'C','U','P','S',':',0};
static const WCHAR portname_LPR[] = {'L','P','R',':',0};
static const WCHAR TransmissionRetryTimeoutW[] = {'T','r','a','n','s','m','i','s','s','i','o','n',
'R','e','t','r','y','T','i','m','e','o','u','t',0};
static const WCHAR WinNT_CV_PortsW[] = {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s',' ','N','T','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'P','o','r','t','s',0};
static const WCHAR WinNT_CV_WindowsW[] = {'S','o','f','t','w','a','r','e','\\',
'M','i','c','r','o','s','o','f','t','\\',
'W','i','n','d','o','w','s',' ','N','T','\\',
'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
'W','i','n','d','o','w','s',0};
/******************************************************************
* does_port_exist (internal)
*
* returns TRUE, when the Port already exists
*
*/
static BOOL does_port_exist(LPCWSTR myname)
{
LPPORT_INFO_1W pi;
DWORD needed = 0;
DWORD returned;
DWORD id;
TRACE("(%s)\n", debugstr_w(myname));
id = EnumPortsW(NULL, 1, NULL, 0, &needed, &returned);
pi = heap_alloc(needed);
returned = 0;
if (pi)
id = EnumPortsW(NULL, 1, (LPBYTE) pi, needed, &needed, &returned);
if (id && returned > 0) {
/* we got a number of valid names. */
for (id = 0; id < returned; id++)
{
if (lstrcmpiW(myname, pi[id].pName) == 0) {
TRACE("(%u) found %s\n", id, debugstr_w(pi[id].pName));
heap_free(pi);
return TRUE;
}
}
}
heap_free(pi);
return FALSE;
}
/******************************************************************
* enumerate the local Ports from the Registry (internal)
*
* See localmon_EnumPortsW.
*
* NOTES
* returns the needed size (in bytes) for pPorts
* and *lpreturned is set to number of entries returned in pPorts
*
*/
static DWORD get_ports_from_reg(DWORD level, LPBYTE pPorts, DWORD cbBuf, LPDWORD lpreturned)
{
HKEY hroot = 0;
LPWSTR ptr;
LPPORT_INFO_2W out;
WCHAR portname[MAX_PATH];
WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
WCHAR res_MonitorW[IDS_LOCALMONITOR_MAXLEN];
INT reslen_PortW;
INT reslen_MonitorW;
DWORD len;
DWORD res;
DWORD needed = 0;
DWORD numentries;
DWORD entrysize;
DWORD id = 0;
TRACE("(%d, %p, %d, %p)\n", level, pPorts, cbBuf, lpreturned);
entrysize = (level == 1) ? sizeof(PORT_INFO_1W) : sizeof(PORT_INFO_2W);
numentries = *lpreturned; /* this is 0, when we scan the registry */
needed = entrysize * numentries;
ptr = (LPWSTR) &pPorts[needed];
if (needed > cbBuf) pPorts = NULL; /* No buffer for the structs */
numentries = 0;
needed = 0;
/* we do not check more parameters as done in windows */
if ((level < 1) || (level > 2)) {
goto getports_cleanup;
}
/* "+1" for '\0' */
reslen_MonitorW = LoadStringW(LOCALSPL_hInstance, IDS_LOCALMONITOR, res_MonitorW, IDS_LOCALMONITOR_MAXLEN) + 1;
reslen_PortW = LoadStringW(LOCALSPL_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN) + 1;
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_PortsW, &hroot);
if (res == ERROR_SUCCESS) {
/* Scan all Port-Names */
while (res == ERROR_SUCCESS) {
len = MAX_PATH;
portname[0] = '\0';
res = RegEnumValueW(hroot, id, portname, &len, NULL, NULL, NULL, NULL);
if ((res == ERROR_SUCCESS) && (portname[0])) {
numentries++;
/* calculate the required size */
needed += entrysize;
needed += (len + 1) * sizeof(WCHAR);
if (level > 1) {
needed += (reslen_MonitorW + reslen_PortW) * sizeof(WCHAR);
}
/* Now fill the user-buffer, if available */
if (pPorts && (cbBuf >= needed)){
out = (LPPORT_INFO_2W) pPorts;
pPorts += entrysize;
TRACE("%p: writing PORT_INFO_%dW #%d (%s)\n", out, level, numentries, debugstr_w(portname));
out->pPortName = ptr;
lstrcpyW(ptr, portname); /* Name of the Port */
ptr += (len + 1);
if (level > 1) {
out->pMonitorName = ptr;
lstrcpyW(ptr, res_MonitorW); /* Name of the Monitor */
ptr += reslen_MonitorW;
out->pDescription = ptr;
lstrcpyW(ptr, res_PortW); /* Port Description */
ptr += reslen_PortW;
out->fPortType = PORT_TYPE_WRITE;
out->Reserved = 0;
}
}
id++;
}
}
RegCloseKey(hroot);
}
else
{
ERR("failed with %d for %s\n", res, debugstr_w(WinNT_CV_PortsW));
SetLastError(res);
}
getports_cleanup:
*lpreturned = numentries;
TRACE("need %d byte for %d entries (%d)\n", needed, numentries, GetLastError());
return needed;
}
/*****************************************************
* get_type_from_name (internal)
*
*/
static DWORD get_type_from_name(LPCWSTR name)
{
HANDLE hfile;
if (!strncmpW(name, portname_LPT, sizeof(portname_LPT) / sizeof(WCHAR) -1))
return PORT_IS_LPT;
if (!strncmpW(name, portname_COM, sizeof(portname_COM) / sizeof(WCHAR) -1))
return PORT_IS_COM;
if (!strcmpW(name, portname_FILE))
return PORT_IS_FILE;
if (name[0] == '/')
return PORT_IS_UNIXNAME;
if (name[0] == '|')
return PORT_IS_PIPE;
if (!strncmpW(name, portname_CUPS, sizeof(portname_CUPS) / sizeof(WCHAR) -1))
return PORT_IS_CUPS;
if (!strncmpW(name, portname_LPR, sizeof(portname_LPR) / sizeof(WCHAR) -1))
return PORT_IS_LPR;
/* Must be a file or a directory. Does the file exist ? */
hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
TRACE("%p for OPEN_EXISTING on %s\n", hfile, debugstr_w(name));
if (hfile == INVALID_HANDLE_VALUE) {
/* Can we create the file? */
hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL);
TRACE("%p for OPEN_ALWAYS\n", hfile);
}
if (hfile != INVALID_HANDLE_VALUE) {
CloseHandle(hfile);
return PORT_IS_FILENAME;
}
/* We can't use the name. use GetLastError() for the reason */
return PORT_IS_UNKNOWN;
}
/*****************************************************
* get_type_from_local_name (internal)
*
*/
static DWORD get_type_from_local_name(LPCWSTR nameW)
{
LPPORT_INFO_1W pi;
LPWSTR myname = NULL;
DWORD needed = 0;
DWORD numentries = 0;
DWORD id = 0;
TRACE("(%s)\n", debugstr_w(myname));
needed = get_ports_from_reg(1, NULL, 0, &numentries);
pi = heap_alloc(needed);
if (pi)
needed = get_ports_from_reg(1, (LPBYTE) pi, needed, &numentries);
if (pi && needed && numentries > 0) {
/* we got a number of valid ports. */
while ((myname == NULL) && (id < numentries))
{
if (lstrcmpiW(nameW, pi[id].pName) == 0) {
TRACE("(%u) found %s\n", id, debugstr_w(pi[id].pName));
myname = pi[id].pName;
}
id++;
}
}
id = (myname) ? get_type_from_name(myname) : PORT_IS_UNKNOWN;
heap_free(pi);
return id;
}
/******************************************************************************
* localmon_AddPortExW [exported through MONITOREX]
*
* Add a Port, without presenting a user interface
*
* PARAMS
* pName [I] Servername or NULL (local Computer)
* level [I] Structure-Level (1) for pBuffer
* pBuffer [I] PTR to the Input-Data (PORT_INFO_1)
* pMonitorName [I] Name of the Monitor that manage the Port
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
* NOTES
* Level 2 is documented on MSDN for Portmonitors, but not supported by the
* "Local Port" Portmonitor (localspl.dll / localmon.dll)
*/
static BOOL WINAPI localmon_AddPortExW(LPWSTR pName, DWORD level, LPBYTE pBuffer, LPWSTR pMonitorName)
{
PORT_INFO_1W * pi;
HKEY hroot;
DWORD res;
pi = (PORT_INFO_1W *) pBuffer;
TRACE("(%s, %d, %p, %s) => %s\n", debugstr_w(pName), level, pBuffer,
debugstr_w(pMonitorName), debugstr_w(pi ? pi->pName : NULL));
if ((pMonitorName == NULL) || (lstrcmpiW(pMonitorName, LocalPortW) != 0 ) ||
(pi == NULL) || (pi->pName == NULL) || (pi->pName[0] == '\0') ) {
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (level != 1) {
SetLastError(ERROR_INVALID_LEVEL);
return FALSE;
}
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_PortsW, &hroot);
if (res == ERROR_SUCCESS) {
if (does_port_exist(pi->pName)) {
RegCloseKey(hroot);
TRACE("=> FALSE with %u\n", ERROR_INVALID_PARAMETER);
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
res = RegSetValueExW(hroot, pi->pName, 0, REG_SZ, (const BYTE *) emptyW, sizeof(emptyW));
RegCloseKey(hroot);
}
if (res != ERROR_SUCCESS) SetLastError(ERROR_INVALID_PARAMETER);
TRACE("=> %u with %u\n", (res == ERROR_SUCCESS), GetLastError());
return (res == ERROR_SUCCESS);
}
/*****************************************************
* localmon_ClosePort [exported through MONITOREX]
*
* Close a
*
* PARAMS
* hPort [i] The Handle to close
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
*/
static BOOL WINAPI localmon_ClosePort(HANDLE hPort)
{
port_t * port = hPort;
TRACE("(%p)\n", port);
EnterCriticalSection(&port_handles_cs);
list_remove(&port->entry);
LeaveCriticalSection(&port_handles_cs);
heap_free(port);
return TRUE;
}
/*****************************************************
* localmon_EnumPortsW [exported through MONITOREX]
*
* Enumerate all local Ports
*
* PARAMS
* pName [I] Servername (ignored)
* level [I] Structure-Level (1 or 2)
* pPorts [O] PTR to Buffer that receives the Result
* cbBuf [I] Size of Buffer at pPorts
* pcbNeeded [O] PTR to DWORD that receives the size in Bytes used / required for pPorts
* pcReturned [O] PTR to DWORD that receives the number of Ports in pPorts
*
* RETURNS
* Success: TRUE
* Failure: FALSE and in pcbNeeded the Bytes required for pPorts, if cbBuf is too small
*
* NOTES
*| Windows ignores pName
*| Windows crash the app, when pPorts, pcbNeeded or pcReturned are NULL
*| Windows >NT4.0 does not check for illegal levels (TRUE is returned)
*
* ToDo
* "HCU\Software\Wine\Spooler\<portname>" - redirection
*
*/
static BOOL WINAPI localmon_EnumPortsW(LPWSTR pName, DWORD level, LPBYTE pPorts,
DWORD cbBuf, LPDWORD pcbNeeded, LPDWORD pcReturned)
{
BOOL res = FALSE;
DWORD needed;
DWORD numentries;
TRACE("(%s, %d, %p, %d, %p, %p)\n",
debugstr_w(pName), level, pPorts, cbBuf, pcbNeeded, pcReturned);
numentries = 0;
needed = get_ports_from_reg(level, NULL, 0, &numentries);
/* we calculated the needed buffersize. now do the error-checks */
if (cbBuf < needed) {
SetLastError(ERROR_INSUFFICIENT_BUFFER);
goto cleanup;
}
/* fill the buffer with the Port-Names */
needed = get_ports_from_reg(level, pPorts, cbBuf, &numentries);
res = TRUE;
if (pcReturned) *pcReturned = numentries;
cleanup:
if (pcbNeeded) *pcbNeeded = needed;
TRACE("returning %d with %d (%d byte for %d entries)\n",
res, GetLastError(), needed, numentries);
return (res);
}
/*****************************************************
* localmon_OpenPort [exported through MONITOREX]
*
* Open a Data-Channel for a Port
*
* PARAMS
* pName [i] Name of selected Object
* phPort [o] The resulting Handle is stored here
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
*/
static BOOL WINAPI localmon_OpenPortW(LPWSTR pName, PHANDLE phPort)
{
port_t * port;
DWORD type;
TRACE("%s, %p)\n", debugstr_w(pName), phPort);
/* an empty name is invalid */
if (!pName[0]) return FALSE;
/* does the port exist? */
type = get_type_from_local_name(pName);
if (!type) return FALSE;
port = heap_alloc(FIELD_OFFSET(port_t, nameW[lstrlenW(pName) + 1]));
if (!port) return FALSE;
port->type = type;
lstrcpyW(port->nameW, pName);
*phPort = port;
EnterCriticalSection(&port_handles_cs);
list_add_tail(&port_handles, &port->entry);
LeaveCriticalSection(&port_handles_cs);
TRACE("=> %p\n", port);
return TRUE;
}
/*****************************************************
* localmon_XcvClosePort [exported through MONITOREX]
*
* Close a Communication-Channel
*
* PARAMS
* hXcv [i] The Handle to close
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
*/
static BOOL WINAPI localmon_XcvClosePort(HANDLE hXcv)
{
xcv_t * xcv = hXcv;
TRACE("(%p)\n", xcv);
/* No checks are done in Windows */
EnterCriticalSection(&xcv_handles_cs);
list_remove(&xcv->entry);
LeaveCriticalSection(&xcv_handles_cs);
heap_free(xcv);
return TRUE;
}
/*****************************************************
* localmon_XcvDataPort [exported through MONITOREX]
*
* Execute command through a Communication-Channel
*
* PARAMS
* hXcv [i] The Handle to work with
* pszDataName [i] Name of the command to execute
* pInputData [i] Buffer for extra Input Data (needed only for some commands)
* cbInputData [i] Size in Bytes of Buffer at pInputData
* pOutputData [o] Buffer to receive additional Data (needed only for some commands)
* cbOutputData [i] Size in Bytes of Buffer at pOutputData
* pcbOutputNeeded [o] PTR to receive the minimal Size in Bytes of the Buffer at pOutputData
*
* RETURNS
* Success: ERROR_SUCCESS
* Failure: win32 error code
*
* NOTES
*
* Minimal List of commands, that every Printmonitor DLL should support:
*
*| "MonitorUI" : Return the Name of the Userinterface-DLL as WSTR in pOutputData
*| "AddPort" : Add a Port (Name as WSTR in pInputData)
*| "DeletePort": Delete a Port (Name as WSTR in pInputData)
*
*
*/
static DWORD WINAPI localmon_XcvDataPort(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInputData, DWORD cbInputData,
PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
{
WCHAR buffer[16]; /* buffer for a decimal number */
LPWSTR ptr;
DWORD res;
DWORD needed;
HKEY hroot;
TRACE("(%p, %s, %p, %d, %p, %d, %p)\n", hXcv, debugstr_w(pszDataName),
pInputData, cbInputData, pOutputData, cbOutputData, pcbOutputNeeded);
if (!lstrcmpW(pszDataName, cmd_AddPortW)) {
TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData));
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_PortsW, &hroot);
if (res == ERROR_SUCCESS) {
if (does_port_exist((LPWSTR) pInputData)) {
RegCloseKey(hroot);
TRACE("=> %u\n", ERROR_ALREADY_EXISTS);
return ERROR_ALREADY_EXISTS;
}
res = RegSetValueExW(hroot, (LPWSTR) pInputData, 0, REG_SZ, (const BYTE *) emptyW, sizeof(emptyW));
RegCloseKey(hroot);
}
TRACE("=> %u\n", res);
return res;
}
if (!lstrcmpW(pszDataName, cmd_ConfigureLPTPortCommandOKW)) {
TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData));
res = RegCreateKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_WindowsW, &hroot);
if (res == ERROR_SUCCESS) {
res = RegSetValueExW(hroot, TransmissionRetryTimeoutW, 0, REG_SZ, pInputData, cbInputData);
RegCloseKey(hroot);
}
return res;
}
if (!lstrcmpW(pszDataName, cmd_DeletePortW)) {
TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData));
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_PortsW, &hroot);
if (res == ERROR_SUCCESS) {
res = RegDeleteValueW(hroot, (LPWSTR) pInputData);
RegCloseKey(hroot);
TRACE("=> %u with %u\n", res, GetLastError() );
return res;
}
return ERROR_FILE_NOT_FOUND;
}
if (!lstrcmpW(pszDataName, cmd_GetDefaultCommConfigW)) {
TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData));
*pcbOutputNeeded = cbOutputData;
res = GetDefaultCommConfigW((LPWSTR) pInputData, (LPCOMMCONFIG) pOutputData, pcbOutputNeeded);
TRACE("got %u with %u\n", res, GetLastError() );
return res ? ERROR_SUCCESS : GetLastError();
}
if (!lstrcmpW(pszDataName, cmd_GetTransmissionRetryTimeoutW)) {
* pcbOutputNeeded = sizeof(DWORD);
if (cbOutputData >= sizeof(DWORD)) {
/* the w2k resource kit documented a default of 90, but that's wrong */
*((LPDWORD) pOutputData) = 45;
res = RegOpenKeyW(HKEY_LOCAL_MACHINE, WinNT_CV_WindowsW, &hroot);
if (res == ERROR_SUCCESS) {
needed = sizeof(buffer) - sizeof(WCHAR);
res = RegQueryValueExW(hroot, TransmissionRetryTimeoutW, NULL, NULL, (LPBYTE) buffer, &needed);
if ((res == ERROR_SUCCESS) && (buffer[0])) {
*((LPDWORD) pOutputData) = strtoulW(buffer, NULL, 0);
}
RegCloseKey(hroot);
}
return ERROR_SUCCESS;
}
return ERROR_INSUFFICIENT_BUFFER;
}
if (!lstrcmpW(pszDataName, cmd_MonitorUIW)) {
* pcbOutputNeeded = sizeof(dllnameuiW);
if (cbOutputData >= sizeof(dllnameuiW)) {
memcpy(pOutputData, dllnameuiW, sizeof(dllnameuiW));
return ERROR_SUCCESS;
}
return ERROR_INSUFFICIENT_BUFFER;
}
if (!lstrcmpW(pszDataName, cmd_PortIsValidW)) {
TRACE("InputData (%d): %s\n", cbInputData, debugstr_w( (LPWSTR) pInputData));
res = get_type_from_name((LPCWSTR) pInputData);
TRACE("detected as %u\n", res);
/* names, that we have recognized, are valid */
if (res) return ERROR_SUCCESS;
/* ERROR_ACCESS_DENIED, ERROR_PATH_NOT_FOUND or something else */
TRACE("=> %u\n", GetLastError());
return GetLastError();
}
if (!lstrcmpW(pszDataName, cmd_SetDefaultCommConfigW)) {
/* get the portname from the Handle */
ptr = strchrW(((xcv_t *)hXcv)->nameW, ' ');
if (ptr) {
ptr++; /* skip the space */
}
else
{
ptr = ((xcv_t *)hXcv)->nameW;
}
lstrcpynW(buffer, ptr, sizeof(buffer)/sizeof(WCHAR));
if (buffer[0]) buffer[lstrlenW(buffer)-1] = '\0'; /* remove the ':' */
res = SetDefaultCommConfigW(buffer, (LPCOMMCONFIG) pInputData, cbInputData);
TRACE("got %u with %u\n", res, GetLastError() );
return res ? ERROR_SUCCESS : GetLastError();
}
FIXME("command not supported: %s\n", debugstr_w(pszDataName));
return ERROR_INVALID_PARAMETER;
}
/*****************************************************
* localmon_XcvOpenPort [exported through MONITOREX]
*
* Open a Communication-Channel
*
* PARAMS
* pName [i] Name of selected Object
* GrantedAccess [i] Access-Rights to use
* phXcv [o] The resulting Handle is stored here
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
*/
static BOOL WINAPI localmon_XcvOpenPort(LPCWSTR pName, ACCESS_MASK GrantedAccess, PHANDLE phXcv)
{
xcv_t * xcv;
TRACE("%s, 0x%x, %p)\n", debugstr_w(pName), GrantedAccess, phXcv);
/* No checks for any field is done in Windows */
xcv = heap_alloc(FIELD_OFFSET(xcv_t, nameW[lstrlenW(pName) + 1]));
if (xcv) {
xcv->GrantedAccess = GrantedAccess;
lstrcpyW(xcv->nameW, pName);
*phXcv = xcv;
EnterCriticalSection(&xcv_handles_cs);
list_add_tail(&xcv_handles, &xcv->entry);
LeaveCriticalSection(&xcv_handles_cs);
TRACE("=> %p\n", xcv);
return TRUE;
}
else
{
*phXcv = NULL;
return FALSE;
}
}
/*****************************************************
* InitializePrintMonitor (LOCALSPL.@)
*
* Initialize the Monitor for the Local Ports
*
* PARAMS
* regroot [I] Registry-Path, where the settings are stored
*
* RETURNS
* Success: Pointer to a MONITOREX Structure
* Failure: NULL
*
* NOTES
* The fixed location "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Ports"
* is used to store the Ports (IniFileMapping from "win.ini", Section "Ports").
* Native localspl.dll fails, when no valid Port-Entry is present.
*
*/
LPMONITOREX WINAPI InitializePrintMonitor(LPWSTR regroot)
{
static MONITOREX mymonitorex =
{
sizeof(MONITOREX) - sizeof(DWORD),
{
localmon_EnumPortsW,
localmon_OpenPortW,
NULL, /* localmon_OpenPortExW */
NULL, /* localmon_StartDocPortW */
NULL, /* localmon_WritePortW */
NULL, /* localmon_ReadPortW */
NULL, /* localmon_EndDocPortW */
localmon_ClosePort,
NULL, /* Use AddPortUI in localui.dll */
localmon_AddPortExW,
NULL, /* Use ConfigurePortUI in localui.dll */
NULL, /* Use DeletePortUI in localui.dll */
NULL, /* localmon_GetPrinterDataFromPort */
NULL, /* localmon_SetPortTimeOuts */
localmon_XcvOpenPort,
localmon_XcvDataPort,
localmon_XcvClosePort
}
};
TRACE("(%s)\n", debugstr_w(regroot));
/* Parameter "regroot" is ignored on NT4.0 (localmon.dll) */
if (!regroot || !regroot[0]) {
SetLastError(ERROR_INVALID_PARAMETER);
return NULL;
}
TRACE("=> %p\n", &mymonitorex);
/* Native windows returns always the same pointer on success */
return &mymonitorex;
}

View file

@ -1,107 +0,0 @@
/*
* Top level resource file for localspl
*
* 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 "resource.h"
#define WINE_FILENAME_STR "localspl.dll"
#define WINE_FILEDESCRIPTION_STR "Wine Printer spooler component"
/* 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>
/* UTF-8 */
#pragma code_page(65001)
#ifdef LANGUAGE_DA_DK
#include "lang/spl_Da.rc"
#endif
#ifdef LANGUAGE_DE_DE
#include "lang/spl_De.rc"
#endif
#ifdef LANGUAGE_EN_US
#include "lang/spl_En.rc"
#endif
#ifdef LANGUAGE_ES_ES
#include "lang/spl_Es.rc"
#endif
#ifdef LANGUAGE_FR_FR
#include "lang/spl_Fr.rc"
#endif
#ifdef LANGUAGE_HE_IL
#include "lang/spl_He.rc"
#endif
#ifdef LANGUAGE_HU_HU
#include "lang/spl_Hu.rc"
#endif
#ifdef LANGUAGE_IT_IT
#include "lang/spl_It.rc"
#endif
#ifdef LANGUAGE_JA_JP
#include "lang/spl_Ja.rc"
#endif
#ifdef LANGUAGE_KO_KR
#include "lang/spl_Ko.rc"
#endif
#ifdef LANGUAGE_LT_LT
#include "lang/spl_Lt.rc"
#endif
#ifdef LANGUAGE_NL_NL
#include "lang/spl_Nl.rc"
#endif
#ifdef LANGUAGE_NO_NO
#include "lang/spl_No.rc"
#endif
#ifdef LANGUAGE_PL_PL
#include "lang/spl_Pl.rc"
#endif
#ifdef LANGUAGE_PT_PT
#include "lang/spl_Pt.rc"
#endif
#ifdef LANGUAGE_RO_RO
#include "lang/spl_Ro.rc"
#endif
#ifdef LANGUAGE_RU_RU
#include "lang/spl_Ru.rc"
#endif
#ifdef LANGUAGE_SL_SI
#include "lang/spl_Si.rc"
#endif
#ifdef LANGUAGE_SQ_AL
#include "lang/spl_Sq.rc"
#endif
#ifdef LANGUAGE_SV_SE
#include "lang/spl_Sv.rc"
#endif
#ifdef LANGUAGE_TR_TR
#include "lang/spl_Tr.rc"
#endif
#ifdef LANGUAGE_UK_UA
#include "lang/spl_Uk.rc"
#endif
#ifdef LANGUAGE_ZH_CN
#include "lang/spl_Zh.rc"
#endif

View file

@ -1,64 +0,0 @@
@ stub ClosePrintProcessor
@ stub ControlPrintProcessor
@ stub EnumPrintProcessorDatatypesW
@ stub GetPrintProcessorCapabilities
@ stdcall InitializePrintMonitor(wstr)
# "Providor" is no typo here
@ stdcall InitializePrintProvidor(ptr long wstr)
@ stub OpenPrintProcessor
@ stub PrintDocumentOnPrintProcessor
@ stub PrintProcLogEvent
@ stub SplAddForm
@ stub SplAddMonitor
@ stub SplAddPort
@ stub SplAddPortEx
@ stub SplAddPrinter
@ stub SplAddPrinterDriverEx
@ stub SplAddPrintProcessor
@ stub SplBroadcastChange
@ stub SplClosePrinter
@ stub SplCloseSpooler
@ stub SplConfigChange
@ stub SplCopyFileEvent
@ stub SplCopyNumberOfFiles
@ stub SplCreateSpooler
@ stub SplDeleteForm
@ stub SplDeleteMonitor
@ stub SplDeletePort
@ stub SplDeletePrinter
@ stub SplDeletePrinterDriverEx
@ stub SplDeletePrinterKey
@ stub SplDeletePrintProcessor
@ stub SplDeleteSpooler
@ stub SplDriverEvent
@ stub SplEnumForms
@ stub SplEnumMonitors
@ stub SplEnumPorts
@ stub SplEnumPrinterDataEx
@ stub SplEnumPrinterKey
@ stub SplEnumPrinters
@ stub SplEnumPrintProcessorDatatypes
@ stub SplEnumPrintProcessors
@ stub SplGetDriverDir
@ stub SplGetForm
@ stub SplGetPrinter
@ stub SplGetPrinterData
@ stub SplGetPrinterDataEx
@ stub SplGetPrinterDriver
@ stub SplGetPrinterDriverDirectory
@ stub SplGetPrinterDriverEx
@ stub SplGetPrinterExtra
@ stub SplGetPrinterExtraEx
@ stub SplGetPrintProcessorDirectory
@ stub SplLoadLibraryTheCopyFileModule
@ stub SplMonitorIsInstalled
@ stub SplOpenPrinter
@ stub SplReenumeratePorts
@ stub SplResetPrinter
@ stub SplSetForm
@ stub SplSetPrinter
@ stub SplSetPrinterData
@ stub SplSetPrinterDataEx
@ stub SplSetPrinterExtra
@ stub SplSetPrinterExtraEx
@ stub SplXcvData

View file

@ -1,44 +0,0 @@
/*
* Implementation of the Local Printprovider/ Printmonitor/ Prontprocessor
*
* Copyright 2006-2009 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 "localspl_private.h"
HINSTANCE LOCALSPL_hInstance = NULL;
/*****************************************************
* 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 );
LOCALSPL_hInstance = hinstDLL;
setup_provider();
break;
}
return TRUE;
}

View file

@ -1,89 +0,0 @@
/*
* Implementation of the Local Printmonitor: internal include file
*
* 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
*/
#ifndef __WINE_LOCALSPL_PRIVATE__
#define __WINE_LOCALSPL_PRIVATE__
#include <stdarg.h>
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#define COBJMACROS
#define NONAMELESSUNION
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winuser.h>
#include <winreg.h>
#include <winspool.h>
#include <wine/list.h>
#include <wine/unicode.h>
#include <ddk/winsplp.h>
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(localspl);
/* ## DLL-wide Globals ## */
extern HINSTANCE LOCALSPL_hInstance DECLSPEC_HIDDEN;
void setup_provider(void) DECLSPEC_HIDDEN;
/* ## Type of Ports ## */
/* windows types */
#define PORT_IS_UNKNOWN 0
#define PORT_IS_LPT 1
#define PORT_IS_COM 2
#define PORT_IS_FILE 3
#define PORT_IS_FILENAME 4
/* wine extensions */
#define PORT_IS_WINE 5
#define PORT_IS_UNIXNAME 5
#define PORT_IS_PIPE 6
#define PORT_IS_CUPS 7
#define PORT_IS_LPR 8
/* ## Memory allocation functions ## */
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc( size_t len )
{
return HeapAlloc( GetProcessHeap(), 0, len );
}
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero( size_t len )
{
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len );
}
static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero( void * mem, size_t len )
{
return HeapReAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len );
}
static inline BOOL heap_free( void *mem )
{
return HeapFree( GetProcessHeap(), 0, mem );
}
#endif /* __WINE_LOCALSPL_PRIVATE__ */

File diff suppressed because it is too large Load diff

View file

@ -1,9 +0,0 @@
#pragma once
/* ## Resource-ID ## */
#define IDS_LOCALPORT 500
#define IDS_LOCALMONITOR 507
/* ## Reserved memorysize for the strings (in WCHAR) ## */
#define IDS_LOCALMONITOR_MAXLEN 64
#define IDS_LOCALPORT_MAXLEN 32

View file

@ -1,20 +0,0 @@
add_definitions(-D__WINESRC__)
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
spec2def(spoolss.dll spoolss.spec ADD_IMPORTLIB)
list(APPEND SOURCE
spoolss_main.c
router.c
spoolss.h
${CMAKE_CURRENT_BINARY_DIR}/spoolss_stubs.c)
add_library(spoolss SHARED
${SOURCE}
${CMAKE_CURRENT_BINARY_DIR}/spoolss.def)
set_module_type(spoolss win32dll)
target_link_libraries(spoolss wine)
add_importlibs(spoolss msvcrt kernel32 ntdll)
add_pch(spoolss spoolss.h SOURCE)
add_cd_file(TARGET spoolss DESTINATION reactos/system32 FOR all)

View file

@ -1,563 +0,0 @@
/*
* Routing for Spooler-Service helper DLL
*
* Copyright 2006-2009 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 "spoolss.h"
#include <winreg.h>
#include <wingdi.h>
#include <winspool.h>
#include <ddk/winsplp.h>
/* ################################ */
#define MAX_BACKEND 3
typedef struct {
/* PRINTPROVIDOR functions */
DWORD (WINAPI *fpOpenPrinter)(LPWSTR, HANDLE *, LPPRINTER_DEFAULTSW);
DWORD (WINAPI *fpSetJob)(HANDLE, DWORD, DWORD, LPBYTE, DWORD);
DWORD (WINAPI *fpGetJob)(HANDLE, DWORD, DWORD, LPBYTE, DWORD, LPDWORD);
DWORD (WINAPI *fpEnumJobs)(HANDLE, DWORD, DWORD, DWORD, LPBYTE, DWORD, LPDWORD, LPDWORD);
HANDLE (WINAPI *fpAddPrinter)(LPWSTR, DWORD, LPBYTE);
DWORD (WINAPI *fpDeletePrinter)(HANDLE);
DWORD (WINAPI *fpSetPrinter)(HANDLE, DWORD, LPBYTE, DWORD);
DWORD (WINAPI *fpGetPrinter)(HANDLE, DWORD, LPBYTE, DWORD, LPDWORD);
DWORD (WINAPI *fpEnumPrinters)(DWORD, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD, LPDWORD);
DWORD (WINAPI *fpAddPrinterDriver)(LPWSTR, DWORD, LPBYTE);
DWORD (WINAPI *fpEnumPrinterDrivers)(LPWSTR, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD, LPDWORD);
DWORD (WINAPI *fpGetPrinterDriver)(HANDLE, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD);
DWORD (WINAPI *fpGetPrinterDriverDirectory)(LPWSTR, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD);
DWORD (WINAPI *fpDeletePrinterDriver)(LPWSTR, LPWSTR, LPWSTR);
DWORD (WINAPI *fpAddPrintProcessor)(LPWSTR, LPWSTR, LPWSTR, LPWSTR);
DWORD (WINAPI *fpEnumPrintProcessors)(LPWSTR, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD, LPDWORD);
DWORD (WINAPI *fpGetPrintProcessorDirectory)(LPWSTR, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD);
DWORD (WINAPI *fpDeletePrintProcessor)(LPWSTR, LPWSTR, LPWSTR);
DWORD (WINAPI *fpEnumPrintProcessorDatatypes)(LPWSTR, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD, LPDWORD);
DWORD (WINAPI *fpStartDocPrinter)(HANDLE, DWORD, LPBYTE);
DWORD (WINAPI *fpStartPagePrinter)(HANDLE);
DWORD (WINAPI *fpWritePrinter)(HANDLE, LPVOID, DWORD, LPDWORD);
DWORD (WINAPI *fpEndPagePrinter)(HANDLE);
DWORD (WINAPI *fpAbortPrinter)(HANDLE);
DWORD (WINAPI *fpReadPrinter)(HANDLE, LPVOID, DWORD, LPDWORD);
DWORD (WINAPI *fpEndDocPrinter)(HANDLE);
DWORD (WINAPI *fpAddJob)(HANDLE, DWORD, LPBYTE, DWORD, LPDWORD);
DWORD (WINAPI *fpScheduleJob)(HANDLE, DWORD);
DWORD (WINAPI *fpGetPrinterData)(HANDLE, LPWSTR, LPDWORD, LPBYTE, DWORD, LPDWORD);
DWORD (WINAPI *fpSetPrinterData)(HANDLE, LPWSTR, DWORD, LPBYTE, DWORD);
DWORD (WINAPI *fpWaitForPrinterChange)(HANDLE, DWORD);
DWORD (WINAPI *fpClosePrinter)(HANDLE);
DWORD (WINAPI *fpAddForm)(HANDLE, DWORD, LPBYTE);
DWORD (WINAPI *fpDeleteForm)(HANDLE, LPWSTR);
DWORD (WINAPI *fpGetForm)(HANDLE, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD);
DWORD (WINAPI *fpSetForm)(HANDLE, LPWSTR, DWORD, LPBYTE);
DWORD (WINAPI *fpEnumForms)(HANDLE, DWORD, LPBYTE, DWORD, LPDWORD, LPDWORD);
DWORD (WINAPI *fpEnumMonitors)(LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD, LPDWORD);
DWORD (WINAPI *fpEnumPorts)(LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD, LPDWORD);
DWORD (WINAPI *fpAddPort)(LPWSTR, HWND, LPWSTR);
DWORD (WINAPI *fpConfigurePort)(LPWSTR, HWND, LPWSTR);
DWORD (WINAPI *fpDeletePort)(LPWSTR, HWND, LPWSTR);
HANDLE (WINAPI *fpCreatePrinterIC)(HANDLE, LPDEVMODEW);
DWORD (WINAPI *fpPlayGdiScriptOnPrinterIC)(HANDLE, LPBYTE, DWORD, LPBYTE, DWORD, DWORD);
DWORD (WINAPI *fpDeletePrinterIC)(HANDLE);
DWORD (WINAPI *fpAddPrinterConnection)(LPWSTR);
DWORD (WINAPI *fpDeletePrinterConnection)(LPWSTR);
DWORD (WINAPI *fpPrinterMessageBox)(HANDLE, DWORD, HWND, LPWSTR, LPWSTR, DWORD);
DWORD (WINAPI *fpAddMonitor)(LPWSTR, DWORD, LPBYTE);
DWORD (WINAPI *fpDeleteMonitor)(LPWSTR, LPWSTR, LPWSTR);
DWORD (WINAPI *fpResetPrinter)(HANDLE, LPPRINTER_DEFAULTSW);
DWORD (WINAPI *fpGetPrinterDriverEx)(HANDLE, LPWSTR, DWORD, LPBYTE, DWORD, LPDWORD, DWORD, DWORD, PDWORD, PDWORD);
HANDLE (WINAPI *fpFindFirstPrinterChangeNotification)(HANDLE, DWORD, DWORD, LPVOID);
DWORD (WINAPI *fpFindClosePrinterChangeNotification)(HANDLE);
DWORD (WINAPI *fpAddPortEx)(HANDLE, LPWSTR, DWORD, LPBYTE, LPWSTR);
DWORD (WINAPI *fpShutDown)(LPVOID);
DWORD (WINAPI *fpRefreshPrinterChangeNotification)(HANDLE, DWORD, PVOID, PVOID);
DWORD (WINAPI *fpOpenPrinterEx)(LPWSTR, LPHANDLE, LPPRINTER_DEFAULTSW, LPBYTE, DWORD);
HANDLE (WINAPI *fpAddPrinterEx)(LPWSTR, DWORD, LPBYTE, LPBYTE, DWORD);
DWORD (WINAPI *fpSetPort)(LPWSTR, LPWSTR, DWORD, LPBYTE);
DWORD (WINAPI *fpEnumPrinterData)(HANDLE, DWORD, LPWSTR, DWORD, LPDWORD, LPDWORD, LPBYTE, DWORD, LPDWORD);
DWORD (WINAPI *fpDeletePrinterData)(HANDLE, LPWSTR);
DWORD (WINAPI *fpClusterSplOpen)(LPCWSTR, LPCWSTR, PHANDLE, LPCWSTR, LPCWSTR);
DWORD (WINAPI *fpClusterSplClose)(HANDLE);
DWORD (WINAPI *fpClusterSplIsAlive)(HANDLE);
DWORD (WINAPI *fpSetPrinterDataEx)(HANDLE, LPCWSTR, LPCWSTR, DWORD, LPBYTE, DWORD);
DWORD (WINAPI *fpGetPrinterDataEx)(HANDLE, LPCWSTR, LPCWSTR, LPDWORD, LPBYTE, DWORD, LPDWORD);
DWORD (WINAPI *fpEnumPrinterDataEx)(HANDLE, LPCWSTR, LPBYTE, DWORD, LPDWORD, LPDWORD);
DWORD (WINAPI *fpEnumPrinterKey)(HANDLE, LPCWSTR, LPWSTR, DWORD, LPDWORD);
DWORD (WINAPI *fpDeletePrinterDataEx)(HANDLE, LPCWSTR, LPCWSTR);
DWORD (WINAPI *fpDeletePrinterKey)(HANDLE hPrinter, LPCWSTR pKeyName);
DWORD (WINAPI *fpSeekPrinter)(HANDLE, LARGE_INTEGER, PLARGE_INTEGER, DWORD, BOOL);
DWORD (WINAPI *fpDeletePrinterDriverEx)(LPWSTR, LPWSTR, LPWSTR, DWORD, DWORD);
DWORD (WINAPI *fpAddPerMachineConnection)(LPCWSTR, LPCWSTR, LPCWSTR, LPCWSTR);
DWORD (WINAPI *fpDeletePerMachineConnection)(LPCWSTR, LPCWSTR);
DWORD (WINAPI *fpEnumPerMachineConnections)(LPCWSTR, LPBYTE, DWORD, LPDWORD, LPDWORD);
DWORD (WINAPI *fpXcvData)(HANDLE, LPCWSTR, PBYTE, DWORD, PBYTE, DWORD, PDWORD, PDWORD);
DWORD (WINAPI *fpAddPrinterDriverEx)(LPWSTR, DWORD, LPBYTE, DWORD);
DWORD (WINAPI *fpSplReadPrinter)(HANDLE, LPBYTE *, DWORD);
DWORD (WINAPI *fpDriverUnloadComplete)(LPWSTR);
DWORD (WINAPI *fpGetSpoolFileInfo)(HANDLE, LPWSTR *, LPHANDLE, HANDLE, HANDLE);
DWORD (WINAPI *fpCommitSpoolData)(HANDLE, DWORD);
DWORD (WINAPI *fpCloseSpoolFileHandle)(HANDLE);
DWORD (WINAPI *fpFlushPrinter)(HANDLE, LPBYTE, DWORD, LPDWORD, DWORD);
DWORD (WINAPI *fpSendRecvBidiData)(HANDLE, LPCWSTR, LPBIDI_REQUEST_CONTAINER, LPBIDI_RESPONSE_CONTAINER *);
DWORD (WINAPI *fpAddDriverCatalog)(HANDLE, DWORD, VOID *, DWORD);
/* Private Data */
HMODULE dll;
LPWSTR dllname;
LPWSTR name;
LPWSTR regroot;
DWORD index;
} backend_t;
/* ################################ */
static backend_t *backend[MAX_BACKEND];
static DWORD used_backends = 0;
static CRITICAL_SECTION backend_cs;
static CRITICAL_SECTION_DEBUG backend_cs_debug =
{
0, 0, &backend_cs,
{ &backend_cs_debug.ProcessLocksList, &backend_cs_debug.ProcessLocksList },
0, 0, { (DWORD_PTR)(__FILE__ ": backend_cs") }
};
static CRITICAL_SECTION backend_cs = { &backend_cs_debug, -1, 0, 0, 0, 0 };
/* ################################ */
static WCHAR localsplW[] = {'l','o','c','a','l','s','p','l','.','d','l','l',0};
/******************************************************************
* strdupW [internal]
*
* create a copy of a unicode-string
*
*/
static LPWSTR strdupW(LPCWSTR p)
{
LPWSTR ret;
DWORD len;
if(!p) return NULL;
len = (lstrlenW(p) + 1) * sizeof(WCHAR);
ret = heap_alloc(len);
memcpy(ret, p, len);
return ret;
}
/******************************************************************
* backend_unload_all [internal]
*
* unload all backends
*/
void backend_unload_all(void)
{
EnterCriticalSection(&backend_cs);
while (used_backends > 0) {
used_backends--;
FreeLibrary(backend[used_backends]->dll);
heap_free(backend[used_backends]->dllname);
heap_free(backend[used_backends]->name);
heap_free(backend[used_backends]->regroot);
heap_free(backend[used_backends]);
backend[used_backends] = NULL;
}
LeaveCriticalSection(&backend_cs);
}
/******************************************************************************
* backend_load [internal]
*
* load and init a backend
*
* PARAMS
* name [I] Printprovider to use for the backend. NULL for the local print provider
*
* RETURNS
* Success: PTR to the backend
* Failure: NULL
*
*/
static backend_t * backend_load(LPWSTR dllname, LPWSTR name, LPWSTR regroot)
{
BOOL (WINAPI *pInitializePrintProvidor)(LPPRINTPROVIDOR, DWORD, LPWSTR);
DWORD id;
DWORD res;
TRACE("(%s, %s, %s)\n", debugstr_w(dllname), debugstr_w(name), debugstr_w(regroot));
EnterCriticalSection(&backend_cs);
id = used_backends;
backend[id] = heap_alloc_zero(sizeof(backend_t));
if (!backend[id]) {
LeaveCriticalSection(&backend_cs);
return NULL;
}
backend[id]->dllname = strdupW(dllname);
backend[id]->name = strdupW(name);
backend[id]->regroot = strdupW(regroot);
backend[id]->dll = LoadLibraryW(dllname);
if (backend[id]->dll) {
pInitializePrintProvidor = (void *) GetProcAddress(backend[id]->dll, "InitializePrintProvidor");
if (pInitializePrintProvidor) {
/* native localspl does not clear unused entries */
res = pInitializePrintProvidor((PRINTPROVIDOR *) backend[id], sizeof(PRINTPROVIDOR), regroot);
if (res) {
used_backends++;
backend[id]->index = used_backends;
LeaveCriticalSection(&backend_cs);
TRACE("--> backend #%d: %p (%s)\n", id, backend[id], debugstr_w(dllname));
return backend[id];
}
}
FreeLibrary(backend[id]->dll);
}
heap_free(backend[id]->dllname);
heap_free(backend[id]->name);
heap_free(backend[id]->regroot);
heap_free(backend[id]);
backend[id] = NULL;
LeaveCriticalSection(&backend_cs);
WARN("failed to init %s: %u\n", debugstr_w(dllname), GetLastError());
return NULL;
}
/******************************************************************************
* backend_load_all [internal]
*
* load and init all backends
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
*/
BOOL backend_load_all(void)
{
static BOOL failed = FALSE;
EnterCriticalSection(&backend_cs);
/* if we failed before, don't try again */
if (!failed && (used_backends == 0)) {
backend_load(localsplW, NULL, NULL);
/* ToDo: parse the registry and load all other backends */
failed = (used_backends == 0);
}
LeaveCriticalSection(&backend_cs);
TRACE("-> %d\n", !failed);
return (!failed);
}
/******************************************************************************
* backend_first [internal]
*
* find the first usable backend
*
* RETURNS
* Success: PTR to the backend
* Failure: NULL
*
*/
static backend_t * backend_first(LPWSTR name)
{
EnterCriticalSection(&backend_cs);
/* Load all backends, when not done yet */
if (used_backends || backend_load_all()) {
/* test for the local system first */
if (!name || !name[0]) {
LeaveCriticalSection(&backend_cs);
return backend[0];
}
}
FIXME("server %s not supported in %d backends\n", debugstr_w(name), used_backends);
LeaveCriticalSection(&backend_cs);
return NULL;
}
/******************************************************************
* AddMonitorW (spoolss.@)
*
* Install a Printmonitor
*
* PARAMS
* pName [I] Servername or NULL (local Computer)
* Level [I] Structure-Level (Must be 2)
* pMonitors [I] PTR to MONITOR_INFO_2
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
* NOTES
* All Files for the Monitor must already be copied to %winsysdir% ("%SystemRoot%\system32")
*
*/
BOOL WINAPI AddMonitorW(LPWSTR pName, DWORD Level, LPBYTE pMonitors)
{
backend_t * pb;
DWORD res = ROUTER_UNKNOWN;
TRACE("(%s, %d, %p)\n", debugstr_w(pName), Level, pMonitors);
if (Level != 2) {
SetLastError(ERROR_INVALID_LEVEL);
return FALSE;
}
pb = backend_first(pName);
if (pb && pb->fpAddMonitor)
res = pb->fpAddMonitor(pName, Level, pMonitors);
else
{
SetLastError(ERROR_PROC_NOT_FOUND);
}
TRACE("got %u with %u\n", res, GetLastError());
return (res == ROUTER_SUCCESS);
}
/******************************************************************
* AddPrinterDriverExW (spoolss.@)
*
* Install a Printer Driver with the Option to upgrade / downgrade the Files
*
* PARAMS
* pName [I] Servername or NULL (local Computer)
* level [I] Level for the supplied DRIVER_INFO_*W struct
* pDriverInfo [I] PTR to DRIVER_INFO_*W struct with the Driver Parameter
* dwFileCopyFlags [I] How to Copy / Upgrade / Downgrade the needed Files
*
* RESULTS
* Success: TRUE
* Failure: FALSE
*
*/
BOOL WINAPI AddPrinterDriverExW(LPWSTR pName, DWORD level, LPBYTE pDriverInfo, DWORD dwFileCopyFlags)
{
backend_t * pb;
DWORD res = ROUTER_UNKNOWN;
TRACE("(%s, %d, %p, 0x%x)\n", debugstr_w(pName), level, pDriverInfo, dwFileCopyFlags);
if (!pDriverInfo) {
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
pb = backend_first(pName);
if (pb && pb->fpAddPrinterDriverEx)
res = pb->fpAddPrinterDriverEx(pName, level, pDriverInfo, dwFileCopyFlags);
else
{
SetLastError(ERROR_PROC_NOT_FOUND);
}
TRACE("got %u with %u\n", res, GetLastError());
return (res == ROUTER_SUCCESS);
}
/******************************************************************
* DeleteMonitorW (spoolss.@)
*
* Delete a specific Printmonitor from a Printing-Environment
*
* PARAMS
* pName [I] Servername or NULL (local Computer)
* pEnvironment [I] Printing-Environment of the Monitor or NULL (Default)
* pMonitorName [I] Name of the Monitor, that should be deleted
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
*/
BOOL WINAPI DeleteMonitorW(LPWSTR pName, LPWSTR pEnvironment, LPWSTR pMonitorName)
{
backend_t * pb;
DWORD res = ROUTER_UNKNOWN;
TRACE("(%s, %s, %s)\n", debugstr_w(pName), debugstr_w(pEnvironment), debugstr_w(pMonitorName));
pb = backend_first(pName);
if (pb && pb->fpDeleteMonitor)
res = pb->fpDeleteMonitor(pName, pEnvironment, pMonitorName);
else
{
SetLastError(ERROR_PROC_NOT_FOUND);
}
TRACE("got %u with %u\n", res, GetLastError());
return (res == ROUTER_SUCCESS);
}
/******************************************************************
* EnumMonitorsW (spoolss.@)
*
* Enumerate available Port-Monitors
*
* PARAMS
* pName [I] Servername or NULL (local Computer)
* Level [I] Structure-Level
* pMonitors [O] PTR to Buffer that receives the Result
* cbBuf [I] Size of Buffer at pMonitors
* pcbNeeded [O] PTR to DWORD that receives the size in Bytes used / required for pMonitors
* pcReturned [O] PTR to DWORD that receives the number of Monitors in pMonitors
*
* RETURNS
* Success: TRUE
* Failure: FALSE and in pcbNeeded the Bytes required for pMonitors, if cbBuf is too small
*
*/
BOOL WINAPI EnumMonitorsW(LPWSTR pName, DWORD Level, LPBYTE pMonitors, DWORD cbBuf,
LPDWORD pcbNeeded, LPDWORD pcReturned)
{
backend_t * pb;
DWORD res = ROUTER_UNKNOWN;
TRACE("(%s, %d, %p, %d, %p, %p)\n", debugstr_w(pName), Level, pMonitors,
cbBuf, pcbNeeded, pcReturned);
if (pcbNeeded) *pcbNeeded = 0;
if (pcReturned) *pcReturned = 0;
pb = backend_first(pName);
if (pb && pb->fpEnumMonitors)
res = pb->fpEnumMonitors(pName, Level, pMonitors, cbBuf, pcbNeeded, pcReturned);
else
{
SetLastError(ERROR_PROC_NOT_FOUND);
}
TRACE("got %u with %u (%u byte for %u entries)\n\n", res, GetLastError(),
pcbNeeded ? *pcbNeeded : 0, pcReturned ? *pcReturned : 0);
return (res == ROUTER_SUCCESS);
}
/******************************************************************
* EnumPortsW (spoolss.@)
*
* Enumerate available Ports
*
* PARAMS
* pName [I] Servername or NULL (local Computer)
* Level [I] Structure-Level (1 or 2)
* pPorts [O] PTR to Buffer that receives the Result
* cbBuf [I] Size of Buffer at pPorts
* pcbNeeded [O] PTR to DWORD that receives the size in Bytes used / required for pPorts
* pcReturned [O] PTR to DWORD that receives the number of Ports in pPorts
*
* RETURNS
* Success: TRUE
* Failure: FALSE and in pcbNeeded the Bytes required for pPorts, if cbBuf is too small
*
*/
BOOL WINAPI EnumPortsW(LPWSTR pName, DWORD Level, LPBYTE pPorts, DWORD cbBuf,
LPDWORD pcbNeeded, LPDWORD pcReturned)
{
backend_t * pb;
DWORD res = ROUTER_UNKNOWN;
TRACE("(%s, %d, %p, %d, %p, %p)\n", debugstr_w(pName), Level, pPorts, cbBuf,
pcbNeeded, pcReturned);
if (pcbNeeded) *pcbNeeded = 0;
if (pcReturned) *pcReturned = 0;
pb = backend_first(pName);
if (pb && pb->fpEnumPorts)
res = pb->fpEnumPorts(pName, Level, pPorts, cbBuf, pcbNeeded, pcReturned);
else
{
SetLastError(ERROR_PROC_NOT_FOUND);
}
TRACE("got %u with %u (%u byte for %u entries)\n", res, GetLastError(),
pcbNeeded ? *pcbNeeded : 0, pcReturned ? *pcReturned : 0);
return (res == ROUTER_SUCCESS);
}
/******************************************************************
* GetPrinterDriverDirectoryW (spoolss.@)
*
* Return the PATH for the Printer-Drivers
*
* PARAMS
* pName [I] Servername or NULL (local Computer)
* pEnvironment [I] Printing-Environment or NULL (Default)
* Level [I] Structure-Level (must be 1)
* pDriverDirectory [O] PTR to Buffer that receives the Result
* cbBuf [I] Size of Buffer at pDriverDirectory
* pcbNeeded [O] PTR to DWORD that receives the size in Bytes used /
* required for pDriverDirectory
*
* RETURNS
* Success: TRUE and in pcbNeeded the Bytes used in pDriverDirectory
* Failure: FALSE and in pcbNeeded the Bytes required for pDriverDirectory,
* if cbBuf is too small
*
* Native Values returned in pDriverDirectory on Success:
*| NT(Windows NT x86): "%winsysdir%\\spool\\DRIVERS\\w32x86"
*| NT(Windows x64): "%winsysdir%\\spool\\DRIVERS\\x64"
*| NT(Windows 4.0): "%winsysdir%\\spool\\DRIVERS\\win40"
*| win9x(Windows 4.0): "%winsysdir%"
*
* "%winsysdir%" is the Value from GetSystemDirectoryW()
*
*/
BOOL WINAPI GetPrinterDriverDirectoryW(LPWSTR pName, LPWSTR pEnvironment,
DWORD Level, LPBYTE pDriverDirectory, DWORD cbBuf, LPDWORD pcbNeeded)
{
backend_t * pb;
DWORD res = ROUTER_UNKNOWN;
TRACE("(%s, %s, %d, %p, %d, %p)\n", debugstr_w(pName),
debugstr_w(pEnvironment), Level, pDriverDirectory, cbBuf, pcbNeeded);
if (pcbNeeded) *pcbNeeded = 0;
pb = backend_first(pName);
if (pb && pb->fpGetPrinterDriverDirectory)
res = pb->fpGetPrinterDriverDirectory(pName, pEnvironment, Level,
pDriverDirectory, cbBuf, pcbNeeded);
else
{
SetLastError(ERROR_PROC_NOT_FOUND);
}
TRACE("got %u with %u (%u byte)\n",
res, GetLastError(), pcbNeeded ? *pcbNeeded : 0);
return (res == ROUTER_SUCCESS);
}

View file

@ -1,53 +0,0 @@
/*
* Copyright 2006-2009 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 _SPOOLSS_H_
#define _SPOOLSS_H_
#include <stdarg.h>
#define WIN32_NO_STATUS
#include <windef.h>
#include <winbase.h>
#include <wine/debug.h>
WINE_DEFAULT_DEBUG_CHANNEL(spoolss);
/* ################################ */
BOOL backend_load_all(void) DECLSPEC_HIDDEN;
void backend_unload_all(void) DECLSPEC_HIDDEN;
/* ## Memory allocation functions ## */
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc( size_t len )
{
return HeapAlloc( GetProcessHeap(), 0, len );
}
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero( size_t len )
{
return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len );
}
static inline BOOL heap_free( void *mem )
{
return HeapFree( GetProcessHeap(), 0, mem );
}
#endif /* _SPOOLSS_H_ */

View file

@ -1,151 +0,0 @@
@ stub AbortPrinter
@ stub AddFormW
@ stub AddJobW
@ stdcall AddMonitorW(wstr long ptr)
@ stub AddPerMachineConnectionW
@ stub AddPortExW
@ stub AddPortW
@ stub AddPrintProcessorW
@ stub AddPrintProvidorW
@ stub AddPrinterConnectionW
@ stdcall AddPrinterDriverExW(wstr long ptr long)
@ stub AddPrinterDriverW
@ stub AddPrinterExW
@ stub AddPrinterW
@ stdcall AllocSplStr(wstr)
@ stub AppendPrinterNotifyInfoData
@ stdcall BuildOtherNamesFromMachineName(ptr ptr)
@ stub CallDrvDevModeConversion
@ stub CallRouterFindFirstPrinterChangeNotification
@ stub ClosePrinter
@ stub ClusterSplClose
@ stub ClusterSplIsAlive
@ stub ClusterSplOpen
@ stub ConfigurePortW
@ stub CreatePrinterIC
@ stub DbgGetPointers
@ stub DeleteFormW
@ stdcall DeleteMonitorW(wstr wstr wstr)
@ stub DeletePerMachineConnectionW
@ stub DeletePortW
@ stub DeletePrintProcessorW
@ stub DeletePrintProvidorW
@ stub DeletePrinter
@ stub DeletePrinterConnectionW
@ stub DeletePrinterDataExW
@ stub DeletePrinterDataW
@ stub DeletePrinterDriverExW
@ stub DeletePrinterDriverW
@ stub DeletePrinterIC
@ stub DeletePrinterKeyW
@ stdcall DllAllocSplMem(long)
@ stdcall DllFreeSplMem(ptr)
@ stdcall DllFreeSplStr(wstr)
@ stub EndDocPrinter
@ stub EndPagePrinter
@ stub EnumFormsW
@ stub EnumJobsW
@ stdcall EnumMonitorsW(wstr long ptr long ptr ptr)
@ stub EnumPerMachineConnectionsW
@ stdcall EnumPortsW(wstr long ptr long ptr ptr)
@ stub EnumPrintProcessorDatatypesW
@ stub EnumPrintProcessorsW
@ stub EnumPrinterDataExW
@ stub EnumPrinterDataW
@ stub EnumPrinterDriversW
@ stub EnumPrinterKeyW
@ stub EnumPrintersW
@ stub FindClosePrinterChangeNotification
@ stub FlushPrinter
@ stub FormatPrinterForRegistryKey
@ stub FormatRegistryKeyForPrinter
@ stub FreeOtherNames
@ stub GetClientUserHandle
@ stub GetFormW
@ stub GetJobAttributes
@ stub GetJobW
@ stub GetNetworkId
@ stub GetPrintProcessorDirectoryW
@ stub GetPrinterDataExW
@ stub GetPrinterDataW
@ stdcall GetPrinterDriverDirectoryW(wstr wstr long ptr long ptr)
@ stub GetPrinterDriverExW
@ stub GetPrinterDriverW
@ stub GetPrinterW
@ stdcall ImpersonatePrinterClient(long)
@ stdcall InitializeRouter()
@ stdcall IsLocalCall()
@ stub IsNamedPipeRpcCall
@ stub LoadDriver
@ stub LoadDriverFiletoConvertDevmode
@ stub MIDL_user_allocate1
@ stub MIDL_user_free1
@ stub MarshallDownStructure
@ stub MarshallUpStructure
@ stub OldGetPrinterDriverW
@ stub OpenPrinterExW
@ stub OpenPrinterPortW
@ stub OpenPrinterW
@ stub PackStrings
@ stub PartialReplyPrinterChangeNotification
@ stub PlayGdiScriptOnPrinterIC
@ stub PrinterHandleRundown
@ stub PrinterMessageBoxW
@ stub ProvidorFindClosePrinterChangeNotification
@ stub ProvidorFindFirstPrinterChangeNotification
@ stub ReadPrinter
@ stub ReallocSplMem
@ stub ReallocSplStr
@ stub RemoteFindFirstPrinterChangeNotification
@ stub ReplyClosePrinter
@ stub ReplyOpenPrinter
@ stub ReplyPrinterChangeNotification
@ stub ResetPrinterW
@ stdcall RevertToPrinterSelf()
@ stub RouterAllocPrinterNotifyInfo
@ stub RouterFindFirstPrinterChangeNotification
@ stub RouterFindNextPrinterChangeNotification
@ stub RouterFreePrinterNotifyInfo
@ stub RouterRefreshPrinterChangeNotification
@ stub RouterReplyPrinter
@ stub ScheduleJob
@ stub SeekPrinter
@ stub SetAllocFailCount
@ stub SetFormW
@ stub SetJobW
@ stub SetPortW
@ stub SetPrinterDataExW
@ stub SetPrinterDataW
@ stub SetPrinterW
@ stub SplCloseSpoolFileHandle
@ stub SplCommitSpoolData
@ stub SplDriverUnloadComplete
@ stub SplGetSpoolFileInfo
@ stdcall SplInitializeWinSpoolDrv(ptr)
@ stdcall SplIsUpgrade()
@ stub SplProcessPnPEvent
@ stub SplReadPrinter
@ stub SplRegisterForDeviceEvents
@ stub SplStartPhase2Init
@ stub SplUnregisterForDeviceEvents
@ stub SpoolerFindClosePrinterChangeNotification
@ stub SpoolerFindFirstPrinterChangeNotification
@ stub SpoolerFindNextPrinterChangeNotification
@ stub SpoolerFreePrinterNotifyInfo
@ stdcall SpoolerHasInitialized()
@ stdcall SpoolerInit()
@ stub StartDocPrinterW
@ stub StartPagePrinter
@ stub UnloadDriver
@ stub UnloadDriverFile
@ stub UpdateBufferSize
@ stub UpdatePrinterRegAll
@ stub UpdatePrinterRegUser
@ stub WaitForPrinterChange
@ stdcall WaitForSpoolerInitialization()
@ stub WritePrinter
@ stub XcvDataW
@ stub bGetDevModePerUser
@ stub bSetDevModePerUser
@ stub pszDbgAllocMsgA
@ stub vDbgLogError

View file

@ -1,276 +0,0 @@
/*
* Implementation of the Spooler-Service helper DLL
*
* 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 "spoolss.h"
/* ################################ */
static HMODULE hwinspool;
static const WCHAR winspooldrvW[] = {'w','i','n','s','p','o','o','l','.','d','r','v',0};
/******************************************************************************
*
*/
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;
case DLL_PROCESS_DETACH:
if (lpvReserved) break;
backend_unload_all();
break;
}
}
return TRUE;
}
/******************************************************************
* AllocSplStr [SPOOLSS.@]
*
* Create a copy from the String on the Spooler-Heap
*
* PARAMS
* pwstr [I] PTR to the String to copy
*
* RETURNS
* Failure: NULL
* Success: PTR to the copied String
*
*/
LPWSTR WINAPI AllocSplStr(LPCWSTR pwstr)
{
LPWSTR res = NULL;
DWORD len;
TRACE("(%s)\n", debugstr_w(pwstr));
if (!pwstr) return NULL;
len = (lstrlenW(pwstr) + 1) * sizeof(WCHAR);
res = HeapAlloc(GetProcessHeap(), 0, len);
if (res) lstrcpyW(res, pwstr);
TRACE("returning %p\n", res);
return res;
}
/******************************************************************
* BuildOtherNamesFromMachineName [SPOOLSS.@]
*/
BOOL WINAPI BuildOtherNamesFromMachineName(LPVOID * ptr1, LPVOID * ptr2)
{
FIXME("(%p, %p) stub\n", ptr1, ptr2);
*ptr1 = NULL;
*ptr2 = NULL;
return FALSE;
}
/******************************************************************
* DllAllocSplMem [SPOOLSS.@]
*
* Allocate cleared memory from the spooler heap
*
* PARAMS
* size [I] Number of bytes to allocate
*
* RETURNS
* Failure: NULL
* Success: PTR to the allocated memory
*
* NOTES
* We use the process heap (Windows use a separate spooler heap)
*
*/
LPVOID WINAPI DllAllocSplMem(DWORD size)
{
LPVOID res;
res = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
TRACE("(%d) => %p\n", size, res);
return res;
}
/******************************************************************
* DllFreeSplMem [SPOOLSS.@]
*
* Free the allocated spooler memory
*
* PARAMS
* memory [I] PTR to the memory allocated by DllAllocSplMem
*
* RETURNS
* Failure: FALSE
* Success: TRUE
*
* NOTES
* We use the process heap (Windows use a separate spooler heap)
*
*/
BOOL WINAPI DllFreeSplMem(LPBYTE memory)
{
TRACE("(%p)\n", memory);
return HeapFree(GetProcessHeap(), 0, memory);
}
/******************************************************************
* DllFreeSplStr [SPOOLSS.@]
*
* Free the allocated Spooler-String
*
* PARAMS
* pwstr [I] PTR to the WSTR, allocated by AllocSplStr
*
* RETURNS
* Failure: FALSE
* Success: TRUE
*
*/
BOOL WINAPI DllFreeSplStr(LPWSTR pwstr)
{
TRACE("(%s) PTR: %p\n", debugstr_w(pwstr), pwstr);
return HeapFree(GetProcessHeap(), 0, pwstr);
}
/******************************************************************
* ImpersonatePrinterClient [SPOOLSS.@]
*/
BOOL WINAPI ImpersonatePrinterClient(HANDLE hToken)
{
FIXME("(%p) stub\n", hToken);
return TRUE;
}
/******************************************************************
* InitializeRouter [SPOOLSS.@]
*/
BOOL WINAPI InitializeRouter(void)
{
TRACE("()\n");
return backend_load_all();
}
/******************************************************************
* IsLocalCall [SPOOLSS.@]
*/
BOOL WINAPI IsLocalCall(void)
{
FIXME("() stub\n");
return TRUE;
}
/******************************************************************
* RevertToPrinterSelf [SPOOLSS.@]
*/
HANDLE WINAPI RevertToPrinterSelf(void)
{
FIXME("() stub\n");
return (HANDLE) 0xdead0947;
}
/******************************************************************
* SplInitializeWinSpoolDrv [SPOOLSS.@]
*
* Dynamic load "winspool.drv" and fill an array with some function-pointer
*
* PARAMS
* table [I] array of function-pointer to fill
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*
* NOTES
* Native "spoolss.dll" from w2k fill the table with 11 Function-Pointer.
* We implement the XP-Version (The table has only 9 Pointer)
*
*/
BOOL WINAPI SplInitializeWinSpoolDrv(LPVOID * table)
{
DWORD res;
TRACE("(%p)\n", table);
hwinspool = LoadLibraryW(winspooldrvW);
if (!hwinspool) return FALSE;
table[0] = (void *) GetProcAddress(hwinspool, "OpenPrinterW");
table[1] = (void *) GetProcAddress(hwinspool, "ClosePrinter");
table[2] = (void *) GetProcAddress(hwinspool, "SpoolerDevQueryPrintW");
table[3] = (void *) GetProcAddress(hwinspool, "SpoolerPrinterEvent");
table[4] = (void *) GetProcAddress(hwinspool, "DocumentPropertiesW");
table[5] = (void *) GetProcAddress(hwinspool, (LPSTR) 212); /* LoadPrinterDriver */
table[6] = (void *) GetProcAddress(hwinspool, (LPSTR) 213); /* RefCntLoadDriver */
table[7] = (void *) GetProcAddress(hwinspool, (LPSTR) 214); /* RefCntUnloadDriver */
table[8] = (void *) GetProcAddress(hwinspool, (LPSTR) 215); /* ForceUnloadDriver */
for (res = 0; res < 9; res++) {
if (table[res] == NULL) return FALSE;
}
return TRUE;
}
/******************************************************************
* SplIsUpgrade [SPOOLSS.@]
*/
BOOL WINAPI SplIsUpgrade(void)
{
FIXME("() stub\n");
return FALSE;
}
/******************************************************************
* SpoolerHasInitialized [SPOOLSS.@]
*/
BOOL WINAPI SpoolerHasInitialized(void)
{
FIXME("() stub\n");
return TRUE;
}
/******************************************************************
* SpoolerInit [SPOOLSS.@]
*/
BOOL WINAPI SpoolerInit(void)
{
FIXME("() stub\n");
return TRUE;
}
/******************************************************************
* WaitForSpoolerInitialization [SPOOLSS.@]
*/
BOOL WINAPI WaitForSpoolerInitialization(void)
{
FIXME("() stub\n");
return TRUE;
}

View file

@ -1,21 +0,0 @@
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
spec2def(winspool.drv winspool.spec ADD_IMPORTLIB)
list(APPEND SOURCE
info.c
stubs.c
precomp.h)
add_library(winspool.drv SHARED
${SOURCE}
winspool.rc
${CMAKE_CURRENT_BINARY_DIR}/winspool_stubs.c
${CMAKE_CURRENT_BINARY_DIR}/winspool.def)
set_target_properties(winspool.drv PROPERTIES SUFFIX "")
set_module_type(winspool.drv win32dll UNICODE)
target_link_libraries(winspool.drv wine)
add_importlibs(winspool.drv advapi32 shlwapi msvcrt kernel32 ntdll)
add_pch(winspool.drv precomp.h SOURCE)
add_cd_file(TARGET winspool.drv DESTINATION reactos/system32 FOR all)

View file

@ -1,555 +0,0 @@
/*
* WINSPOOL functions
*
* Copyright 1996 John Harvey
* Copyright 1998 Andreas Mohr
* Copyright 1999 Klaas van Gend
* Copyright 1999, 2000 Huw D M Davies
* Copyright 2001 Marcus Meissner
*
* 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 Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "precomp.h"
#include <winreg.h>
#include <winnls.h>
#include <shlwapi.h>
/******************************************************************************
* GetDefaultPrinterA (WINSPOOL.@)
*/
BOOL WINAPI GetDefaultPrinterA(LPSTR name, LPDWORD namesize)
{
char *ptr;
if (*namesize < 1)
{
SetLastError (ERROR_INSUFFICIENT_BUFFER);
return FALSE;
}
if (!GetProfileStringA ("windows", "device", "", name, *namesize))
{
SetLastError (ERROR_FILE_NOT_FOUND);
return FALSE;
}
if ((ptr = strchr (name, ',')) == NULL)
{
SetLastError (ERROR_FILE_NOT_FOUND);
return FALSE;
}
*ptr = '\0';
*namesize = strlen (name) + 1;
return TRUE;
}
/******************************************************************************
* GetDefaultPrinterW (WINSPOOL.@)
*/
BOOL WINAPI GetDefaultPrinterW(LPWSTR name, LPDWORD namesize)
{
char *buf;
BOOL ret;
if (*namesize < 1)
{
SetLastError (ERROR_INSUFFICIENT_BUFFER);
return FALSE;
}
buf = HeapAlloc (GetProcessHeap (), 0, *namesize);
ret = GetDefaultPrinterA (buf, namesize);
if (ret)
{
DWORD len = MultiByteToWideChar (CP_ACP, 0, buf, -1, name, *namesize);
if (!len)
{
SetLastError (ERROR_INSUFFICIENT_BUFFER);
ret = FALSE;
}
else *namesize = len;
}
HeapFree (GetProcessHeap (), 0, buf);
return ret;
}
/******************************************************************************
* AddPrintProvidorA (WINSPOOL.@)
*/
BOOL
WINAPI
AddPrintProvidorA(LPSTR Name, DWORD Level, PBYTE Buffer)
{
if (Name || Level > 2 || Buffer == NULL)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (Level == 1)
{
BOOL bRet;
PROVIDOR_INFO_1W Provider;
PROVIDOR_INFO_1A *Prov = (PROVIDOR_INFO_1A*)Buffer;
if (Prov->pName == NULL || Prov->pDLLName == NULL || Prov->pEnvironment == NULL)
{
return FALSE;
}
Provider.pDLLName = HeapAlloc(GetProcessHeap(), 0, (strlen(Prov->pDLLName)+1) * sizeof(WCHAR));
if (Provider.pDLLName)
{
MultiByteToWideChar(CP_ACP, 0, Prov->pDLLName, -1, Provider.pDLLName, strlen(Prov->pDLLName)+1);
Provider.pDLLName[strlen(Prov->pDLLName)] = L'\0';
}
Provider.pEnvironment = HeapAlloc(GetProcessHeap(), 0, (strlen(Prov->pEnvironment)+1) * sizeof(WCHAR));
if (Provider.pEnvironment)
{
MultiByteToWideChar(CP_ACP, 0, Prov->pEnvironment, -1, Provider.pEnvironment, strlen(Prov->pEnvironment)+1);
Provider.pEnvironment[strlen(Prov->pEnvironment)] = L'\0';
}
Provider.pName = HeapAlloc(GetProcessHeap(), 0, (strlen(Prov->pName)+1) * sizeof(WCHAR));
if (Provider.pName)
{
MultiByteToWideChar(CP_ACP, 0, Prov->pName, -1, Provider.pName, strlen(Prov->pName)+1);
Provider.pName[strlen(Prov->pName)] = L'\0';
}
bRet = AddPrintProvidorW(NULL, Level, (LPBYTE)&Provider);
if (Provider.pDLLName)
HeapFree(GetProcessHeap(), 0, Provider.pDLLName);
if (Provider.pEnvironment)
HeapFree(GetProcessHeap(), 0, Provider.pEnvironment);
if (Provider.pName)
HeapFree(GetProcessHeap(), 0, Provider.pName);
return bRet;
}
else
{
PROVIDOR_INFO_2W Provider;
PROVIDOR_INFO_2A *Prov = (PROVIDOR_INFO_2A*)Buffer;
Provider.pOrder = HeapAlloc(GetProcessHeap(), 0, (strlen(Prov->pOrder)+1) * sizeof(WCHAR));
if (Provider.pOrder)
{
BOOL bRet;
MultiByteToWideChar(CP_ACP, 0, Prov->pOrder, -1, Provider.pOrder, strlen(Prov->pOrder)+1);
Provider.pOrder[strlen(Prov->pOrder)] = L'\0';
bRet = AddPrintProvidorW(NULL, Level, (LPBYTE)&Provider);
HeapFree(GetProcessHeap(), 0, Provider.pOrder);
return bRet;
}
}
return FALSE;
}
/******************************************************************************
* AddPrintProvidorW (WINSPOOL.@)
*/
BOOL
WINAPI
AddPrintProvidorW(LPWSTR Name, DWORD Level, PBYTE Buffer)
{
HKEY hKey;
LPWSTR pOrder;
DWORD dwSize, dwType;
BOOL bRet = FALSE;
if (Name || Level > 2 || Buffer == NULL)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Print\\Providers", 0, KEY_READ | KEY_WRITE, &hKey) != ERROR_SUCCESS)
{
return FALSE;
}
if (RegQueryValueExW(hKey, L"Order", NULL, &dwType, NULL, &dwSize) != ERROR_SUCCESS || dwType != REG_MULTI_SZ)
{
RegCloseKey(hKey);
return FALSE;
}
pOrder = HeapAlloc(GetProcessHeap(), 0, dwSize);
if (!pOrder)
{
RegCloseKey(hKey);
return FALSE;
}
if (RegQueryValueExW(hKey, L"Order", NULL, &dwType, (LPBYTE)pOrder, &dwSize) != ERROR_SUCCESS || dwType != REG_MULTI_SZ)
{
RegCloseKey(hKey);
return FALSE;
}
if (Level == 1)
{
LPWSTR pBuffer;
BOOL bFound = FALSE;
PROVIDOR_INFO_1W * Prov = (PROVIDOR_INFO_1W*)Buffer;
if (Prov->pName == NULL || Prov->pDLLName == NULL || Prov->pEnvironment == NULL)
{
SetLastError(ERROR_INVALID_PARAMETER);
RegCloseKey(hKey);
return FALSE;
}
pBuffer = pOrder;
while(pBuffer[0])
{
if (!wcsicmp(pBuffer, Prov->pName))
{
bFound = TRUE;
break;
}
pBuffer += wcslen(pBuffer) + 1;
}
if (!bFound)
{
HKEY hSubKey;
DWORD dwFullSize = dwSize + (wcslen(Prov->pName)+1) * sizeof(WCHAR);
if (RegCreateKeyExW(hKey, Prov->pName, 0, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL) == ERROR_SUCCESS)
{
RegSetValueExW(hSubKey, L"Name", 0, REG_SZ, (LPBYTE)Prov->pDLLName, (wcslen(Prov->pDLLName)+1) * sizeof(WCHAR));
RegCloseKey(hSubKey);
}
pBuffer = HeapAlloc(GetProcessHeap(), 0, dwFullSize);
if (pBuffer)
{
CopyMemory(pBuffer, pOrder, dwSize);
wcscpy(&pBuffer[(dwSize/sizeof(WCHAR))-1], Prov->pName);
pBuffer[(dwSize/sizeof(WCHAR)) + wcslen(Prov->pName)] = L'\0';
RegSetValueExW(hKey, L"Order", 0, REG_MULTI_SZ, (LPBYTE)pBuffer, dwFullSize);
HeapFree(GetProcessHeap(), 0, pBuffer);
}
bRet = TRUE;
}
}
RegCloseKey(hKey);
HeapFree(GetProcessHeap(), 0, pOrder);
return bRet;
}
/******************************************************************************
* DeletePrintProvidorA (WINSPOOL.@)
*/
BOOL
WINAPI
DeletePrintProvidorA(LPSTR Name, LPSTR Environment, LPSTR PrintProvidor)
{
BOOL bRet;
LPWSTR Env, Prov;
if (Name || !Environment || !PrintProvidor)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
Env = HeapAlloc(GetProcessHeap(), 0, (strlen(Environment)+1) * sizeof(WCHAR));
if (!Env)
{
return FALSE;
}
MultiByteToWideChar(CP_ACP, 0, Environment, -1, Env, strlen(Environment)+1);
Env[strlen(Environment)] = L'\0';
Prov = HeapAlloc(GetProcessHeap(), 0, (strlen(PrintProvidor)+1) * sizeof(WCHAR));
if (!Prov)
{
HeapFree(GetProcessHeap(), 0, Env);
return FALSE;
}
MultiByteToWideChar(CP_ACP, 0, PrintProvidor, -1, Prov, strlen(PrintProvidor)+1);
Prov[strlen(PrintProvidor)] = L'\0';
bRet = DeletePrintProvidorW(NULL, Env, Prov);
HeapFree(GetProcessHeap(), 0, Env);
HeapFree(GetProcessHeap(), 0, Prov);
return bRet;
}
/*
* @unimplemented
*/
BOOL
WINAPI
DeletePrintProvidorW(LPWSTR Name, LPWSTR Environment, LPWSTR PrintProvidor)
{
HKEY hKey;
BOOL bFound;
DWORD dwType, dwSize, dwOffset, dwLength;
LPWSTR pOrder, pBuffer, pNew;
if (Name || !Environment || !PrintProvidor)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Print\\Providers", 0, KEY_READ | KEY_WRITE, &hKey) != ERROR_SUCCESS)
{
return FALSE;
}
if (RegQueryValueExW(hKey, L"Order", NULL, &dwType, NULL, &dwSize) != ERROR_SUCCESS || dwType != REG_MULTI_SZ)
{
RegCloseKey(hKey);
return FALSE;
}
pOrder = HeapAlloc(GetProcessHeap(), 0, dwSize);
if (!pOrder)
{
RegCloseKey(hKey);
return FALSE;
}
if (RegQueryValueExW(hKey, L"Order", NULL, &dwType, (LPBYTE)pOrder, &dwSize) != ERROR_SUCCESS || dwType != REG_MULTI_SZ)
{
RegCloseKey(hKey);
return FALSE;
}
pBuffer = pOrder;
bFound = FALSE;
while(pBuffer[0])
{
if (!wcsicmp(pBuffer, PrintProvidor))
{
bFound = TRUE;
break;
}
pBuffer += wcslen(pBuffer) + 1;
}
if (!bFound)
{
RegCloseKey(hKey);
HeapFree(GetProcessHeap(), 0, pOrder);
return FALSE;
}
pNew = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwSize);
if (!pNew)
{
RegCloseKey(hKey);
HeapFree(GetProcessHeap(), 0, pOrder);
return FALSE;
}
dwOffset = pBuffer - pOrder;
dwLength = (dwSize / sizeof(WCHAR)) - (dwOffset + wcslen(pBuffer) + 1);
CopyMemory(pNew, pOrder, dwOffset * sizeof(WCHAR));
CopyMemory(&pNew[dwOffset], pBuffer + wcslen(pBuffer) + 1, dwLength);
RegSetValueExW(hKey, L"Order", 0, REG_MULTI_SZ, (LPBYTE)pNew, (dwOffset + dwLength) * sizeof(WCHAR));
RegDeleteKey(hKey, PrintProvidor);
HeapFree(GetProcessHeap(), 0, pOrder);
HeapFree(GetProcessHeap(), 0, pNew);
RegCloseKey(hKey);
return TRUE;
}
/*
* @unimplemented
*/
BOOL
WINAPI
AddMonitorA(LPSTR Name, DWORD Level, PBYTE Monitors)
{
LPWSTR szName = NULL;
MONITOR_INFO_2W Monitor;
MONITOR_INFO_2A *pMonitor;
BOOL bRet = FALSE;
if (Level != 2 || !Monitors)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
pMonitor = (MONITOR_INFO_2A*)Monitors;
if (pMonitor->pDLLName == NULL || pMonitor->pName == NULL)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
ZeroMemory(&Monitor, sizeof(Monitor));
if (Name)
{
szName = HeapAlloc(GetProcessHeap(), 0, (strlen(Name) + 1) * sizeof(WCHAR));
if (!szName)
{
return FALSE;
}
MultiByteToWideChar(CP_ACP, 0, Name, -1, szName, strlen(Name)+1);
szName[strlen(Name)] = L'\0';
}
Monitor.pDLLName = HeapAlloc(GetProcessHeap(), 0, (strlen(pMonitor->pDLLName)+1) * sizeof(WCHAR));
if (!Monitor.pDLLName)
{
goto cleanup;
}
MultiByteToWideChar(CP_ACP, 0, pMonitor->pDLLName, -1, Monitor.pDLLName, strlen(pMonitor->pDLLName)+1);
pMonitor->pDLLName[strlen(pMonitor->pDLLName)] = L'\0';
Monitor.pName = HeapAlloc(GetProcessHeap(), 0, (strlen(pMonitor->pName)+1) * sizeof(WCHAR));
if (!Monitor.pName)
{
goto cleanup;
}
MultiByteToWideChar(CP_ACP, 0, pMonitor->pName, -1, Monitor.pName, strlen(pMonitor->pName)+1);
pMonitor->pName[strlen(pMonitor->pName)] = L'\0';
if (pMonitor->pEnvironment)
{
Monitor.pEnvironment = HeapAlloc(GetProcessHeap(), 0, (strlen(pMonitor->pEnvironment)+1) * sizeof(WCHAR));
if (!Monitor.pEnvironment)
{
goto cleanup;
}
MultiByteToWideChar(CP_ACP, 0, pMonitor->pEnvironment, -1, Monitor.pEnvironment, strlen(pMonitor->pEnvironment)+1);
pMonitor->pEnvironment[strlen(pMonitor->pEnvironment)] = L'\0';
}
bRet = AddMonitorW(szName, Level, (LPBYTE)&Monitor);
cleanup:
if (szName)
HeapFree(GetProcessHeap(), 0, szName);
if (Monitor.pDLLName)
HeapFree(GetProcessHeap(), 0, Monitor.pDLLName);
if (Monitor.pEnvironment)
HeapFree(GetProcessHeap(), 0, Monitor.pEnvironment);
if (Monitor.pName)
HeapFree(GetProcessHeap(), 0, Monitor.pName);
return bRet;
}
/*
* @unimplemented
*/
BOOL
WINAPI
AddMonitorW(LPWSTR Name, DWORD Level, PBYTE Monitors)
{
WCHAR szPath[MAX_PATH];
HMODULE hLibrary = NULL;
FARPROC InitProc;
HKEY hKey, hSubKey;
MONITOR_INFO_2W * pMonitor;
if (Level != 2 || !Monitors)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
pMonitor = (MONITOR_INFO_2W*)Monitors;
if (pMonitor->pDLLName == NULL || pMonitor->pName == NULL)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (wcschr(pMonitor->pDLLName, L'\\'))
{
hLibrary = LoadLibraryExW(pMonitor->pDLLName, NULL, 0);
}
else if (GetSystemDirectoryW(szPath, MAX_PATH) && PathAddBackslashW(szPath))
{
wcscat(szPath, pMonitor->pDLLName);
hLibrary = LoadLibraryExW(szPath, NULL, 0);
}
if (!hLibrary)
{
return FALSE;
}
InitProc = GetProcAddress(hLibrary, "InitializePrintMonitor");
if (!InitProc)
{
InitProc = GetProcAddress(hLibrary, "InitializePrintMonitor2");
if (!InitProc)
{
FreeLibrary(hLibrary);
SetLastError(ERROR_PROC_NOT_FOUND);
return FALSE;
}
}
// FIXME
// Initialize monitor
FreeLibrary(hLibrary);
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\Print\\Monitors", 0, KEY_WRITE, &hKey) == ERROR_SUCCESS)
{
if (RegCreateKeyExW(hKey, pMonitor->pName, 0, NULL, 0, KEY_WRITE, NULL, &hSubKey, NULL) == ERROR_SUCCESS)
{
RegSetValueExW(hSubKey, L"Driver", 0, REG_SZ, (LPBYTE)pMonitor->pDLLName, (wcslen(pMonitor->pDLLName)+1)*sizeof(WCHAR));
RegCloseKey(hSubKey);
}
RegCloseKey(hKey);
}
return TRUE;
}

View file

@ -1,17 +0,0 @@
#ifndef _WINSPOOL_DRV_PCH_
#define _WINSPOOL_DRV_PCH_
#include <wine/config.h>
#include <stdarg.h>
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include <windef.h>
#include <winbase.h>
#include <wingdi.h>
#include <winspool.h>
#endif /* _WINSPOOL_DRV_PCH_ */

File diff suppressed because it is too large Load diff

View file

@ -1,5 +0,0 @@
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "Windows printer spooler"
#define REACTOS_STR_INTERNAL_NAME "winspool"
#define REACTOS_STR_ORIGINAL_FILENAME "winspool.drv"
#include <reactos/version.rc>

View file

@ -1,193 +0,0 @@
100 stub -noname EnumPrinterPropertySheets
101 stub -noname ClusterSplOpen
102 stub -noname ClusterSplClose
103 stub -noname ClusterSplIsAlive
104 stub PerfClose
105 stub PerfCollect
106 stub PerfOpen
201 stdcall GetDefaultPrinterA(ptr ptr)
202 stdcall SetDefaultPrinterA(str)
203 stdcall GetDefaultPrinterW(ptr ptr)
204 stdcall SetDefaultPrinterW(wstr)
205 stub -noname SplReadPrinter
206 stub -noname AddPerMachineConnectionA
207 stub -noname AddPerMachineConnectionW
208 stub -noname DeletePerMachineConnectionA
209 stub -noname DeletePerMachineConnectionW
210 stub -noname EnumPerMachineConnectionsA
211 stub -noname EnumPerMachineConnectionsW
212 stub -noname LoadPrinterDriver
213 stub -noname RefCntLoadDriver
214 stub -noname RefCntUnloadDriver
215 stub -noname ForceUnloadDriver
216 stub -noname PublishPrinterA
217 stub -noname PublishPrinterW
218 stub -noname CallCommonPropertySheetUI
219 stub -noname PrintUIQueueCreate
220 stub -noname PrintUIPrinterPropPages
221 stub -noname PrintUIDocumentDefaults
222 stub -noname SendRecvBidiData
223 stub -noname RouterFreeBidiResponseContainer
224 stub -noname ExternalConnectToLd64In32Server
226 stub -noname PrintUIWebPnpEntry
227 stub -noname PrintUIWebPnpPostEntry
228 stub -noname PrintUICreateInstance
229 stub -noname PrintUIDocumentPropertiesWrap
230 stub -noname PrintUIPrinterSetup
231 stub -noname PrintUIServerPropPages
232 stub -noname AddDriverCatalog
@ stub ADVANCEDSETUPDIALOG
@ stdcall AbortPrinter(long)
@ stdcall AddFormA(long long ptr)
@ stdcall AddFormW(long long ptr)
@ stdcall AddJobA(long long ptr long ptr)
@ stdcall AddJobW(long long ptr long ptr)
@ stdcall AddMonitorA(str long ptr)
@ stdcall AddMonitorW(wstr long ptr)
@ stdcall AddPortA(str ptr str)
@ stdcall AddPortExA(str long ptr str)
@ stdcall AddPortExW(wstr long ptr wstr)
@ stdcall AddPortW(wstr long wstr)
@ stdcall AddPrinterA(str long ptr)
@ stdcall AddPrinterConnectionA(str)
@ stdcall AddPrinterConnectionW(wstr)
@ stdcall AddPrinterDriverA(str long ptr)
@ stdcall AddPrinterDriverExA(str long ptr long)
@ stdcall AddPrinterDriverExW(wstr long ptr long)
@ stdcall AddPrinterDriverW(wstr long ptr)
@ stdcall AddPrinterW(wstr long ptr)
@ stdcall AddPrintProcessorA(str str str str)
@ stdcall AddPrintProcessorW(wstr wstr wstr wstr)
@ stdcall AddPrintProvidorA(str long ptr)
@ stdcall AddPrintProvidorW(wstr long ptr)
@ stdcall AdvancedDocumentPropertiesA(long long str ptr ptr)
@ stdcall AdvancedDocumentPropertiesW(long long wstr ptr ptr)
@ stub AdvancedSetupDialog
@ stdcall ClosePrinter(long)
@ stub CloseSpoolFileHandle
@ stdcall ConfigurePortA(str long str)
@ stdcall ConfigurePortW(wstr long wstr)
@ stdcall ConnectToPrinterDlg(long long)
@ stub ConvertAnsiDevModeToUnicodeDevMode
@ stub ConvertUnicodeDevModeToAnsiDevMode
@ stub CommitSpoolData
@ stub CreatePrinterIC
@ stub DEVICECAPABILITIES
@ stub DEVICEMODE
@ stdcall DeleteFormA(long str)
@ stdcall DeleteFormW(long wstr)
@ stdcall DeleteMonitorA(str str str)
@ stdcall DeleteMonitorW(wstr wstr wstr)
@ stdcall DeletePortA(str long str)
@ stdcall DeletePortW(wstr long wstr)
@ stdcall DeletePrinter(long)
@ stdcall DeletePrinterConnectionA(str)
@ stdcall DeletePrinterConnectionW(wstr)
@ stdcall DeletePrinterDataExA(long str str)
@ stdcall DeletePrinterDataExW(long wstr wstr)
@ stdcall DeletePrinterDataA(ptr str)
@ stdcall DeletePrinterDataW(ptr wstr)
@ stdcall DeletePrinterDriverA(str str str)
@ stdcall DeletePrinterDriverExA(str str str long long)
@ stdcall DeletePrinterDriverExW(wstr wstr wstr long long)
@ stdcall DeletePrinterDriverW(wstr wstr wstr)
@ stub DeletePrinterIC
@ stub DevQueryPrint
@ stdcall DeletePrintProcessorA(str str str)
@ stdcall DeletePrintProcessorW(wstr wstr wstr)
@ stdcall DeletePrintProvidorA(str str str)
@ stdcall DeletePrintProvidorW(wstr wstr wstr)
@ stdcall DeviceCapabilitiesA(str str long ptr ptr)
@ stdcall DeviceCapabilitiesW(wstr wstr long ptr ptr)
@ stub DeviceMode
@ stub DocumentEvent
@ stdcall DllMain(ptr long ptr)
@ stdcall DocumentPropertiesA(long long ptr ptr ptr long)
@ stdcall DocumentPropertiesW(long long ptr ptr ptr long)
@ stub EXTDEVICEMODE
@ stdcall EndDocPrinter(long)
@ stdcall EndPagePrinter(long)
@ stdcall EnumFormsA(long long ptr long ptr ptr)
@ stdcall EnumFormsW(long long ptr long ptr ptr)
@ stdcall EnumJobsA(long long long long ptr long ptr ptr)
@ stdcall EnumJobsW(long long long long ptr long ptr ptr)
@ stdcall EnumMonitorsA(str long ptr long long long)
@ stdcall EnumMonitorsW(wstr long ptr long long long)
@ stdcall EnumPortsA(str long ptr ptr ptr ptr)
@ stdcall EnumPortsW(wstr long ptr ptr ptr ptr)
@ stdcall EnumPrinterDataA(long long ptr long ptr ptr ptr long ptr)
@ stdcall EnumPrinterDataExA(long str ptr long ptr ptr)
@ stdcall EnumPrinterDataExW(long wstr ptr long ptr ptr)
@ stdcall EnumPrinterDataW(long long ptr long ptr ptr ptr long ptr)
@ stdcall EnumPrinterDriversA(str str long ptr long ptr ptr)
@ stdcall EnumPrinterDriversW(wstr wstr long ptr long ptr ptr)
@ stdcall EnumPrintersA(long ptr long ptr long ptr ptr)
@ stdcall EnumPrintersW(long ptr long ptr long ptr ptr)
@ stdcall EnumPrinterKeyA(long str str long ptr)
@ stdcall EnumPrinterKeyW(long wstr wstr long ptr)
@ stdcall ExtDeviceMode(long long ptr str str ptr str long)
@ stdcall EnumPrintProcessorDatatypesA(str str long ptr long ptr ptr)
@ stdcall EnumPrintProcessorDatatypesW(wstr wstr long ptr long ptr ptr)
@ stdcall EnumPrintProcessorsA(str str long ptr long ptr ptr)
@ stdcall EnumPrintProcessorsW(wstr wstr long ptr long ptr ptr)
@ stdcall FindClosePrinterChangeNotification(long)
@ stdcall FindFirstPrinterChangeNotification(long long long ptr)
@ stdcall FindNextPrinterChangeNotification(long ptr ptr ptr)
@ stdcall FreePrinterNotifyInfo(ptr)
@ stdcall GetFormA(long str long ptr long ptr)
@ stdcall GetFormW(long wstr long ptr long ptr)
@ stdcall GetJobA(long long long ptr long ptr)
@ stdcall GetJobW(long long long ptr long ptr)
@ stdcall GetPrinterA(long long ptr long ptr)
@ stdcall GetPrinterDataA(long str ptr ptr long ptr)
@ stdcall GetPrinterDataExA(long str str ptr ptr long ptr)
@ stdcall GetPrinterDataExW(long wstr wstr ptr ptr long ptr)
@ stdcall GetPrinterDataW(long wstr ptr ptr long ptr)
@ stdcall GetPrinterDriverA(long str long ptr long ptr)
@ stdcall GetPrinterDriverDirectoryA(str str long ptr long ptr)
@ stdcall GetPrinterDriverDirectoryW(wstr wstr long ptr long ptr)
@ stdcall GetPrinterDriverW(long str long ptr long ptr)
@ stdcall GetPrinterW(long long ptr long ptr)
@ stdcall GetPrintProcessorDirectoryA(str str long ptr long ptr)
@ stdcall GetPrintProcessorDirectoryW(wstr wstr long ptr long ptr)
@ stub GetSpoolFileHandle
@ stub IsValidDevmodeA
@ stub IsValidDevmodeW
@ stdcall OpenPrinterA(str ptr ptr)
@ stdcall OpenPrinterW(wstr ptr ptr)
@ stub PlayGdiScriptOnPrinterIC
@ stdcall PrinterMessageBoxA(ptr long ptr str str long)
@ stdcall PrinterMessageBoxW(ptr long ptr wstr wstr long)
@ stdcall PrinterProperties(long long)
@ stub QueryColorProfile
@ stub QuerySpoolMode
@ stub QueryRemoteFonts
@ stdcall ReadPrinter(long ptr long ptr)
@ stdcall ResetPrinterA(long ptr)
@ stdcall ResetPrinterW(long ptr)
@ stdcall ScheduleJob(long long)
@ stub SeekPrinter
@ stub SetAllocFailCount
@ stdcall SetFormA(long str long ptr)
@ stdcall SetFormW(long wstr long ptr)
@ stdcall SetJobA(long long long ptr long)
@ stdcall SetJobW(long long long ptr long)
@ stdcall SetPrinterA(long long ptr long)
@ stdcall SetPrinterDataA(long str long ptr long)
@ stdcall SetPrinterDataExA(long str str long ptr long)
@ stdcall SetPrinterDataExW(long wstr wstr long ptr long)
@ stdcall SetPrinterDataW(long wstr long ptr long)
@ stdcall SetPrinterW(long long ptr long)
@ stub SplDriverUnloadComplete
@ stub SpoolerDevQueryPrintW
@ stdcall SpoolerInit()
@ stub SpoolerPrinterEvent
@ stub StartDocDlgA
@ stub StartDocDlgW
@ stdcall StartDocPrinterA(long long ptr)
@ stdcall StartDocPrinterW(long long ptr)
@ stdcall StartPagePrinter(long)
@ stdcall WaitForPrinterChange(ptr long)
@ stdcall WritePrinter(long ptr long ptr)
@ stdcall XcvDataW(long wstr ptr long ptr long ptr ptr)

View file

@ -16,6 +16,7 @@ if(USE_DIBLIB)
endif()
add_subdirectory(gdi/gdi32)
add_subdirectory(printing)
add_subdirectory(reactx)
add_subdirectory(user/user32)
add_subdirectory(user/winsrv)

View file

@ -0,0 +1,5 @@
add_subdirectory(base)
#add_subdirectory(drivers)
add_subdirectory(monitors)
#add_subdirectory(processors)
#add_subdirectory(providers)

View file

@ -0,0 +1,4 @@
#add_subdirectory(printui)
#add_subdirectory(spoolss)
add_subdirectory(spoolsv)
#add_subdirectory(winspool)

View file

View file

View file

View file

@ -0,0 +1,2 @@
#add_subdirectory(tty)
#add_subdirectory(unidrv)

View file

View file

View file

View file

@ -0,0 +1,4 @@
add_subdirectory(localmon)
#add_subdirectory(pjlmon)
#add_subdirectory(tcpmon)
#add_subdirectory(usbmon)

View file

@ -0,0 +1 @@
add_subdirectory(ui)

View file

View file

@ -0,0 +1 @@
#add_subdirectory(ui)

View file

View file

View file

@ -0,0 +1 @@
#add_subdirectory(winprint)

View file

@ -0,0 +1,3 @@
#add_subdirectory(inetpp)
#add_subdirectory(localspl)
#add_subdirectory(win32spl)

View file

View file

View file