ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2011
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
511 discussions
Start a n
N
ew thread
[tkreuzer] 52022: [MSVCRT_APITEST] Add tests for splitpath
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Tue May 31 17:26:30 2011 New Revision: 52022 URL:
http://svn.reactos.org/svn/reactos?rev=52022&view=rev
Log: [MSVCRT_APITEST] Add tests for splitpath Added: trunk/rostests/apitests/msvcrt/ (with props) trunk/rostests/apitests/msvcrt/CMakeLists.txt (with props) trunk/rostests/apitests/msvcrt/msvcrt_apitest.rbuild (with props) trunk/rostests/apitests/msvcrt/splitpath.c (with props) trunk/rostests/apitests/msvcrt/testlist.c (with props) Propchange: trunk/rostests/apitests/msvcrt/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Tue May 31 17:26:30 2011 @@ -1,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/rostests/apitests/msvcrt/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/rostests/apitests/msvcrt/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: trunk/rostests/apitests/msvcrt/ ------------------------------------------------------------------------------ tsvn:logminsize = 10 Added: trunk/rostests/apitests/msvcrt/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/CMakeList…
============================================================================== --- trunk/rostests/apitests/msvcrt/CMakeLists.txt (added) +++ trunk/rostests/apitests/msvcrt/CMakeLists.txt [iso-8859-1] Tue May 31 17:26:30 2011 @@ -1,0 +1,12 @@ + +add_definitions(-D_DLL -D__USE_CRTIMP) + +list(APPEND SOURCE + splitpath.c + testlist.c) + +add_executable(msvcrt_apitest ${SOURCE}) +target_link_libraries(msvcrt_apitest wine) +set_module_type(msvcrt_apitest win32cui) +add_importlibs(msvcrt_apitest msvcrt kernel32) +add_cd_file(TARGET msvcrt_apitest DESTINATION reactos/bin FOR all) Propchange: trunk/rostests/apitests/msvcrt/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/apitests/msvcrt/msvcrt_apitest.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/msvcrt_ap…
============================================================================== --- trunk/rostests/apitests/msvcrt/msvcrt_apitest.rbuild (added) +++ trunk/rostests/apitests/msvcrt/msvcrt_apitest.rbuild [iso-8859-1] Tue May 31 17:26:30 2011 @@ -1,0 +1,13 @@ +<?xml version="1.0"?> +<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> +<group> +<module name="msvcrt_apitest" type="win32cui" installbase="bin" installname="msvcrt_apitest.exe"> + <include base="msvcrt_apitest">.</include> + <library>wine</library> + <library>pseh</library> + <file>testlist.c</file> + + <file>splitpath.c</file> + +</module> +</group> Propchange: trunk/rostests/apitests/msvcrt/msvcrt_apitest.rbuild ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/apitests/msvcrt/splitpath.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/splitpath…
============================================================================== --- trunk/rostests/apitests/msvcrt/splitpath.c (added) +++ trunk/rostests/apitests/msvcrt/splitpath.c [iso-8859-1] Tue May 31 17:26:30 2011 @@ -1,0 +1,94 @@ +/* + * PROJECT: ReactOS api tests + * LICENSE: GPL - See COPYING in the top level directory + * PURPOSE: Test for _splitpath + * PROGRAMMER: Timo Kreuzer + */ + +#include <wine/test.h> +#include <stdio.h> +#include <stdlib.h> +#include <strings.h> +#include <stdarg.h> + +#define ok_str(x, y) \ + ok(strcmp(x, y) == 0, "got '%s', expected '%s'\n", x, y); + +#define ok_int(x, y) \ + ok(x == y, "got %d, expected %d\n", x, y); + +START_TEST(splitpath) +{ + char drive[5]; + char dir[64]; + char fname[32]; + char ext[10]; + + _splitpath("c:\\dir1\\dir2\\file.ext", drive, dir, fname, ext); + ok_str(drive, "c:"); + ok_str(dir, "\\dir1\\dir2\\"); + ok_str(fname, "file"); + ok_str(ext, ".ext"); + + *_errno() = 0; + _splitpath("c:\\dir1\\dir2\\file.ext", 0, 0, 0, 0); + ok_int(*_errno(), 0); + + *_errno() = 0; + _splitpath(0, drive, dir, fname, ext); + ok_int(*_errno(), EINVAL); + ok_str(drive, ""); + ok_str(dir, ""); + ok_str(fname, ""); + ok_str(ext, ""); + + _splitpath("\\\\?\\c:\\dir1\\dir2\\file.ext", drive, dir, fname, ext); + ok_str(drive, "c:"); + ok_str(dir, "\\dir1\\dir2\\"); + ok_str(fname, "file"); + ok_str(ext, ".ext"); + + _splitpath("ab:\\dir1\\..\\file", drive, dir, fname, ext); + ok_str(drive, ""); + ok_str(dir, "ab:\\dir1\\..\\"); + ok_str(fname, "file"); + ok_str(ext, ""); + + _splitpath("//?/c:/dir1/dir2/file.ext", drive, dir, fname, ext); + ok_str(drive, ""); + ok_str(dir, "//?/c:/dir1/dir2/"); + ok_str(fname, "file"); + ok_str(ext, ".ext"); + + _splitpath("\\\\?\\0:/dir1\\dir2/file.", drive, dir, fname, ext); + ok_str(drive, "0:"); + ok_str(dir, "/dir1\\dir2/"); + ok_str(fname, "file"); + ok_str(ext, "."); + + _splitpath("\\\\.\\c:\\dir1\\dir2\\.ext.ext2", drive, dir, fname, ext); + ok_str(drive, ""); + ok_str(dir, "\\\\.\\c:\\dir1\\dir2\\"); + ok_str(fname, ".ext"); + ok_str(ext, ".ext2"); + + _splitpath("\\??\\c:\\dir1\\dir2\\file. ~ ", drive, dir, fname, ext); + ok_str(drive, ""); + ok_str(dir, "\\??\\c:\\dir1\\dir2\\"); + ok_str(fname, "file"); + ok_str(ext, ". ~ "); + + _splitpath("x: dir1\\/dir2 \\.blub", drive, dir, fname, ext); + ok_str(drive, "x:"); + ok_str(dir, " dir1\\/dir2 \\"); + ok_str(fname, ""); + ok_str(ext, ".blub"); + + _splitpath("/:\\dir1\\dir2\\file.ext", drive, dir, fname, ext); + ok_str(drive, "/:"); + ok_str(dir, "\\dir1\\dir2\\"); + ok_str(fname, "file"); + ok_str(ext, ".ext"); + +} + Propchange: trunk/rostests/apitests/msvcrt/splitpath.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/apitests/msvcrt/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/msvcrt/testlist.…
============================================================================== --- trunk/rostests/apitests/msvcrt/testlist.c (added) +++ trunk/rostests/apitests/msvcrt/testlist.c [iso-8859-1] Tue May 31 17:26:30 2011 @@ -1,0 +1,16 @@ +#define WIN32_LEAN_AND_MEAN +#define __ROS_LONG64__ +#include <windows.h> + +#define STANDALONE +#include "wine/test.h" + +extern void func_splitpath(void); + +const struct test winetest_testlist[] = +{ + { "splitpath", func_splitpath }, + + { 0, 0 } +}; + Propchange: trunk/rostests/apitests/msvcrt/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native
13 years, 6 months
1
0
0
0
[khornicek] 52021: [SHELL32_NEW] Fix building with CMake. Had to turn PCH off as Amine suggested, it needs more work.
by khornicek@svn.reactos.org
Author: khornicek Date: Tue May 31 16:55:10 2011 New Revision: 52021 URL:
http://svn.reactos.org/svn/reactos?rev=52021&view=rev
Log: [SHELL32_NEW] Fix building with CMake. Had to turn PCH off as Amine suggested, it needs more work. Modified: branches/shell32_new-bringup/dll/win32/shell32/CMakeLists.txt Modified: branches/shell32_new-bringup/dll/win32/shell32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/shell32_new-bringup/dll/win32/s…
============================================================================== --- branches/shell32_new-bringup/dll/win32/shell32/CMakeLists.txt [iso-8859-1] (original) +++ branches/shell32_new-bringup/dll/win32/shell32/CMakeLists.txt [iso-8859-1] Tue May 31 16:55:10 2011 @@ -1,3 +1,5 @@ +set_unicode() +set_cpp() remove_definitions(-D_WIN32_WINNT=0x502) add_definitions(-D_WIN32_WINNT=0x600) @@ -10,6 +12,7 @@ include_directories( ${REACTOS_SOURCE_DIR}/include/reactos/wine ${REACTOS_SOURCE_DIR}/lib/recyclebin + ${REACTOS_SOURCE_DIR}/lib/atl ${REACTOS_SOURCE_DIR}) generate_idl_iids(shobjidl_local.idl) @@ -17,71 +20,73 @@ spec2def(shell32.dll shell32.spec) list(APPEND SOURCE - authors.c - autocomplete.c - brsfolder.c - changenotify.c - classes.c - clipboard.c - control.c - dataobject.c - dde.c - debughlp.c - desktop.c - dialogs.c - dragdrophelper.c - enumidlist.c - extracticon.c - folders.c - iconcache.c - pidl.c - regsvr.c - shell32_main.c - shellitem.c - shelllink.c - shellole.c - shellord.c - shellpath.c - shellreg.c - shellstring.c - shfldr_desktop.c - shfldr_fs.c - shfldr_mycomp.c - shfldr_mydocuments.c - shfldr_printers.c - shfldr_admintools.c - shfldr_netplaces.c - shfldr_fonts.c - shfldr_cpanel.c - shfldr_recyclebin.c - shlexec.c - shlfileop.c - shlfolder.c - shlfsbind.c - shlmenu.c - shlview.c - shpolicy.c - shv_def_cmenu.c - startmenu.c - stubs.c - ros-systray.c - fprop.c - drive.c - she_ocmenu.c - shv_item_new.c - folder_options.c + authors.cpp + autocomplete.cpp + brsfolder.cpp + changenotify.cpp + classes.cpp + clipboard.cpp + control.cpp + dataobject.cpp + dde.cpp + debughlp.cpp + desktop.cpp + dialogs.cpp + dragdrophelper.cpp + enumidlist.cpp + extracticon.cpp + folders.cpp + iconcache.cpp + pidl.cpp + shell32_main.cpp + shellitem.cpp + shelllink.cpp + shellole.cpp + shellord.cpp + shellpath.cpp + shellreg.cpp + shellstring.cpp + shfldr_desktop.cpp + shfldr_fs.cpp + shfldr_mycomp.cpp + shfldr_mydocuments.cpp + shfldr_printers.cpp + shfldr_admintools.cpp + shfldr_netplaces.cpp + shfldr_fonts.cpp + shfldr_cpanel.cpp + shfldr_recyclebin.cpp + shlexec.cpp + shlfileop.cpp + shlfolder.cpp + shlfsbind.cpp + shlmenu.cpp + shlview.cpp + shpolicy.cpp + shv_def_cmenu.cpp + startmenu.cpp + stubs.cpp + ros-systray.cpp + fprop.cpp + drive.cpp + she_ocmenu.cpp + shv_item_new.cpp + folder_options.cpp shell32.rc ${CMAKE_CURRENT_BINARY_DIR}/shobjidl_local_i.c ${CMAKE_CURRENT_BINARY_DIR}/shell32_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/shell32.def) -add_pch(shell32 ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) +# FIXME +#add_pch(shell32 ${CMAKE_CURRENT_SOURCE_DIR}/precomp.h ${SOURCE}) +#add_library(shell32 SHARED ${CMAKE_CURRENT_BINARY_DIR}/shell32_precomp.h.gch ${SOURCE}) -add_library(shell32 SHARED ${CMAKE_CURRENT_BINARY_DIR}/shell32_precomp.h.gch ${SOURCE}) +add_library(shell32 SHARED ${SOURCE}) set_module_type(shell32 win32dll) target_link_libraries(shell32 + atlnew wine uuid recyclebin)
13 years, 6 months
1
0
0
0
[nyadav] 52020: [AUDSRV] Use Double Buffering to Improve latency
by nyadav@svn.reactos.org
Author: nyadav Date: Tue May 31 16:30:46 2011 New Revision: 52020 URL:
http://svn.reactos.org/svn/reactos?rev=52020&view=rev
Log: [AUDSRV] Use Double Buffering to Improve latency Added: branches/nyadav-audio-branch/base/services/audsrv/stream.c (with props) Modified: branches/nyadav-audio-branch/base/services/audsrv/CMakeLists.txt branches/nyadav-audio-branch/base/services/audsrv/audsrv.c branches/nyadav-audio-branch/base/services/audsrv/audsrv.h branches/nyadav-audio-branch/base/services/audsrv/rpc.c branches/nyadav-audio-branch/dll/win32/audsrvapi/audsrvapi.c branches/nyadav-audio-branch/dll/win32/audsrvapi/dllmain.c branches/nyadav-audio-branch/include/reactos/idl/audsrvrpc.idl branches/nyadav-audio-branch/include/reactos/libs/audsrv/audsrvapi.h Modified: branches/nyadav-audio-branch/base/services/audsrv/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/branches/nyadav-audio-branch/base/servic…
============================================================================== --- branches/nyadav-audio-branch/base/services/audsrv/CMakeLists.txt [iso-8859-1] (original) +++ branches/nyadav-audio-branch/base/services/audsrv/CMakeLists.txt [iso-8859-1] Tue May 31 16:30:46 2011 @@ -6,7 +6,8 @@ list(APPEND SOURCE audsrv.c audsrv.rc - rpc.c) + rpc.c + stream.c) add_executable(audsrv ${SOURCE}) Modified: branches/nyadav-audio-branch/base/services/audsrv/audsrv.c URL:
http://svn.reactos.org/svn/reactos/branches/nyadav-audio-branch/base/servic…
============================================================================== --- branches/nyadav-audio-branch/base/services/audsrv/audsrv.c [iso-8859-1] (original) +++ branches/nyadav-audio-branch/base/services/audsrv/audsrv.c [iso-8859-1] Tue May 31 16:30:46 2011 @@ -153,27 +153,24 @@ -void fill(MixerEngine * mixer) +void fill(MixerEngine * mixer,int buffer) { DWORD Length; UINT i = 0; - mixer->mastervolume = 1000; - mixer->masterchannels=2; - mixer->masterfreq=48000; - mixer->masterbitspersample=16; - mixer->masterchannelmask = KSAUDIO_SPEAKER_STEREO; +Sleep(100); Length = mixer->masterfreq * mixer->masterchannels * mixer->masterbitspersample / 8; - mixer->masterbuf = (PSHORT)HeapAlloc(GetProcessHeap(), 0, Length); + mixer->masterbuf[buffer] = (PSHORT)HeapAlloc(GetProcessHeap(), 0, Length); while (i < Length / 2) { - mixer->masterbuf[i] = 0x7FFF * sin(0.5 * (i - 1) * 500 * _2pi / 48000); + mixer->masterbuf[buffer][i] = 0x7FFF * sin(0.5 * (i - 1) * 500 * _2pi / 48000); i++; - mixer->masterbuf[i] = 0x7FFF * sin(0.5 * (i - 2) * 500 * _2pi / 48000); + mixer->masterbuf[buffer][i] = 0x7FFF * sin(0.5 * (i - 2) * 500 * _2pi / 48000); i++; } -} - -void initdevice(MixerEngine * mixer) + mixer->bytes_to_play = Length; +} + +void playbuffer(MixerEngine * mixer,int buffer) { SP_DEVICE_INTERFACE_DATA InterfaceData; SP_DEVINFO_DATA DeviceData; @@ -186,7 +183,8 @@ DWORD Length; BOOL Result; NTSTATUS Status; - +if(mixer->masterbuf[buffer]) +{ // // Get a handle to KS Audio Interfaces // @@ -195,7 +193,7 @@ NULL, DIGCF_DEVICEINTERFACE |DIGCF_PRESENT); - printf("DeviceHandle %p\n", DeviceHandle); + //printf("DeviceHandle %p\n", DeviceHandle); // // Enumerate the first interface @@ -208,7 +206,7 @@ 1, &InterfaceData); - printf("SetupDiEnumDeviceInterfaces %u Error %ld\n", Result, GetLastError()); + //printf("SetupDiEnumDeviceInterfaces %u Error %ld\n", Result, GetLastError()); // // Get the interface details (namely the device path) @@ -227,7 +225,7 @@ NULL, &DeviceData); - wprintf(L"SetupDiGetDeviceInterfaceDetail %u Path DetailData %s\n", Result, (LPWSTR)&DetailData->DevicePath[0]); + //wprintf(L"SetupDiGetDeviceInterfaceDetail %u Path DetailData %s\n", Result, (LPWSTR)&DetailData->DevicePath[0]); // // Open a handle to the device @@ -240,7 +238,7 @@ FILE_ATTRIBUTE_NORMAL, NULL); - printf("Handle %p\n", mixer->FilterHandle); + //printf("Handle %p\n", mixer->FilterHandle); // // Close the interface handle and clean up @@ -273,7 +271,7 @@ // // Setup the KS Data Format Information // - printf("DataFormat %p %p\n", DataFormat,(PVOID)((((ULONG_PTR)DataFormat + 7)) & ~7)); + //printf("DataFormat %p %p\n", DataFormat,(PVOID)((((ULONG_PTR)DataFormat + 7)) & ~7)); DataFormat->Flags = 0; DataFormat->Reserved = 0; @@ -294,14 +292,14 @@ WaveFormat->Samples.wValidBitsPerSample = mixer->masterbitspersample; WaveFormat->SubFormat = KSDATAFORMAT_SUBTYPE_PCM; - printf("Creating pin\n"); + //printf("Creating pin\n"); // // Create the pin // Status = KsCreatePin(mixer->FilterHandle, PinConnect, GENERIC_READ|GENERIC_WRITE, &(mixer->PinHandle)); - printf("PinHandle %p Status %lx\n", mixer->PinHandle, Status); + //printf("PinHandle %p Status %lx\n", mixer->PinHandle, Status); Length = mixer->masterfreq * mixer->masterchannels * mixer->masterbitspersample / 8; @@ -311,9 +309,9 @@ mixer->Packet = (PKSSTREAM_HEADER)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(KSSTREAM_HEADER)); - mixer->Packet->Data = mixer->masterbuf; - mixer->Packet->FrameExtent = Length; - mixer->Packet->DataUsed = Length; + mixer->Packet->Data = mixer->masterbuf[buffer]; + mixer->Packet->FrameExtent = mixer->bytes_to_play; + mixer->Packet->DataUsed = mixer->bytes_to_play; mixer->Packet->Size = sizeof(KSSTREAM_HEADER); mixer->Packet->PresentationTime.Numerator = 1; mixer->Packet->PresentationTime.Denominator = 1; @@ -338,13 +336,6 @@ sizeof(State), &Length, NULL); -} -void playbuffer(MixerEngine * mixer) -{ - DWORD Length = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) + MAX_PATH * sizeof(WCHAR); - // - // Play our 1-second buffer - // DeviceIoControl(mixer->PinHandle, IOCTL_KS_WRITE_STREAM, @@ -355,14 +346,6 @@ &Length, NULL); -} -void closedevice(MixerEngine * mixer) -{ - KSSTATE State; - DWORD Length = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA) + MAX_PATH * sizeof(WCHAR); - // - // Change the state to stop - // State = KSSTATE_STOP; DeviceIoControl(mixer->PinHandle, IOCTL_KS_PROPERTY, @@ -375,17 +358,21 @@ CloseHandle(mixer->PinHandle); CloseHandle(mixer->FilterHandle); - +} } DWORD WINAPI RunMixerThread(LPVOID param) { MixerEngine * mixer = (MixerEngine *) param; - SetEvent(mixer->EventPool[0]); + + SetEvent(mixer->played); while(1) { - while(WaitForSingleObject(mixer->EventPool[0],100)!=0){if(mixer->dead)goto DEAD;} - fill(mixer); - SetEvent(mixer->EventPool[1]); + while(WaitForSingleObject(mixer->streampresent,100)!=0){if(mixer->dead)goto DEAD;} /*Check if there is at least one stream present.*/ + + while(WaitForSingleObject(mixer->played,100)!=0){if(mixer->dead)goto DEAD;} + fill(mixer,1-mixer->playcurrent); + SetEvent(mixer->filled); + } DEAD: printf("\nMixer Thread Ended\n"); @@ -396,11 +383,11 @@ MixerEngine * mixer = (MixerEngine *) param; while(1) { - while(WaitForSingleObject(mixer->EventPool[1],100)!=0){if(mixer->dead)goto DEAD;} - initdevice(mixer); - playbuffer(mixer); - closedevice(mixer); - SetEvent(mixer->EventPool[0]); + while(WaitForSingleObject(mixer->filled,100)!=0){if(mixer->dead)goto DEAD;} + SetEvent(mixer->played); + playbuffer(mixer,mixer->playcurrent); + + mixer->playcurrent=1-mixer->playcurrent; } DEAD: @@ -481,8 +468,12 @@ pengine->mute=FALSE; pengine->dead=0; - pengine->EventPool[0]=CreateEvent(NULL,FALSE,FALSE,NULL); - pengine->EventPool[1]=CreateEvent(NULL,FALSE,FALSE,NULL); + pengine->playcurrent=1; + pengine->masterbuf[0] = NULL; + pengine->masterbuf[1] = NULL; + pengine->played=CreateEvent(NULL,FALSE,FALSE,NULL); + pengine->filled=CreateEvent(NULL,FALSE,FALSE,NULL); + pengine->streampresent=CreateEvent(NULL,TRUE,FALSE,NULL); SetConsoleCtrlHandler(close,TRUE); SpawnMixerThread(pengine); SpawnPlayerThread(pengine); @@ -510,8 +501,12 @@ pengine->mute=FALSE; pengine->dead=0; - pengine->EventPool[0]=CreateEvent(NULL,FALSE,FALSE,NULL); - pengine->EventPool[1]=CreateEvent(NULL,FALSE,FALSE,NULL); + pengine->playcurrent=1; + pengine->masterbuf[0] = NULL; + pengine->masterbuf[1] = NULL; + pengine->played=CreateEvent(NULL,FALSE,FALSE,NULL); + pengine->filled=CreateEvent(NULL,FALSE,FALSE,NULL); + pengine->streampresent=CreateEvent(NULL,TRUE,FALSE,NULL); SetConsoleCtrlHandler(close,TRUE); SpawnMixerThread(pengine); SpawnPlayerThread(pengine); Modified: branches/nyadav-audio-branch/base/services/audsrv/audsrv.h URL:
http://svn.reactos.org/svn/reactos/branches/nyadav-audio-branch/base/servic…
============================================================================== --- branches/nyadav-audio-branch/base/services/audsrv/audsrv.h [iso-8859-1] (original) +++ branches/nyadav-audio-branch/base/services/audsrv/audsrv.h [iso-8859-1] Tue May 31 16:30:46 2011 @@ -34,6 +34,8 @@ int bitspersample; int channels; ULONG channelmask; + HANDLE played; + HANDLE streamready; HANDLE thread; float balance; struct ServerStream * next; @@ -43,10 +45,13 @@ { /*Should be Initialized at Server Start*/ char dead; - HANDLE EventPool[2];//0=Played,1=Ready + HANDLE played; + HANDLE filled; + HANDLE streampresent; HANDLE mixerthread; HANDLE playerthread; HANDLE rpcthread; + int playcurrent; /*Should be Initialized at Server Start from configuration file,Currently there is no configuration file so initialized to a fixed value at start*/ int mastervolume; BOOL mute; @@ -55,8 +60,9 @@ int masterchannels; unsigned long masterchannelmask; int masterbitspersample; - PSHORT masterbuf; + PSHORT masterbuf[2]; /*Currently don't know the future of following variables*/ + long bytes_to_play; HANDLE FilterHandle; HANDLE PinHandle; PKSPROPERTY Property; @@ -64,10 +70,15 @@ ServerStream * serverstreamlist; } MixerEngine; -extern MixerEngine engine; +extern MixerEngine engine,*pengine; /* rpc.c */ DWORD WINAPI RunRPCThread(LPVOID lpParameter); +/* audsrv.c*/ +void fill(MixerEngine * mixer,int buffer); +void playbuffer(MixerEngine * mixer,int buffer); +/*stream.c*/ +HANDLE addstream(LONG frequency,int channels,int bitspersample, ULONG channelmask,int volume,int mute,float balance); /********************************/ #endif /* __AUDSRV_H__ */ Modified: branches/nyadav-audio-branch/base/services/audsrv/rpc.c URL:
http://svn.reactos.org/svn/reactos/branches/nyadav-audio-branch/base/servic…
============================================================================== --- branches/nyadav-audio-branch/base/services/audsrv/rpc.c [iso-8859-1] (original) +++ branches/nyadav-audio-branch/base/services/audsrv/rpc.c [iso-8859-1] Tue May 31 16:30:46 2011 @@ -45,11 +45,13 @@ /*************************RPC Functions**********************************/ -NTSTATUS AUDInitStream( IN RPC_BINDING_HANDLE hBinding) +int AUDInitStream( IN RPC_BINDING_HANDLE hBinding,LONG frequency,int channels,int bitspersample, ULONG channelmask,int volume,int mute,float balance) { - UNIMPLEMENTED;/*Coolest Macro I have ever seen*/ - printf("Client Connected and called server's procedure\n"); - return STATUS_NOT_IMPLEMENTED; + HANDLE stream; + printf("Client Connected and Initiated Stream Freq: %ld,Channle: %d,Bitspersample: %d,Mask: %ld,Volume: %d,Mute: %d,Balance: %f\n",frequency,channels,bitspersample,channelmask,volume,mute,balance); + stream = addstream(frequency,channels,bitspersample,channelmask,volume,mute,balance); + if( stream == NULL ){return 0;}else{printf("Stream added\n");} + return (int)stream; } /*************************************************************************/ void __RPC_FAR *__RPC_USER midl_user_allocate(SIZE_T len) Added: branches/nyadav-audio-branch/base/services/audsrv/stream.c URL:
http://svn.reactos.org/svn/reactos/branches/nyadav-audio-branch/base/servic…
============================================================================== --- branches/nyadav-audio-branch/base/services/audsrv/stream.c (added) +++ branches/nyadav-audio-branch/base/services/audsrv/stream.c [iso-8859-1] Tue May 31 16:30:46 2011 @@ -1,0 +1,59 @@ +#include "audsrv.h" + +DWORD WINAPI RunStreamThread(LPVOID param) +{ + ServerStream * localstream = (ServerStream *) param; + + SetEvent(localstream->streamready); + printf("Signaling Mixer Thread For First Stream\n"); + SetEvent(pengine->streampresent); + while (1){OutputDebugStringA("Stream Thread Running.");Sleep(100);}; + /*Clean Stream's data*/ +} + +HANDLE addstream(LONG frequency,int channels,int bitspersample, ULONG channelmask,int volume,int mute,float balance) +{ + ServerStream * newstream,*localstream; + DWORD dwID; + + /*Add Data to Linked list*/ + localstream = pengine->serverstreamlist; + newstream = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ServerStream)); + if(newstream == NULL) {goto error;} + if(volume < 0) {newstream->volume = 0;}else if (volume > 1000) {newstream->volume = 1000;}else {newstream->volume = volume;} + if(volume < -1.0) {newstream->volume = -1.0;}else if (volume > 1.0) {newstream->volume = 1.0;}else {newstream->volume = volume;} + newstream->freq = frequency; /*TODO frequency validation required*/ + newstream->bitspersample = bitspersample; /*TODO bitspersample validation*/ + newstream->channels = channels; /*TODO validation*/ + newstream->channelmask = channelmask; /*TODO validation*/ + + newstream->next = NULL; + newstream->played = CreateEvent(NULL,FALSE,FALSE,NULL); + newstream->streamready = CreateEvent(NULL,FALSE,FALSE,NULL); + + if(newstream->played == NULL || newstream->streamready == NULL) {goto error;} + newstream->thread=CreateThread(NULL,0,RunStreamThread,newstream,0,&dwID); + if(newstream->thread == NULL) {goto error;} + + WaitForSingleObject(newstream->streamready,INFINITE); + + if(localstream == NULL) + { + pengine->serverstreamlist = localstream; + + pengine->masterfreq=frequency; + pengine->masterchannels=channels; + pengine->masterchannelmask=channelmask; + pengine->masterbitspersample=bitspersample; + } + else + { + while(localstream->next != NULL){localstream = localstream->next;} + localstream->next = newstream; + } + return newstream->thread; + +error: + HeapFree(GetProcessHeap(), 0, newstream); + return NULL; +} Propchange: branches/nyadav-audio-branch/base/services/audsrv/stream.c ------------------------------------------------------------------------------ eol-style = native Propchange: branches/nyadav-audio-branch/base/services/audsrv/stream.c ------------------------------------------------------------------------------ mime-type = text/plain Propchange: branches/nyadav-audio-branch/base/services/audsrv/stream.c ------------------------------------------------------------------------------ svn:eol-style = native Propchange: branches/nyadav-audio-branch/base/services/audsrv/stream.c ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: branches/nyadav-audio-branch/dll/win32/audsrvapi/audsrvapi.c URL:
http://svn.reactos.org/svn/reactos/branches/nyadav-audio-branch/dll/win32/a…
============================================================================== --- branches/nyadav-audio-branch/dll/win32/audsrvapi/audsrvapi.c [iso-8859-1] (original) +++ branches/nyadav-audio-branch/dll/win32/audsrvapi/audsrvapi.c [iso-8859-1] Tue May 31 16:30:46 2011 @@ -7,38 +7,25 @@ */ WINAPI int initstream (ClientStream * clientstream,LONG frequency,int channels,int bitspersample, ULONG channelmask,int volume,int mute,float balance) { - RPC_STATUS status; - unsigned short * pszStringBinding = NULL; - - - if(clientstream == NULL ) return -1; + int streamid; + if (clientstream == NULL ) return -1; if (clientstream->callbacks.OpenComplete == NULL || clientstream->callbacks.BufferCopied == NULL || clientstream->callbacks.PlayComplete == NULL) return -2; /*Validity of all other data will be checked at server*/ /*Check Connection Status If not connected call Connect()*/ /*If connected Properly call the remote audsrv_initstream() function*/ - status = RpcStringBindingComposeW(NULL,L"ncacn_np",NULL,L"\\pipe\\audsrv", NULL,&pszStringBinding); - - status = RpcBindingFromStringBindingW(pszStringBinding, &audsrv_v0_0_c_ifspec); - - if (status) printf("Connection Problem p %d \n",status); - - status = RpcStringFree(&pszStringBinding); - - if (status) printf("Problem Freeing String : %d \n",status); - RpcTryExcept { - AUDInitStream (audsrv_v0_0_c_ifspec); + streamid = AUDInitStream (audsrv_v0_0_c_ifspec,frequency,channels,bitspersample,channelmask,volume,mute,balance); + printf("AUDInitStream Returned %d",streamid); } - RpcExcept(1) + RpcExcept(1) { status = RpcExceptionCode(); printf("Runtime reported exception 0x%lx = %ld\n", status, status); } RpcEndExcept - status = RpcBindingFree(&audsrv_v0_0_c_ifspec); - if (status == RPC_S_INVALID_BINDING) printf("Error : %d Invalid RPC S HANDLE\n",status); + /*Analyse the return by the function*/ /*Currently Suppose the return is 0 and a valid streamid is returned*/ clientstream->stream = &status; Modified: branches/nyadav-audio-branch/dll/win32/audsrvapi/dllmain.c URL:
http://svn.reactos.org/svn/reactos/branches/nyadav-audio-branch/dll/win32/a…
============================================================================== --- branches/nyadav-audio-branch/dll/win32/audsrvapi/dllmain.c [iso-8859-1] (original) +++ branches/nyadav-audio-branch/dll/win32/audsrvapi/dllmain.c [iso-8859-1] Tue May 31 16:30:46 2011 @@ -7,13 +7,27 @@ LPVOID lpReserved ) { - + RPC_STATUS status; + unsigned short * pszStringBinding = NULL; + switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: + status = RpcStringBindingComposeW(NULL,L"ncacn_np",NULL,L"\\pipe\\audsrv", NULL,&pszStringBinding); + + status = RpcBindingFromStringBindingW(pszStringBinding, &audsrv_v0_0_c_ifspec); + + if (status) printf("Connection Problem p %d \n",status); + + status = RpcStringFree(&pszStringBinding); + + if (status) printf("Problem Freeing String : %d \n",status); + break; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: + status = RpcBindingFree(audsrv_v0_0_c_ifspec); + if (status == RPC_S_INVALID_BINDING) printf("Error : %d Invalid RPC S HANDLE\n",status); break; } return TRUE; Modified: branches/nyadav-audio-branch/include/reactos/idl/audsrvrpc.idl URL:
http://svn.reactos.org/svn/reactos/branches/nyadav-audio-branch/include/rea…
============================================================================== --- branches/nyadav-audio-branch/include/reactos/idl/audsrvrpc.idl [iso-8859-1] (original) +++ branches/nyadav-audio-branch/include/reactos/idl/audsrvrpc.idl [iso-8859-1] Tue May 31 16:30:46 2011 @@ -3,6 +3,7 @@ */ #include <ms-dtyp.idl> + cpp_quote("#if !defined(__AUDSRV_H__) ") typedef long NTSTATUS; @@ -19,6 +20,7 @@ typedef AUDSRV_HANDLE *PAUDSRV_HANDLE; typedef [handle, unique] LPWSTR AUDSRV_HANDLE_W; typedef [handle, unique] LPSTR AUDSRV_HANDLE_A; + typedef struct _RPC_CLIENT_ID { DWORD UniqueProcess; @@ -37,6 +39,6 @@ interface audsrv { - NTSTATUS AUDInitStream([in] handle_t h1); + int AUDInitStream([in] handle_t h1,[in]LONG frequency,[in]int channels,[in]int bitspersample,[in] ULONG channelmask,[in]int volume,[in]int mute,[in]float balance); } Modified: branches/nyadav-audio-branch/include/reactos/libs/audsrv/audsrvapi.h URL:
http://svn.reactos.org/svn/reactos/branches/nyadav-audio-branch/include/rea…
============================================================================== --- branches/nyadav-audio-branch/include/reactos/libs/audsrv/audsrvapi.h [iso-8859-1] (original) +++ branches/nyadav-audio-branch/include/reactos/libs/audsrv/audsrvapi.h [iso-8859-1] Tue May 31 16:30:46 2011 @@ -7,6 +7,7 @@ #include <stdio.h> /********************Structures*********************/ + typedef struct CallBacks { void (*OpenComplete) (int error ); @@ -18,7 +19,7 @@ { HANDLE stream; int dead; -HANDLE ClientEventPool[1]; /*[0]th event is for Activescheduler*/ +HANDLE ClientEventPool[1]; //0]th event is for Activescheduler struct CallBacks callbacks; } ClientStream;
13 years, 6 months
1
0
0
0
[cgutman] 52019: [NTOSKRNL] - Implement IoTranslateBusAddress
by cgutman@svn.reactos.org
Author: cgutman Date: Mon May 30 22:27:28 2011 New Revision: 52019 URL:
http://svn.reactos.org/svn/reactos?rev=52019&view=rev
Log: [NTOSKRNL] - Implement IoTranslateBusAddress Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Mon May 30 22:27:28 2011 @@ -4119,7 +4119,7 @@ } /* - * @unimplemented + * @implemented */ BOOLEAN NTAPI @@ -4129,6 +4129,11 @@ IN OUT PULONG AddressSpace, OUT PPHYSICAL_ADDRESS TranslatedAddress) { - UNIMPLEMENTED; - return FALSE; -} + /* FIXME: Notify the resource arbiter */ + + return HalTranslateBusAddress(InterfaceType, + BusNumber, + BusAddress, + AddressSpace, + TranslatedAddress); +}
13 years, 6 months
1
0
0
0
[tkreuzer] 52018: [WIN32K] - Refactor NtGdiGetTextMetricsW - Implement NtGdiGetETM - Halfplement RFONT_vGetTextMetrics - Hackplement RFONT_vGetETM
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon May 30 22:18:44 2011 New Revision: 52018 URL:
http://svn.reactos.org/svn/reactos?rev=52018&view=rev
Log: [WIN32K] - Refactor NtGdiGetTextMetricsW - Implement NtGdiGetETM - Halfplement RFONT_vGetTextMetrics - Hackplement RFONT_vGetETM Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/textmetric.c branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/textmetric.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/textmetric.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/font/textmetric.c [iso-8859-1] Mon May 30 22:18:44 2011 @@ -11,6 +11,81 @@ #define NDEBUG #include <debug.h> + + +VOID +NTAPI +RFONT_vGetTextMetrics( + PRFONT prfnt, + TMW_INTERNAL *ptmwi) +{ + PIFIMETRICS pifi = prfnt->ppfe->pifi; + + ptmwi->tmw.tmAscent = (prfnt->fddm.fxMaxAscender + 8) / 16; + ptmwi->tmw.tmDescent = (prfnt->fddm.fxMaxDescender + 8) / 16; + ptmwi->tmw.tmHeight = ptmwi->tmw.tmAscent + ptmwi->tmw.tmDescent; + ptmwi->tmw.tmInternalLeading = 0; // FIXME + ptmwi->tmw.tmExternalLeading = 0; // FIXME + ptmwi->tmw.tmAveCharWidth = 0; // FIXME + ptmwi->tmw.tmMaxCharWidth = prfnt->fddm.cxMax; + ptmwi->tmw.tmWeight = pifi->usWinWeight; + ptmwi->tmw.tmOverhang = 0; // FIXME + ptmwi->tmw.tmDigitizedAspectX = pifi->ptlAspect.x; + ptmwi->tmw.tmDigitizedAspectY = pifi->ptlAspect.y; + ptmwi->tmw.tmFirstChar = pifi->wcFirstChar; + ptmwi->tmw.tmLastChar = pifi->wcLastChar; + ptmwi->tmw.tmDefaultChar = pifi->wcDefaultChar; + ptmwi->tmw.tmBreakChar = pifi->wcBreakChar; + ptmwi->tmw.tmItalic = ((pifi->fsSelection & FM_SEL_ITALIC) != 0); + ptmwi->tmw.tmUnderlined = ((pifi->fsSelection & FM_SEL_UNDERSCORE) != 0); + ptmwi->tmw.tmStruckOut = ((pifi->fsSelection & FM_SEL_STRIKEOUT) != 0); + ptmwi->tmw.tmPitchAndFamily = pifi->jWinPitchAndFamily; + ptmwi->tmw.tmCharSet = pifi->jWinCharSet; + ptmwi->tmdiff.chFirst = pifi->chFirstChar; + ptmwi->tmdiff.chLast = pifi->chLastChar; + ptmwi->tmdiff.chDefault = pifi->chDefaultChar; + ptmwi->tmdiff.chBreak = pifi->chBreakChar; + ptmwi->tmdiff.cjotma = 0; // FIXME +} + +VOID +NTAPI +RFONT_vGetETM( + PRFONT prfnt, + EXTTEXTMETRIC *petm) +{ + PIFIMETRICS pifi = prfnt->ppfe->pifi; + + petm->emSize = sizeof(EXTTEXTMETRIC); + petm->emPointSize = 0; // FIXME + petm->emOrientation = 0; // FIXME + petm->emMasterHeight = 0; // FIXME + petm->emMinScale = 0; // FIXME + petm->emMaxScale = 0; // FIXME + petm->emMasterUnits = 0; // FIXME + petm->emCapHeight = 0; // FIXME + petm->emXHeight = 0; // FIXME + petm->emLowerCaseAscent = 0; // FIXME + petm->emLowerCaseDescent = 0; // FIXME + petm->emSlant = 0; // FIXME + petm->emSuperScript = 0; // FIXME + petm->emSubScript = 0; // FIXME + petm->emSuperScriptSize = 0; // FIXME + petm->emSubScriptSize = 0; // FIXME + petm->emUnderlineOffset = 0; // FIXME + petm->emUnderlineWidth = 0; // FIXME + petm->emDoubleUpperUnderlineOffset = 0; // FIXME + petm->emDoubleLowerUnderlineOffset = 0; // FIXME + petm->emDoubleUpperUnderlineWidth = 0; // FIXME + petm->emDoubleLowerUnderlineWidth = 0; // FIXME + petm->emStrikeOutOffset = 0; // FIXME + petm->emStrikeOutWidth = 0; // FIXME + petm->emKernPairs = pifi->cKerningPairs; + petm->emKernTracks = 0; // FIXME + +} + + W32KAPI BOOL APIENTRY @@ -21,7 +96,6 @@ { PDC pdc; PRFONT prfnt; - PIFIMETRICS pifi; BOOL bResult = TRUE; /* verify that the buffer is large enough */ @@ -36,19 +110,13 @@ /* Get pointer to RFONT and IFI */ prfnt = DC_prfnt(pdc); - pifi = prfnt->ppfe->pifi; /* Enter SEH for buffer copy */ _SEH2_TRY { /* Probe and fill TMW_INTERNAL */ ProbeForWrite(ptmwi, cj, 1); - RtlCopyMemory(&ptmwi->TextMetric, prfnt->ptmw, sizeof(TEXTMETRICW)); - ptmwi->Diff.cjotma = 0; // FIXME: what is this? - ptmwi->Diff.chFirst = pifi->chFirstChar; - ptmwi->Diff.chLast = pifi->chLastChar; - ptmwi->Diff.ChDefault = pifi->chDefaultChar; - ptmwi->Diff.ChBreak = pifi->chBreakChar; + RFONT_vGetTextMetrics(prfnt, ptmwi); } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { @@ -69,8 +137,37 @@ IN HDC hdc, OUT EXTTEXTMETRIC *petm) { - ASSERT(FALSE); - return FALSE; + PDC pdc; + PRFONT prfnt; + BOOL bResult = TRUE; + + /* Lock the DC */ + pdc = DC_LockDc(hdc); + if (!pdc) + { + return FALSE; + } + + /* Get pointer to RFONT */ + prfnt = DC_prfnt(pdc); + + /* Enter SEH for buffer copy */ + _SEH2_TRY + { + /* Probe and fill TMW_INTERNAL */ + ProbeForWrite(petm, sizeof(EXTTEXTMETRIC), 1); + RFONT_vGetETM(prfnt, petm); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + SetLastNtError(_SEH2_GetExceptionCode()); + bResult = FALSE; + } + _SEH2_END + + /* Unlock the DC and return */ + DC_UnlockDc(pdc); + return bResult; } W32KAPI Modified: branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/subsyst…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/subsystems/win32/win32k/include/font.h [iso-8859-1] Mon May 30 22:18:44 2011 @@ -107,7 +107,7 @@ DHPDEV dhpdev; PFE * ppfe; - PFF * pPFF; + PFF * ppff; RFONTLINK rflPDEV; RFONTLINK rflPFF; PRFONT prfntSystemTT; @@ -121,7 +121,7 @@ FLONG flEUDCState; ULONG ulContent; ULONG ulTimeStamp; - ULONG uiNumLinks; + ULONG ulNumLinks; ULONG iGraphicsMode; ULONG ulOrientation; ULONG cBitsPerPel;
13 years, 6 months
1
0
0
0
[tkreuzer] 52017: fix field names of TMW_INTERNAL and TMDIFF
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Mon May 30 22:15:04 2011 New Revision: 52017 URL:
http://svn.reactos.org/svn/reactos?rev=52017&view=rev
Log: fix field names of TMW_INTERNAL and TMDIFF Modified: branches/GSoC_2011/GdiFontDriver/dll/win32/gdi32/objects/text.c branches/GSoC_2011/GdiFontDriver/include/reactos/win32k/ntgdityp.h Modified: branches/GSoC_2011/GdiFontDriver/dll/win32/gdi32/objects/text.c URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/dll/win…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/dll/win32/gdi32/objects/text.c [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/dll/win32/gdi32/objects/text.c [iso-8859-1] Mon May 30 22:15:04 2011 @@ -110,7 +110,7 @@ return FALSE; } - FONT_TextMetricWToA(&tmwi.TextMetric, lptm); + FONT_TextMetricWToA(&tmwi.tmw, lptm); return TRUE; } @@ -132,7 +132,7 @@ return FALSE; } - *lptm = tmwi.TextMetric; + *lptm = tmwi.tmw; return TRUE; } Modified: branches/GSoC_2011/GdiFontDriver/include/reactos/win32k/ntgdityp.h URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2011/GdiFontDriver/include…
============================================================================== --- branches/GSoC_2011/GdiFontDriver/include/reactos/win32k/ntgdityp.h [iso-8859-1] (original) +++ branches/GSoC_2011/GdiFontDriver/include/reactos/win32k/ntgdityp.h [iso-8859-1] Mon May 30 22:15:04 2011 @@ -332,14 +332,14 @@ ULONG cjotma; CHAR chFirst; CHAR chLast; - CHAR ChDefault; - CHAR ChBreak; + CHAR chDefault; + CHAR chBreak; } TMDIFF, *PTMDIFF; typedef struct _TMW_INTERNAL { - TEXTMETRICW TextMetric; - TMDIFF Diff; + TEXTMETRICW tmw; + TMDIFF tmdiff; } TMW_INTERNAL, *PTMW_INTERNAL; typedef struct _NTMW_INTERNAL @@ -548,7 +548,7 @@ // typedef struct _DRIVER_FUNCTIONS { - PFN_DrvEnablePDEV EnablePDEV; + PFN_DrvEnablePDEV EnablePDEV; PFN_DrvCompletePDEV CompletePDEV; PFN_DrvDisablePDEV DisablePDEV; PFN_DrvEnableSurface EnableSurface; @@ -584,10 +584,10 @@ PFN_DrvStartPage StartPage; PFN_DrvEndDoc EndDoc; PFN_DrvStartDoc StartDoc; - PVOID Unknown3; + PVOID Unknown3; PFN_DrvGetGlyphMode GetGlyphMode; PFN_DrvSynchronize Synchronize; - PVOID Unknown4; + PVOID Unknown4; PFN_DrvSaveScreenBits SaveScreenBits; PFN_DrvGetModes GetModes; PFN_DrvFree Free; @@ -641,7 +641,7 @@ PVOID Reserved9; PVOID Reserved10; PVOID Reserved11; /* 92 */ - + /* ReactOS specify */ PFN_DrvEnableDriver EnableDriver; //ReactOS Extra } DRIVER_FUNCTIONS, *PDRIVER_FUNCTIONS;
13 years, 6 months
1
0
0
0
[rharabien] 52016: [USER32] - Use DISPLAY_DEVICEW instead of assuming DISPLAY_DEVICE is in unicode
by rharabien@svn.reactos.org
Author: rharabien Date: Mon May 30 21:34:10 2011 New Revision: 52016 URL:
http://svn.reactos.org/svn/reactos?rev=52016&view=rev
Log: [USER32] - Use DISPLAY_DEVICEW instead of assuming DISPLAY_DEVICE is in unicode Modified: trunk/reactos/dll/win32/user32/misc/display.c Modified: trunk/reactos/dll/win32/user32/misc/display.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/disp…
============================================================================== --- trunk/reactos/dll/win32/user32/misc/display.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/user32/misc/display.c [iso-8859-1] Mon May 30 21:34:10 2011 @@ -83,7 +83,7 @@ EnumDisplayDevicesW( LPCWSTR lpDevice, DWORD iDevNum, - PDISPLAY_DEVICE lpDisplayDevice, + PDISPLAY_DEVICEW lpDisplayDevice, DWORD dwFlags) { UNICODE_STRING Device;
13 years, 6 months
1
0
0
0
[rharabien] 52015: [NTOSKRNL] - Declare function without arguments with VOID keyword - Improve rbuild file
by rharabien@svn.reactos.org
Author: rharabien Date: Mon May 30 21:26:33 2011 New Revision: 52015 URL:
http://svn.reactos.org/svn/reactos?rev=52015&view=rev
Log: [NTOSKRNL] - Declare function without arguments with VOID keyword - Improve rbuild file Modified: trunk/reactos/ntoskrnl/cache/newcc.h trunk/reactos/ntoskrnl/ntoskrnl.rbuild Modified: trunk/reactos/ntoskrnl/cache/newcc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/newcc.h?rev…
============================================================================== --- trunk/reactos/ntoskrnl/cache/newcc.h [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/cache/newcc.h [iso-8859-1] Mon May 30 21:26:33 2011 @@ -75,7 +75,7 @@ VOID NTAPI -CcShutdownSystem(); +CcShutdownSystem(VOID); VOID NTAPI Modified: trunk/reactos/ntoskrnl/ntoskrnl.rbuild URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.rbuild?r…
============================================================================== --- trunk/reactos/ntoskrnl/ntoskrnl.rbuild [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ntoskrnl.rbuild [iso-8859-1] Mon May 30 21:26:33 2011 @@ -4,8 +4,8 @@ <module name="ntoskrnl" type="kernel" installbase="system32" installname="ntoskrnl.exe"> <xi:include href="ntoskrnl-generic.rbuild" /> </module> + <module name="ntdllsys" type="staticlibrary"> + <include base="ntoskrnl">include</include> + <file>ntdll.S</file> + </module> </group> -<module name="ntdllsys" type="staticlibrary"> - <include base="ntoskrnl">include</include> - <file>ntdll.S</file> -</module>
13 years, 6 months
1
0
0
0
[sserapion] 52014: [NTLMSSP] - Implement NtlmHandleNegotiateMessage NtlmHandleChallengeMessage and NtlmHandleAuthenticateMessage - all wine client server tests pass - still missing a lot of stuff (...
by sserapion@svn.reactos.org
Author: sserapion Date: Mon May 30 21:02:50 2011 New Revision: 52014 URL:
http://svn.reactos.org/svn/reactos?rev=52014&view=rev
Log: [NTLMSSP] - Implement NtlmHandleNegotiateMessage NtlmHandleChallengeMessage and NtlmHandleAuthenticateMessage - all wine client server tests pass - still missing a lot of stuff (WIP code) Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/context.c branches/sspi-bringup/reactos/dll/win32/ntlmssp/credentials.c branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.h branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.c branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.h Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/context.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/context.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/context.c [iso-8859-1] Mon May 30 21:02:50 2011 @@ -391,13 +391,7 @@ ret = NtlmGenerateNegotiateMessage(newContext, fContextReq, InputToken1, - &OutputToken1); - - if(!NT_SUCCESS(ret)) - { - ERR("NtlmGenerateNegotiateMessage failed with %lx\n", ret); - goto fail; - } + OutputToken1); /* set result */ phNewContext->dwUpper = NegotiateFlags; @@ -406,7 +400,6 @@ else /* challenge! */ { TRACE("ISC challenged!\n"); - *phNewContext = *phContext; if (fContextReq & ISC_REQ_USE_SUPPLIED_CREDS) { /* get second input token */ @@ -421,6 +414,7 @@ } } + *phNewContext = *phContext; ret = NtlmHandleChallengeMessage(phNewContext->dwLower, fContextReq, InputToken1, @@ -430,13 +424,12 @@ pfContextAttr, ptsExpiry, &NegotiateFlags); - - if(!NT_SUCCESS(ret)) - { - ERR("NtlmHandleChallengeMessage failed with %lx\n", ret); - goto fail; - } - + } + + if(!NT_SUCCESS(ret)) + { + ERR("failed with %lx\n", ret); + goto fail; } /* build blob with the output message */ @@ -575,7 +568,7 @@ { SECURITY_STATUS ret = SEC_E_OK; PSecBuffer InputToken1, InputToken2; - PSecBuffer OutputToken1; + PSecBuffer OutputToken1, OutputToken2; TRACE("AcceptSecurityContext %p %p %p %lx %lx %p %p %p %p\n", phCredential, phContext, pInput, fContextReq, TargetDataRep, phNewContext, pOutput, pfContextAttr, ptsExpiry); @@ -614,29 +607,56 @@ } /* first call */ - if(!phContext && !InputToken2) + if(!phContext)// && !InputToken2) { if(!phCredential) { ret = SEC_E_INVALID_HANDLE; goto fail; } - + TRACE("phNewContext->dwLower %lx\n", phNewContext->dwLower); ret = NtlmHandleNegotiateMessage(phCredential->dwLower, - &phNewContext->dwLower, + phNewContext->dwLower, fContextReq, InputToken1, - &OutputToken1, + InputToken2, + OutputToken1, + OutputToken2, pfContextAttr, ptsExpiry); } else { - WARN("Handle Authenticate UNIMPLEMENTED!\n"); - } - //if(!NT_SUCCESS(ret)) - - UNIMPLEMENTED; + *phNewContext = *phContext; + USER_SESSION_KEY sessionKey; + ULONG userflags; + TRACE("phNewContext->dwLower %lx\n", phNewContext->dwLower); + ret = NtlmHandleAuthenticateMessage(phNewContext->dwLower, + fContextReq, + InputToken1, + OutputToken1, + pfContextAttr, + ptsExpiry, + (PUCHAR)&sessionKey, + &userflags); + } + + if(!NT_SUCCESS(ret)) + { + ERR("failed with %lx\n", ret); + goto fail; + } + + /* build blob with the output message */ + SecBufferDesc BufferDesc; + BufferDesc.ulVersion = SECBUFFER_VERSION; + BufferDesc.cBuffers = 1; + BufferDesc.pBuffers = OutputToken1; + + if(fContextReq & ASC_REQ_ALLOCATE_MEMORY) + *pfContextAttr |= ASC_RET_ALLOCATED_MEMORY; + + *pOutput = BufferDesc; return ret; fail: return ret; @@ -703,7 +723,6 @@ ApplyControlToken(IN PCtxtHandle phContext, IN PSecBufferDesc pInput) { - UNIMPLEMENTED; return SEC_E_UNSUPPORTED_FUNCTION; } Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/credentials.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/credentials.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/credentials.c [iso-8859-1] Mon May 30 21:02:50 2011 @@ -53,7 +53,7 @@ /* sanity */ ASSERT(cred); - TRACE("%p refcount %d\n",cred, cred->RefCount); + TRACE("%p refcount %lx\n",cred, cred->RefCount); ASSERT(cred->RefCount > 0); /* reference */ @@ -73,7 +73,7 @@ /* sanity */ ASSERT(cred); - TRACE("%p refcount %d\n",cred, cred->RefCount); + TRACE("%p refcount %lx\n",cred, cred->RefCount); ASSERT(cred->RefCount >= 1); /* decrement reference */ @@ -137,7 +137,7 @@ { SECURITY_STATUS ret; - TRACE("(%p, %d, %p)\n", phCredential, ulAttribute, pBuffer); + TRACE("(%p, %lx, %p)\n", phCredential, ulAttribute, pBuffer); if(ulAttribute == SECPKG_ATTR_NAMES) { @@ -158,7 +158,7 @@ { SECURITY_STATUS ret; - TRACE("(%p, %d, %p)\n", phCredential, ulAttribute, pBuffer); + TRACE("(%p, %lx, %p)\n", phCredential, ulAttribute, pBuffer); if(ulAttribute == SECPKG_ATTR_NAMES) { Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.h URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.h [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/ntlmssp.h [iso-8859-1] Mon May 30 21:02:50 2011 @@ -46,9 +46,12 @@ extern UNICODE_STRING NtlmComputerNameString; extern UNICODE_STRING NtlmDomainNameString; +extern UNICODE_STRING NtlmDnsNameString; extern OEM_STRING NtlmOemComputerNameString; extern OEM_STRING NtlmOemDomainNameString; +extern OEM_STRING NtlmOemDnsNameString; extern HANDLE NtlmSystemSecurityToken; +extern UNICODE_STRING NtlmAvTargetInfo; // contains AV pairs with local info typedef enum _NTLM_MODE { NtlmLsaMode = 1, Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.c URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.c [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.c [iso-8859-1] Mon May 30 21:02:50 2011 @@ -26,7 +26,7 @@ NtlmGenerateNegotiateMessage(IN ULONG_PTR Context, IN ULONG ContextReq, IN PSecBuffer InputToken, - OUT PSecBuffer *OutputToken) + OUT PSecBuffer OutputToken) { PNTLMSSP_CONTEXT context = (PNTLMSSP_CONTEXT)Context; PNTLMSSP_CREDENTIAL cred = context->Credential; @@ -35,13 +35,13 @@ ULONG_PTR offset; NTLM_BLOB blobBuffer[2]; //nego contains 2 blobs - if(!*OutputToken) + if(!OutputToken) { ERR("No output token!\n"); return SEC_E_BUFFER_TOO_SMALL; } - if(!((*OutputToken)->pvBuffer)) + if(!(OutputToken->pvBuffer)) { /* according to wine test */ ERR("No output buffer!\n"); @@ -56,23 +56,21 @@ if (!(ContextReq & ISC_REQ_ALLOCATE_MEMORY)) { /* not enough space */ - if(messageSize > (*OutputToken)->cbBuffer) + if(messageSize > OutputToken->cbBuffer) return SEC_E_BUFFER_TOO_SMALL; } else { /* allocate */ - (*OutputToken)->pvBuffer = NtlmAllocate(messageSize); - (*OutputToken)->cbBuffer = messageSize; - - if(!(*OutputToken)->pvBuffer) + OutputToken->pvBuffer = NtlmAllocate(messageSize); + OutputToken->cbBuffer = messageSize; + + if(!OutputToken->pvBuffer) return SEC_E_INSUFFICIENT_MEMORY; } /* allocate a negotiate message */ - message = (PNEGOTIATE_MESSAGE) NtlmAllocate(messageSize); - - if(!message) + if(!(message = (PNEGOTIATE_MESSAGE) NtlmAllocate(messageSize))) return SEC_E_INSUFFICIENT_MEMORY; /* build message */ @@ -110,11 +108,12 @@ blobBuffer[1].Offset = offset+1; } + /* zero struct */ memset(&message->Version, 0, sizeof(NTLM_WINDOWS_VERSION)); /* send it back */ - memcpy((*OutputToken)->pvBuffer, message, messageSize); - (*OutputToken)->cbBuffer = messageSize; + memcpy(OutputToken->pvBuffer, message, messageSize); + OutputToken->cbBuffer = messageSize; context->State = NegotiateSent; TRACE("context %p context->NegotiateFlags:\n",context); @@ -128,40 +127,53 @@ SECURITY_STATUS NtlmHandleNegotiateMessage(IN ULONG_PTR hCredential, - IN OUT PULONG_PTR phContext, + IN OUT ULONG_PTR hContext, IN ULONG ContextReq, IN PSecBuffer InputToken, - OUT PSecBuffer *pOutputToken, + IN PSecBuffer InputToken2, + OUT PSecBuffer OutputToken, + OUT PSecBuffer OutputToken2, OUT PULONG pContextAttr, OUT PTimeStamp ptsExpiry) { SECURITY_STATUS ret = SEC_E_OK; PNEGOTIATE_MESSAGE negoMessage = NULL; PNTLMSSP_CREDENTIAL cred = NULL; - PNTLMSSP_CONTEXT newContext = NULL; - - ERR("NtlmHandleNegotiateMessage called!\n"); - - /* InputToken should contain a negotiate message*/ + PNTLMSSP_CONTEXT context = NULL; + UNICODE_STRING targetName; + OEM_STRING OemDomainName, OemWorkstationName; + ULONG targetFlags = 0; + BOOLEAN isUnicode; + + TRACE("NtlmHandleNegotiateMessage hContext %lx\n", hContext); + if(!(context = NtlmAllocateContext())) + { + ret = SEC_E_INSUFFICIENT_MEMORY; + ERR("SEC_E_INSUFFICIENT_MEMORY!\n"); + goto exit; + } + + hContext = (ULONG_PTR)context; + TRACE("NtlmHandleNegotiateMessage hContext %lx\n", hContext); + + /* InputToken should contain a negotiate message */ if(InputToken->cbBuffer > NTLM_MAX_BUF || InputToken->cbBuffer < sizeof(NEGOTIATE_MESSAGE)) { - ERR("Input token too big!!\n"); + ERR("Input wrong size!!\n"); ret = SEC_E_INVALID_TOKEN; goto exit; } /* allocate a buffer for it */ - negoMessage = NtlmAllocate(InputToken->cbBuffer); - - if(!negoMessage) + if(!(negoMessage = NtlmAllocate(sizeof(NEGOTIATE_MESSAGE)))) { ret = SEC_E_INSUFFICIENT_MEMORY; goto exit; } /* copy it */ - memcpy(negoMessage, InputToken->pvBuffer, InputToken->cbBuffer); + memcpy(negoMessage, InputToken->pvBuffer, sizeof(NEGOTIATE_MESSAGE)); /* validate it */ if(strncmp(negoMessage->Signature, NTLMSSP_SIGNATURE, 8) && @@ -176,9 +188,11 @@ NtlmPrintNegotiateFlags(negoMessage->NegotiateFlags); /* get credentials */ - cred = NtlmReferenceCredential(hCredential); - if(!cred) + if(!(cred = NtlmReferenceCredential(hCredential))) + { + ret = SEC_E_INVALID_TOKEN; goto exit; + } /* must be an incomming request */ if(!(cred->UseFlags & SECPKG_CRED_INBOUND)) @@ -187,72 +201,199 @@ goto exit; } - /* create new context */ - newContext = NtlmAllocateContext(); - if(!newContext) + /* convert flags */ + if(ContextReq & ASC_REQ_IDENTIFY) + { + *pContextAttr |= ASC_RET_IDENTIFY; + context->ContextFlags |= ASC_RET_IDENTIFY; + } + + if(ContextReq & ASC_REQ_DATAGRAM) + { + *pContextAttr |= ASC_RET_DATAGRAM; + context->ContextFlags |= ASC_RET_DATAGRAM; + } + + if(ContextReq & ASC_REQ_CONNECTION) + { + *pContextAttr |= ASC_RET_CONNECTION; + context->ContextFlags |= ASC_RET_CONNECTION; + } + + if(ContextReq & ASC_REQ_INTEGRITY) + { + *pContextAttr |= ASC_RET_INTEGRITY; + context->ContextFlags |= ASC_RET_INTEGRITY; + } + + if(ContextReq & ASC_REQ_REPLAY_DETECT) + { + *pContextAttr |= ASC_RET_REPLAY_DETECT; + context->ContextFlags |= ASC_RET_REPLAY_DETECT; + } + + if(ContextReq & ASC_REQ_SEQUENCE_DETECT) + { + *pContextAttr |= ASC_RET_SEQUENCE_DETECT; + context->ContextFlags |= ASC_RET_SEQUENCE_DETECT; + } + + if(ContextReq & ASC_REQ_ALLOW_NULL_SESSION) + { + context->ContextFlags |= ASC_REQ_ALLOW_NULL_SESSION; + } + + if(ContextReq & ASC_REQ_ALLOW_NON_USER_LOGONS) + { + *pContextAttr |= ASC_RET_ALLOW_NON_USER_LOGONS; + context->ContextFlags |= ASC_RET_ALLOW_NON_USER_LOGONS; + } + + /* encryption */ + if(ContextReq & ASC_REQ_CONFIDENTIALITY) + { + *pContextAttr |= ASC_RET_CONFIDENTIALITY; + context->ContextFlags |= ASC_RET_CONFIDENTIALITY; + } + + if (negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY || + negoMessage->NegotiateFlags & NTLMSSP_REQUEST_TARGET) + { + targetFlags |= NTLMSSP_TARGET_TYPE_SERVER | NTLMSSP_REQUEST_TARGET | NTLMSSP_NEGOTIATE_TARGET_INFO; + + if (negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_UNICODE) + { + isUnicode = TRUE; + targetFlags |= NTLMSSP_NEGOTIATE_UNICODE; + RtlInitUnicodeString(&targetName, NtlmComputerNameString.Buffer); + } + else if(negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_OEM) + { + isUnicode = FALSE; + targetFlags |= NTLMSSP_NEGOTIATE_OEM; + RtlInitUnicodeString(&targetName, (PWCHAR)&NtlmOemComputerNameString.Buffer); + } + else + { + ret = SEC_E_INVALID_TOKEN; + ERR("flags invalid!\n"); + goto exit; + } + } + + /* create a challenge message */ + PCHALLENGE_MESSAGE chaMessage = NULL; + ULONG messageSize = sizeof(CHALLENGE_MESSAGE)+ targetName.Length + 1 + NtlmAvTargetInfo.Length; + ULONG offset; + + /* ntlm does not listen to ASC_REQ_ALLOCATE_MEMORY or lack thereof */ + /* further more the buffer size is always NTLM_MAX_BUF */ + /* allocate output buffer */ + OutputToken->pvBuffer = NtlmAllocate(NTLM_MAX_BUF); + OutputToken->cbBuffer = messageSize; + + if(!OutputToken->pvBuffer) { ret = SEC_E_INSUFFICIENT_MEMORY; goto exit; } - *phContext = (ULONG_PTR)newContext; - - if(ContextReq & ASC_REQ_IDENTIFY) - { + /* allocate message */ + if (!(chaMessage = (PCHALLENGE_MESSAGE)NtlmAllocate(messageSize))) + { + ret = SEC_E_INSUFFICIENT_MEMORY; + goto exit; + } + + TRACE("message %p size %lu\n", chaMessage, messageSize); + + /* build message */ + strcpy(chaMessage->Signature, NTLMSSP_SIGNATURE); + chaMessage->MsgType = NtlmChallenge; + chaMessage->NegotiateFlags = context->NegotiateFlags; + chaMessage->NegotiateFlags |= NTLMSSP_NEGOTIATE_NTLM; + + /* generate challenge */ + NtlmGenerateRandomBits(chaMessage->ServerChallenge, MSV1_0_CHALLENGE_LENGTH); + memcpy(context->Challenge, chaMessage->ServerChallenge, MSV1_0_CHALLENGE_LENGTH); + + offset = (ULONG_PTR)(chaMessage+1); + + if(negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY) + { + negoMessage->NegotiateFlags &= ~NTLMSSP_NEGOTIATE_LM_KEY; + chaMessage->NegotiateFlags |= NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY; + } + else if(negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_LM_KEY) + { + chaMessage->NegotiateFlags |= NTLMSSP_NEGOTIATE_LM_KEY; + } + + if(negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_ALWAYS_SIGN) + chaMessage->NegotiateFlags |= NTLMSSP_NEGOTIATE_ALWAYS_SIGN; + + if(negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_SIGN) + { + chaMessage->NegotiateFlags |= NTLMSSP_NEGOTIATE_SIGN; + *pContextAttr |= (ASC_RET_SEQUENCE_DETECT | ASC_RET_REPLAY_DETECT); + context->ContextFlags |= (ASC_RET_SEQUENCE_DETECT | ASC_RET_REPLAY_DETECT); + } + + if (negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_SEAL) + { + chaMessage->NegotiateFlags |= NTLMSSP_NEGOTIATE_SEAL; + *pContextAttr |= ASC_RET_CONFIDENTIALITY; + context->ContextFlags |= ASC_RET_CONFIDENTIALITY; + } + + if(negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_KEY_EXCH) + chaMessage->NegotiateFlags |= NTLMSSP_NEGOTIATE_KEY_EXCH; + + /* client requested encryption */ + if(negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_128) + chaMessage->NegotiateFlags |= NTLMSSP_NEGOTIATE_128; + else if(negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_56) + chaMessage->NegotiateFlags |= NTLMSSP_NEGOTIATE_56; + + if(negoMessage->NegotiateFlags & NTLMSSP_REQUEST_INIT_RESP) + { + chaMessage->NegotiateFlags |= NTLMSSP_REQUEST_INIT_RESP; *pContextAttr |= ASC_RET_IDENTIFY; - newContext->ContextFlags |= ASC_RET_IDENTIFY; - } - - if(ContextReq & ASC_REQ_DATAGRAM) - { - *pContextAttr |= ASC_RET_DATAGRAM; - newContext->ContextFlags |= ASC_RET_DATAGRAM; - } - - if(ContextReq & ASC_REQ_CONNECTION) - { - *pContextAttr |= ASC_RET_CONNECTION; - newContext->ContextFlags |= ASC_RET_CONNECTION; - } - - if(ContextReq & ASC_REQ_INTEGRITY) - { - *pContextAttr |= ASC_RET_INTEGRITY; - newContext->ContextFlags |= ASC_RET_INTEGRITY; - } - - if(ContextReq & ASC_REQ_REPLAY_DETECT) - { - *pContextAttr |= ASC_RET_REPLAY_DETECT; - newContext->ContextFlags |= ASC_RET_REPLAY_DETECT; - } - - if(ContextReq & ASC_REQ_SEQUENCE_DETECT) - { - *pContextAttr |= ASC_RET_SEQUENCE_DETECT; - newContext->ContextFlags |= ASC_RET_SEQUENCE_DETECT; - } - - if(ContextReq & ASC_REQ_ALLOW_NULL_SESSION) - { - newContext->ContextFlags |= ASC_REQ_ALLOW_NULL_SESSION; - } - - if(ContextReq & ASC_REQ_ALLOW_NON_USER_LOGONS) - { - *pContextAttr |= ASC_RET_ALLOW_NON_USER_LOGONS; - newContext->ContextFlags |= ASC_RET_ALLOW_NON_USER_LOGONS; - } - - /* encryption */ - if(ContextReq & ASC_REQ_CONFIDENTIALITY) - { - *pContextAttr |= ASC_RET_CONFIDENTIALITY; - newContext->ContextFlags |= ASC_RET_CONFIDENTIALITY; - } + context->ContextFlags |= ASC_RET_IDENTIFY; + } + + /* check for local call */ + if((negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED) && + (negoMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED)) + { + NtlmBlobToUnicodeString(InputToken, negoMessage->OemDomainName, (PUNICODE_STRING)&OemDomainName); + NtlmBlobToUnicodeString(InputToken, negoMessage->OemWorkstationName, (PUNICODE_STRING)&OemWorkstationName); + + if (RtlEqualString(&OemWorkstationName, &NtlmOemComputerNameString, FALSE)&& + RtlEqualString(&OemDomainName, &NtlmOemDomainNameString, FALSE)) + { + TRACE("local negotiate detected!\n"); + chaMessage->NegotiateFlags |= NTLMSSP_NEGOTIATE_LOCAL_CALL; + } + } + + NtlmUnicodeStringToBlob((PVOID)chaMessage, &targetName, &chaMessage->TargetName, &offset); + NtlmUnicodeStringToBlob((PVOID)chaMessage, &NtlmAvTargetInfo, &chaMessage->TargetInfo, &offset); + chaMessage->NegotiateFlags |= targetFlags; + + memcpy(OutputToken->pvBuffer, chaMessage, messageSize); + OutputToken->cbBuffer = messageSize; + context->State = ChallengeSent; + ret = SEC_I_CONTINUE_NEEDED; exit: - ERR("FIXME: HERE!!!!!!!!!!!!!!!"); + if(chaMessage) NtlmFree(chaMessage); + if(negoMessage) NtlmFree(negoMessage); + if(cred) NtlmDereferenceCredential((ULONG_PTR)cred); + if(targetName.Buffer) NtlmFree(targetName.Buffer); + if(OemDomainName.Buffer) NtlmFree(OemDomainName.Buffer); + if(OemWorkstationName.Buffer) NtlmFree(OemWorkstationName.Buffer); + return ret; } @@ -261,59 +402,60 @@ IN ULONG ContextReq, IN PSecBuffer InputToken1, IN PSecBuffer InputToken2, - IN OUT PSecBuffer *OutputToken1, - IN OUT PSecBuffer *OutputToken2, + IN OUT PSecBuffer OutputToken1, + IN OUT PSecBuffer OutputToken2, OUT PULONG pContextAttr, OUT PTimeStamp ptsExpiry, OUT PULONG NegotiateFlags) { SECURITY_STATUS ret = SEC_E_OK; - PNTLMSSP_CONTEXT context; - PCHALLENGE_MESSAGE challenge; + PNTLMSSP_CONTEXT context = NULL; + PCHALLENGE_MESSAGE challenge = NULL; + PNTLMSSP_CREDENTIAL cred = NULL; BOOLEAN isUnicode; + TRACE("NtlmHandleChallengeMessage hContext %lx\n", hContext); /* get context */ context = NtlmReferenceContext(hContext); if(!context || !context->Credential) { ERR("NtlmHandleChallengeMessage invalid handle!\n"); ret = SEC_E_INVALID_HANDLE; - goto exit; + goto fail; } /* re-authenticate call */ if(context->State == AuthenticateSent) { UNIMPLEMENTED; + goto fail; } else if(context->State != NegotiateSent) { - ERR("Context not in negotiate sent state!\n"); + ERR("Context not in correct state!\n"); ret = SEC_E_OUT_OF_SEQUENCE; - goto exit; + goto fail; } /* InputToken1 should contain a challenge message */ - TRACE("input token size %lx\n", InputToken1->cbBuffer); if(InputToken1->cbBuffer > NTLM_MAX_BUF || InputToken1->cbBuffer < sizeof(CHALLENGE_MESSAGE)) { ERR("Input token invalid!\n"); ret = SEC_E_INVALID_TOKEN; - goto exit; + goto fail; } /* allocate a buffer for it */ - challenge = NtlmAllocate(InputToken1->cbBuffer); - if(!challenge) + if(!(challenge = NtlmAllocate(sizeof(CHALLENGE_MESSAGE)))) { ERR("failed to allocate challenge buffer!\n"); ret = SEC_E_INSUFFICIENT_MEMORY; - goto exit; + goto fail; } /* copy it */ - memcpy(challenge, InputToken1->pvBuffer, InputToken1->cbBuffer); + memcpy(challenge, InputToken1->pvBuffer, sizeof(CHALLENGE_MESSAGE)); /* validate it */ if(strncmp(challenge->Signature, NTLMSSP_SIGNATURE, 8) && @@ -321,14 +463,14 @@ { ERR("Input message not valid!\n"); ret = SEC_E_INVALID_TOKEN; - goto exit; + goto fail; } TRACE("Got valid challege message! with flags:\n"); NtlmPrintNegotiateFlags(challenge->NegotiateFlags); /* print challenge message and payloads */ - NtlmPrintHexDump((PBYTE)challenge, InputToken1->cbBuffer); + NtlmPrintHexDump((PBYTE)InputToken1->pvBuffer, InputToken1->cbBuffer); if(challenge->NegotiateFlags & NTLMSSP_NEGOTIATE_DATAGRAM) { @@ -364,14 +506,14 @@ /* these flags must be bad! */ ERR("challenge flags did not specify unicode or oem!\n"); ret = SEC_E_INVALID_TOKEN; - goto exit; + goto fail; } /* support ntlm2 */ if(challenge->NegotiateFlags & NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY) { challenge->NegotiateFlags &= ~NTLMSSP_NEGOTIATE_LM_KEY; - context->NegotiateFlags &= ~(NTLMSSP_NEGOTIATE_LM_KEY); + context->NegotiateFlags &= ~NTLMSSP_NEGOTIATE_LM_KEY; } else { @@ -383,7 +525,7 @@ { ERR("netware authentication not supported!!!\n"); ret = SEC_E_UNSUPPORTED_FUNCTION; - goto exit; + goto fail; } } @@ -430,7 +572,7 @@ if(!NT_SUCCESS(ret)) { ERR("could not get target info!\n"); - goto exit; + goto fail; } } else @@ -444,20 +586,23 @@ if(!NT_SUCCESS(ret)) { ERR("could not get target info!\n"); - goto exit; + goto fail; } if(isUnicode) FIXME("convert to unicode!\n"); } - TRACE("ServerName %s\n", debugstr_w(ServerName.Buffer)); - - PNTLMSSP_CREDENTIAL cred = NtlmReferenceCredential((ULONG_PTR)context->Credential); + + MSV1_0_NTLM3_RESPONSE NtResponse; LM2_RESPONSE Lm2Response; USER_SESSION_KEY UserSessionKey; LM_SESSION_KEY LmSessionKey; - NtlmUnProtectMemory(cred->Password.Buffer, cred->Password.Length * sizeof(WCHAR)); + if(!(cred = NtlmReferenceCredential((ULONG_PTR)context->Credential))) + goto fail; + + /* unscramble password */ + NtlmUnProtectMemory(cred->Password.Buffer, cred->Password.Length); TRACE("cred: %s %s %s\n", debugstr_w(cred->UserName.Buffer), debugstr_w(cred->Password.Buffer), debugstr_w(cred->DomainName.Buffer)); @@ -472,9 +617,255 @@ &UserSessionKey, &LmSessionKey); -exit: + PAUTHENTICATE_MESSAGE authmessage = NULL; + ULONG_PTR offset; + + UNICODE_STRING NtResponseString; + //UNICODE_STRING LmResponseString; + UNICODE_STRING UserSessionKeyString; + UNICODE_STRING LmSessionKeyString; + +#define InitString(str, input) str.MaximumLength = str.Length = sizeof(input)*sizeof(WCHAR); str.Buffer = (WCHAR*)&input + InitString(NtResponseString, NtResponse); + //InitString(LmResponseString, Lm2Response); + InitString(UserSessionKeyString, UserSessionKey); + InitString(LmSessionKeyString, LmSessionKey); + + ULONG messageSize = sizeof(AUTHENTICATE_MESSAGE) + + ServerName.Length + cred->UserName.Length + cred->DomainName.Length + + NtResponseString.Length + UserSessionKeyString.Length + LmSessionKeyString.Length; + //LmResponseString.Length; + + if(!(authmessage = NtlmAllocate(messageSize))) + { + ret = SEC_E_INSUFFICIENT_MEMORY; + goto fail; + } + + strcpy(authmessage->Signature, NTLMSSP_SIGNATURE); + authmessage->MsgType = NtlmAuthenticate; + + offset = (ULONG_PTR)(authmessage+1); + + NtlmUnicodeStringToBlob((PVOID)authmessage, + &cred->DomainName, + &authmessage->DomainName, + &offset); + + NtlmUnicodeStringToBlob((PVOID)authmessage, + &cred->UserName, + &authmessage->UserName, + &offset); + + NtlmUnicodeStringToBlob((PVOID)authmessage, + &ServerName, + &authmessage->WorkstationName, + &offset); + + //if(targetinfo) + //NtlmUnicodeStringToBlob((PVOID)authmessage, + // &LmResponseString, + // &authmessage->LmChallengeResponse, + // &offset); + + NtlmUnicodeStringToBlob((PVOID)authmessage, + &NtResponseString, + &authmessage->NtChallengeResponse, + &offset); + + NtlmUnicodeStringToBlob((PVOID)authmessage, + &UserSessionKeyString, + &authmessage->EncryptedRandomSessionKey, + &offset); + + /* if should not allocate */ + if (!(ContextReq & ISC_REQ_ALLOCATE_MEMORY)) + { + /* not enough space */ + if(messageSize > OutputToken1->cbBuffer) + { + ret = SEC_E_BUFFER_TOO_SMALL; + goto fail; + } + } + else + { + /* allocate */ + if(!(OutputToken1->pvBuffer = NtlmAllocate(messageSize))) + { + ret = SEC_E_INSUFFICIENT_MEMORY; + goto fail; + } + } + + OutputToken1->cbBuffer = messageSize; /* says wine test */ + memcpy(OutputToken1->pvBuffer, authmessage, messageSize); + context->State = AuthenticateSent; + ret = SEC_E_OK; + +fail: + if(authmessage) NtlmFree(authmessage); + if(context) NtlmDereferenceContext((ULONG_PTR)context); + if(cred) NtlmDereferenceCredential((ULONG_PTR)cred); ERR("handle challenge end\n"); - return ret; } +SECURITY_STATUS +NtlmHandleAuthenticateMessage(IN ULONG_PTR hContext, + IN ULONG ContextReq, + IN PSecBuffer InputToken, + OUT PSecBuffer OutputToken, + OUT PULONG pContextAttr, + OUT PTimeStamp ptsExpiry, + OUT PUCHAR pSessionKey, + OUT PULONG pfUserFlags) +{ + SECURITY_STATUS ret = SEC_E_OK; + PNTLMSSP_CONTEXT context = NULL; + PAUTHENTICATE_MESSAGE authMessage = NULL; + BOOLEAN isUnicode; + + TRACE("NtlmHandleAuthenticateMessage hContext %x!\n", hContext); + /* get context */ + if(!(context = NtlmReferenceContext(hContext))) + { + ret = SEC_E_INVALID_HANDLE; + goto fail; + } + + TRACE("context->State %d\n", context->State); + if(context->State != ChallengeSent || context->State != Authenticated) + { + ERR("Context not in correct state!\n"); + ret = SEC_E_OUT_OF_SEQUENCE; + goto fail; + } + + /* re-authorize */ + if(context->State == Authenticated) + UNIMPLEMENTED; + + /* InputToken1 should contain a authenticate message */ + TRACE("input token size %lx\n", InputToken->cbBuffer); + if(InputToken->cbBuffer > NTLM_MAX_BUF || + InputToken->cbBuffer < sizeof(AUTHENTICATE_MESSAGE)) + { + ERR("Input token invalid!\n"); + ret = SEC_E_INVALID_TOKEN; + goto fail; + } + + /* allocate a buffer for it */ + if(!(authMessage = NtlmAllocate(sizeof(AUTHENTICATE_MESSAGE)))) + { + ERR("failed to allocate authMessage buffer!\n"); + ret = SEC_E_INSUFFICIENT_MEMORY; + goto fail; + } + + /* copy it */ + memcpy(authMessage, InputToken->pvBuffer, sizeof(AUTHENTICATE_MESSAGE)); + + /* validate it */ + if(strncmp(authMessage->Signature, NTLMSSP_SIGNATURE, 8) && + authMessage->MsgType == NtlmAuthenticate) + { + ERR("Input message not valid!\n"); + ret = SEC_E_INVALID_TOKEN; + goto fail; + } + + /* datagram */ + if(context->NegotiateFlags & NTLMSSP_NEGOTIATE_DATAGRAM) + { + /* context and message dont agree on connection type! */ + if(!(authMessage->NegotiateFlags & NTLMSSP_NEGOTIATE_DATAGRAM)) + { + ret = SEC_E_INVALID_TOKEN; + goto fail; + } + + /* use message flags */ + context->NegotiateFlags = authMessage->NegotiateFlags; + + /* need a key */ + if(context->NegotiateFlags & (NTLMSSP_NEGOTIATE_SIGN | NTLMSSP_NEGOTIATE_SEAL)) + context->NegotiateFlags |= NTLMSSP_NEGOTIATE_KEY_EXCH; + + /* remove lm key */ + if (context->NegotiateFlags & NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY) + context->NegotiateFlags &= ~NTLMSSP_NEGOTIATE_LM_KEY; + } + + /* supports unicode */ + if(context->NegotiateFlags & NTLMSSP_NEGOTIATE_UNICODE) + { + context->NegotiateFlags &= ~NTLMSSP_NEGOTIATE_OEM; + isUnicode = TRUE; + } + else if(context->NegotiateFlags & NTLMSSP_NEGOTIATE_OEM) + { + context->NegotiateFlags &= ~NTLMSSP_NEGOTIATE_UNICODE; + isUnicode = FALSE; + } + else + { + /* these flags must be bad! */ + ERR("authenticate flags did not specify unicode or oem!\n"); + ret = SEC_E_INVALID_TOKEN; + goto fail; + } + + UNICODE_STRING LmChallengeResponse, NtChallengeResponse, SessionKey; + UNICODE_STRING UserName, Workstation, DomainName; + + if(!NT_SUCCESS(NtlmBlobToUnicodeString(InputToken, + authMessage->LmChallengeResponse, &LmChallengeResponse))) + { + ret = SEC_E_INVALID_TOKEN; + goto fail; + } + + if(!NT_SUCCESS(NtlmBlobToUnicodeString(InputToken, + authMessage->NtChallengeResponse, &NtChallengeResponse))) + { + ret = SEC_E_INVALID_TOKEN; + goto fail; + } + + if(!NT_SUCCESS(NtlmBlobToUnicodeString(InputToken, + authMessage->UserName, &UserName))) + { + ret = SEC_E_INVALID_TOKEN; + goto fail; + } + + if(!NT_SUCCESS(NtlmBlobToUnicodeString(InputToken, + authMessage->WorkstationName, &Workstation))) + { + ret = SEC_E_INVALID_TOKEN; + goto fail; + } + + if(!NT_SUCCESS(NtlmBlobToUnicodeString(InputToken, + authMessage->DomainName, &DomainName))) + { + ret = SEC_E_INVALID_TOKEN; + goto fail; + } + + //if(NTLMSSP_NEGOTIATE_KEY_EXCHANGE) + if(!NT_SUCCESS(NtlmBlobToUnicodeString(InputToken, + authMessage->EncryptedRandomSessionKey, &SessionKey))) + { + ret = SEC_E_INVALID_TOKEN; + goto fail; + } + + ret = SEC_I_COMPLETE_NEEDED; + +fail: + NtlmDereferenceContext((ULONG_PTR)context); + return ret; +} Modified: branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.h URL:
http://svn.reactos.org/svn/reactos/branches/sspi-bringup/reactos/dll/win32/…
============================================================================== --- branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.h [iso-8859-1] (original) +++ branches/sspi-bringup/reactos/dll/win32/ntlmssp/protocol.h [iso-8859-1] Mon May 30 21:02:50 2011 @@ -164,6 +164,14 @@ /* payload */ }AUTHENTICATE_MESSAGE, *PAUTHENTICATE_MESSAGE; +typedef struct _MESSAGE_SIGNATURE +{ + ULONG Version; + ULONG RandomPad; + ULONG Checksum; + ULONG Nonce; +}MESSAGE_SIGNATURE, *PMESSAGE_SIGNATURE; + /* basic functions */ VOID @@ -173,14 +181,14 @@ VOID NTOWFv2( - PWCHAR password, - PWCHAR user, - PWCHAR domain, + const PWCHAR password, + const PWCHAR user, + const PWCHAR domain, PUCHAR result); VOID LMOWFv1( - PCCHAR password, + const PCCHAR password, PUCHAR result); VOID @@ -275,15 +283,17 @@ IN ULONG_PTR hContext, IN ULONG ContextReq, IN PSecBuffer InputToken, - OUT PSecBuffer *OutputToken); + OUT PSecBuffer OutputToken); SECURITY_STATUS NtlmHandleNegotiateMessage( IN ULONG_PTR hCredential, - IN OUT PULONG_PTR phContext, + IN OUT ULONG_PTR hContext, IN ULONG fContextReq, - IN PSecBuffer InputToken, - OUT PSecBuffer *OutputToken, + IN PSecBuffer InputToken1, + IN PSecBuffer InputToken2, + OUT PSecBuffer OutputToken1, + OUT PSecBuffer OutputToken2, OUT PULONG pContextAttr, OUT PTimeStamp ptsExpiry); @@ -293,8 +303,8 @@ IN ULONG ContextReq, IN PSecBuffer InputToken1, IN PSecBuffer InputToken2, - IN OUT PSecBuffer *OutputToken1, - IN OUT PSecBuffer *OutputToken2, + IN OUT PSecBuffer OutputToken1, + IN OUT PSecBuffer OutputToken2, OUT PULONG ContextAttr, OUT PTimeStamp ptsExpiry, OUT PULONG NegotiateFlags); @@ -303,15 +313,11 @@ NtlmHandleAuthenticateMessage( IN ULONG_PTR hContext, IN ULONG fContextReq, - IN PSecBuffer *pInputTokens, + IN PSecBuffer InputToken, OUT PSecBuffer OutputToken, OUT PULONG pContextAttr, OUT PTimeStamp ptsExpiry, OUT PUCHAR pSessionKey, - OUT PULONG pfNegotiateFlags, - OUT PHANDLE TokenHandle, - OUT PNTSTATUS pSubStatus, - OUT PTimeStamp ptsPasswordExpiry, OUT PULONG pfUserFlags); /* helper functions */
13 years, 6 months
1
0
0
0
[cgutman] 52013: [AFD] - Launch a new listen IRP right after the current one completes instead of waiting until the current pending connection is accepted - Reduces the chance of AFD missing two co...
by cgutman@svn.reactos.org
Author: cgutman Date: Mon May 30 17:27:53 2011 New Revision: 52013 URL:
http://svn.reactos.org/svn/reactos?rev=52013&view=rev
Log: [AFD] - Launch a new listen IRP right after the current one completes instead of waiting until the current pending connection is accepted - Reduces the chance of AFD missing two connection requests that are issued very close together and increases network performance by allowing our connection queue to do its job Modified: trunk/reactos/drivers/network/afd/afd/listen.c trunk/reactos/drivers/network/afd/afd/tdiconn.c trunk/reactos/drivers/network/afd/include/afd.h trunk/reactos/drivers/network/afd/include/tdiconn.h Modified: trunk/reactos/drivers/network/afd/afd/listen.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/li…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] Mon May 30 17:27:53 2011 @@ -178,17 +178,30 @@ ListEntry ) ); } - if( FCB->ListenIrp.ConnectionCallInfo ) { - ExFreePool( FCB->ListenIrp.ConnectionCallInfo ); - FCB->ListenIrp.ConnectionCallInfo = NULL; - } - - if( FCB->ListenIrp.ConnectionReturnInfo ) { - ExFreePool( FCB->ListenIrp.ConnectionReturnInfo ); - FCB->ListenIrp.ConnectionReturnInfo = NULL; - } - - FCB->NeedsNewListen = TRUE; + /* Launch new accept socket */ + Status = WarmSocketForConnection( FCB ); + + if (NT_SUCCESS(Status)) + { + Status = TdiBuildNullConnectionInfoInPlace(FCB->ListenIrp.ConnectionCallInfo, + FCB->LocalAddress->Address[0].AddressType); + ASSERT(Status == STATUS_SUCCESS); + + Status = TdiBuildNullConnectionInfoInPlace(FCB->ListenIrp.ConnectionReturnInfo, + FCB->LocalAddress->Address[0].AddressType); + ASSERT(Status == STATUS_SUCCESS); + + Status = TdiListen( &FCB->ListenIrp.InFlightRequest, + FCB->Connection.Object, + &FCB->ListenIrp.ConnectionCallInfo, + &FCB->ListenIrp.ConnectionReturnInfo, + &FCB->ListenIrp.Iosb, + ListenComplete, + FCB ); + + if (Status == STATUS_PENDING) + Status = STATUS_SUCCESS; + } /* Trigger a select return if appropriate */ if( !IsListEmpty( &FCB->PendingConnections ) ) { @@ -263,9 +276,6 @@ if( Status == STATUS_PENDING ) Status = STATUS_SUCCESS; - - if (NT_SUCCESS(Status)) - FCB->NeedsNewListen = FALSE; AFD_DbgPrint(MID_TRACE,("Returning %x\n", Status)); return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); @@ -323,48 +333,6 @@ if( !SocketAcquireStateLock( FCB ) ) return LostSocket( Irp ); - if( FCB->NeedsNewListen ) { - AFD_DbgPrint(MID_TRACE,("ADDRESSFILE: %x\n", FCB->AddressFile.Handle)); - - /* Launch new accept socket */ - Status = WarmSocketForConnection( FCB ); - - if( Status == STATUS_SUCCESS ) { - Status = TdiBuildNullConnectionInfo - ( &FCB->ListenIrp.ConnectionCallInfo, - FCB->LocalAddress->Address[0].AddressType ); - - if (!NT_SUCCESS(Status)) return UnlockAndMaybeComplete(FCB, Status, Irp, 0); - - Status = TdiBuildNullConnectionInfo - ( &FCB->ListenIrp.ConnectionReturnInfo, - FCB->LocalAddress->Address[0].AddressType ); - - if (!NT_SUCCESS(Status)) - { - ExFreePool(FCB->ListenIrp.ConnectionCallInfo); - FCB->ListenIrp.ConnectionCallInfo = NULL; - return UnlockAndMaybeComplete(FCB, Status, Irp, 0); - } - - Status = TdiListen( &FCB->ListenIrp.InFlightRequest, - FCB->Connection.Object, - &FCB->ListenIrp.ConnectionCallInfo, - &FCB->ListenIrp.ConnectionReturnInfo, - &FCB->ListenIrp.Iosb, - ListenComplete, - FCB ); - - if( Status == STATUS_PENDING ) - Status = STATUS_SUCCESS; - - if( !NT_SUCCESS(Status) ) - return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); - - FCB->NeedsNewListen = FALSE; - } else return UnlockAndMaybeComplete( FCB, Status, Irp, 0 ); - } - for( PendingConn = FCB->PendingConnections.Flink; PendingConn != &FCB->PendingConnections; PendingConn = PendingConn->Flink ) { Modified: trunk/reactos/drivers/network/afd/afd/tdiconn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/td…
============================================================================== --- trunk/reactos/drivers/network/afd/afd/tdiconn.c [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/afd/tdiconn.c [iso-8859-1] Mon May 30 17:27:53 2011 @@ -77,7 +77,7 @@ return A; } -static NTSTATUS TdiBuildNullConnectionInfoInPlace +NTSTATUS TdiBuildNullConnectionInfoInPlace ( PTDI_CONNECTION_INFORMATION ConnInfo, ULONG Type ) /* Modified: trunk/reactos/drivers/network/afd/include/afd.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/includ…
============================================================================== --- trunk/reactos/drivers/network/afd/include/afd.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/include/afd.h [iso-8859-1] Mon May 30 17:27:53 2011 @@ -179,7 +179,7 @@ PVOID CurrentThread; PFILE_OBJECT FileObject; PAFD_DEVICE_EXTENSION DeviceExt; - BOOLEAN DelayedAccept, NeedsNewListen; + BOOLEAN DelayedAccept; UINT ConnSeq; PTRANSPORT_ADDRESS LocalAddress, RemoteAddress; PTDI_CONNECTION_INFORMATION AddressFrom, ConnectInfo; Modified: trunk/reactos/drivers/network/afd/include/tdiconn.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/includ…
============================================================================== --- trunk/reactos/drivers/network/afd/include/tdiconn.h [iso-8859-1] (original) +++ trunk/reactos/drivers/network/afd/include/tdiconn.h [iso-8859-1] Mon May 30 17:27:53 2011 @@ -19,7 +19,7 @@ ( PTDI_CONNECTION_INFORMATION ConnInfo, PTRANSPORT_ADDRESS Name ); NTSTATUS TdiBuildConnectionInfo ( PTDI_CONNECTION_INFORMATION *ConnectionInfo, PTRANSPORT_ADDRESS Name ); -NTSTATUS TdiBuildNullConnectionInfoToPlace +NTSTATUS TdiBuildNullConnectionInfoInPlace ( PTDI_CONNECTION_INFORMATION ConnInfo, ULONG Type ); NTSTATUS TdiBuildNullConnectionInfo ( PTDI_CONNECTION_INFORMATION *ConnectionInfo, ULONG Type );
13 years, 6 months
1
0
0
0
← Newer
1
2
3
4
5
...
52
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Results per page:
10
25
50
100
200