Compare commits

..

1 Commits

Author SHA1 Message Date
The ReactOS Team
b214009e58 This commit was manufactured by cvs2svn to create tag 'ros-0_0_21'.
svn path=/tags/ros-0_0_21/; revision=3693
2002-11-03 20:01:07 +00:00
25973 changed files with 809556 additions and 8186304 deletions

18
reactos/.cvsignore Normal file
View File

@@ -0,0 +1,18 @@
dist
reactos
*.sys
*.exe
*.dll
*.cpl
*.a
*.o
*.d
*.coff
*.dsp
*.dsw
*.aps
*.ncb
*.opt
*.sym
*.plg
*.bak

4
reactos/.gdbinit Normal file
View File

@@ -0,0 +1,4 @@
directory /mnt/windows/CvsHome/reactos/ntoskrnl
symbol-file ntoskrnl/ntoskrnl.nostrip.exe -mapped
set remotebaud 115200
target remote com2

View File

@@ -1,291 +0,0 @@
cmake_minimum_required(VERSION 2.8.12)
if(POLICY CMP0017)
# Shadow cmake provided modules
cmake_policy(SET CMP0017 OLD)
endif()
if(POLICY CMP0026)
# Allow use of the LOCATION property
cmake_policy(SET CMP0026 OLD)
endif()
if(POLICY CMP0051)
# List TARGET_OBJECTS in SOURCES target property
cmake_policy(SET CMP0051 NEW)
endif()
project(REACTOS)
# Versioning
include(include/reactos/version.cmake)
# Don't escape preprocessor definition values added via add_definitions
cmake_policy(SET CMP0005 OLD)
cmake_policy(SET CMP0002 NEW)
if(POLICY CMP0018)
cmake_policy(SET CMP0018 OLD)
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(CMAKE_SKIP_PREPROCESSED_SOURCE_RULES TRUE)
set(CMAKE_SKIP_ASSEMBLY_SOURCE_RULES TRUE)
set(CMAKE_COLOR_MAKEFILE OFF)
#set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
set(CMAKE_SKIP_INSTALL_RULES ON)
if(NOT DEFINED NEW_STYLE_BUILD)
set(NEW_STYLE_BUILD TRUE)
endif()
if(NOT ARCH)
set(ARCH i386)
endif()
# Now the ARCH variable will be in lowercase.
# It is needed because STREQUAL comparison
# is case-sensitive.
# See http://cmake.3232098.n2.nabble.com/Case-insensitive-string-compare-td7580269.html
# for more information.
string(TOLOWER ${ARCH} ARCH)
# Compile options
if(ARCH STREQUAL "i386")
include(cmake/config.cmake)
elseif(ARCH STREQUAL "amd64")
include(cmake/config-amd64.cmake)
elseif(ARCH STREQUAL "arm")
include(cmake/config-arm.cmake)
endif()
# Compiler flags handling
include(cmake/compilerflags.cmake)
add_definitions(-D__REACTOS__)
if(MSVC_IDE)
add_compile_flags("/MP")
endif()
# We don't need CMake importlib handling.
# FIXME: Remove the MSVC_IDE condition when the upcoming RosBE lands.
if(NOT MSVC_IDE)
unset(CMAKE_IMPORT_LIBRARY_SUFFIX)
endif()
# Bison and Flex support
# include(cmake/bison-flex.cmake)
if(NOT CMAKE_CROSSCOMPILING)
if(NEW_STYLE_BUILD)
set(TOOLS_FOLDER ${CMAKE_CURRENT_BINARY_DIR})
endif()
add_definitions(-DTARGET_${ARCH})
if(MSVC)
if(ARCH STREQUAL "i386")
add_definitions(/D_X86_ /DWIN32 /D_WINDOWS)
endif()
if(MSVC_VERSION GREATER 1699)
add_definitions(/D_ALLOW_KEYWORD_MACROS)
endif()
add_definitions(/Dinline=__inline)
else()
add_compile_flags("-fshort-wchar -Wno-multichar")
endif()
include_directories(include/host)
if(NOT MSVC)
add_subdirectory(dll/win32/dbghelp)
endif()
add_subdirectory(tools)
add_subdirectory(lib)
if(NOT NEW_STYLE_BUILD)
if(NOT MSVC)
export(TARGETS bin2c widl gendib cabman cdmake fatten hpp mkhive obj2bin spec2def geninc rsym mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
else()
export(TARGETS bin2c widl gendib cabman cdmake fatten hpp mkhive obj2bin spec2def geninc mkshelllink utf16le FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
endif()
endif()
else()
if(NEW_STYLE_BUILD)
include(cmake/host-tools.cmake)
endif()
# Print build type
message("-- Build Type: ${CMAKE_BUILD_TYPE}")
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
#useful stuff!
include(CMakeParseArguments)
# Do some cleanup
file(REMOVE
${REACTOS_BINARY_DIR}/dependencies.graphml
${REACTOS_BINARY_DIR}/boot/ros_livecd.txt
${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt
${REACTOS_BINARY_DIR}/boot/ros_minicd.txt
${REACTOS_BINARY_DIR}/boot/ros_minicd_target.txt
${REACTOS_BINARY_DIR}/boot/ros_cab.txt
${REACTOS_BINARY_DIR}/boot/ros_cab_target.txt)
if(NOT NEW_STYLE_BUILD)
if(NOT DEFINED REACTOS_BUILD_TOOLS_DIR)
set(REACTOS_BUILD_TOOLS_DIR ${REACTOS_SOURCE_DIR}/build)
endif()
set(IMPORT_EXECUTABLES "${REACTOS_BUILD_TOOLS_DIR}/ImportExecutables.cmake" CACHE FILEPATH "Host executables")
include(${IMPORT_EXECUTABLES})
endif()
if(DBG)
add_definitions(-DDBG=1 -D_SEH_ENABLE_TRACE)
else()
add_definitions(-DDBG=0)
endif()
if(KDBG)
add_definitions(-DKDBG=1)
endif()
if(_WINKD_)
add_definitions(-D_WINKD_=1)
endif()
if(CMAKE_VERSION MATCHES "ReactOS")
set(PCH 1 CACHE BOOL "Whether to use precompiled headers")
else()
set(PCH 0 CACHE BOOL "Whether to use precompiled headers")
endif()
# Version Options
add_definitions(-DWINVER=0x502
-D_WIN32_IE=0x600
-D_WIN32_WINNT=0x502
-D_WIN32_WINDOWS=0x502
-D_SETUPAPI_VER=0x502)
# Arch Options
if(ARCH STREQUAL "i386")
add_definitions(-D_M_IX86 -D_X86_ -D__i386__ -Di386)
elseif(ARCH STREQUAL "amd64")
add_definitions(-D_M_AMD64 -D_AMD64_ -D__x86_64__ -D_WIN64)
elseif(ARCH STREQUAL "arm")
# _M_ARM is already defined by toolchain
add_definitions(-D_ARM_ -D__arm__ -DWIN32)
if(SARCH STREQUAL "omap-zoom2")
add_definitions(-D_ZOOM2_)
endif()
endif()
# Other
if(ARCH STREQUAL "i386")
add_definitions(-DUSE_COMPILER_EXCEPTIONS -D_USE_32BIT_TIME_T)
elseif(ARCH STREQUAL "amd64")
add_definitions(-DUSE_COMPILER_EXCEPTIONS -DNO_UNDERSCORE_PREFIX)
elseif(ARCH STREQUAL "arm")
add_definitions(-DUSE_COMPILER_EXCEPTIONS -DNO_UNDERSCORE_PREFIX)
endif()
# Activate support for assembly source files
enable_language(ASM)
# Activate language support for resource files
enable_language(RC)
# Localization definitions
include(cmake/localization.cmake)
set(I18N_DEFS "")
# This will set I18N_DEFS for later use
set_i18n_language(${I18N_LANG})
# Compiler specific definitions and macros
if(MSVC)
include(cmake/msvc.cmake)
else()
include(cmake/gcc.cmake)
endif()
# Generic macros
include(cmake/CMakeMacros.cmake)
# IDL macros for widl/midl
# We're using widl now for both MSVC and GCC builds
include(cmake/widl-support.cmake)
include_directories(
include
include/psdk
include/dxsdk
${REACTOS_BINARY_DIR}/include
${REACTOS_BINARY_DIR}/include/psdk
${REACTOS_BINARY_DIR}/include/dxsdk
${REACTOS_BINARY_DIR}/include/ddk
${REACTOS_BINARY_DIR}/include/reactos
include/crt
include/ddk
include/ndk
include/reactos
include/reactos/libs)
if(ARCH STREQUAL "arm")
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/arm)
endif()
add_dependency_header()
add_subdirectory(include/xdk)
add_subdirectory(include/psdk)
add_subdirectory(include/dxsdk)
add_subdirectory(include/reactos/wine)
add_subdirectory(include/reactos/mc)
add_subdirectory(include/asm)
if(NO_ROSSYM)
include(cmake/baseaddress_dwarf.cmake)
elseif(MSVC)
include(cmake/baseaddress_msvc.cmake)
else()
include(cmake/baseaddress.cmake)
endif()
# For MSVC builds, this puts all debug symbols file in the same directory.
set(CMAKE_PDB_OUTPUT_DIRECTORY "${REACTOS_BINARY_DIR}/msvc_pdb")
#begin with boot so reactos_cab target is defined before all other modules
add_subdirectory(boot)
add_subdirectory(base)
add_subdirectory(dll)
add_subdirectory(drivers)
add_subdirectory(hal)
add_subdirectory(lib)
add_subdirectory(media)
add_subdirectory(modules)
add_subdirectory(ntoskrnl)
add_subdirectory(subsystems)
add_subdirectory(tools/wpp)
add_subdirectory(win32ss)
# Create the registry hives
create_registry_hives()
# Create {bootcd, livecd, bootcdregtest}.lst
create_iso_lists()
file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/include/reactos)
add_dependency_footer()
endif()

View File

@@ -1,12 +1,13 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +16,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@@ -55,8 +56,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -110,7 +111,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -168,7 +169,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +226,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -255,7 +256,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +278,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -291,7 +292,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
Copyright (C) 19yy <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -303,16 +304,16 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@@ -335,14 +336,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
ReactOS may be used, runtime linked, and distributed with non-free software
(meaning that such software has no obligations to open-source, or render
free, their non-free code) such as commercial device drivers and commercial
applications. This exception does not alter any other responsibilities of
the licensee under the GPL (meaning that such software must still obey
the GPL for the free ("open-sourced") code that has been integrated into
the said software).

View File

@@ -1,23 +0,0 @@
Copyright 2008 ReactOS Portable Systems Group. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and
the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the
distribution.
THIS SOFTWARE IS PROVIDED BY THE REACTOS PORTABLE SYSTEMS GROUP ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REACTOS PORTABLE SYSTEMS GROUP
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those of the authors and
should not be interpreted as representing official policies, either expressed or implied, of the ReactOS
Project.

View File

@@ -1,504 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -1,674 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -1,165 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -1,83 +1,41 @@
ReactOS is available thanks to the work of:
In no particular order
Aleksey Bragin <aleksey at reactos org>
Alex Ionescu <alex.ionescu@reactos.org>
Amine Khaldi <amine.khaldi@reactos.org>
Andrew Greenwood <lists@silverblade.co.uk>
Andrew Munger <waxdragon@gmail.com>
Arindam Das
Art Yerkes <ayerkes@speakeasy.net>
Boudewijn Dekker (Ariadne)
Brandon Turner <turnerb7@msu.edu>
Brian Palmer <brianp@sginet.com>
Cameron M. Gutman <cgutman@reactos.org>
Casper S. Hornstrup <chorns@users.sourceforge.net>
Christoph von Wittich <christoph_vw@reactos.org>
Colin Finck <colin@reactos.org>
Daniel Reimer <reimer.daniel@freenet.de>
David Welch <welch@cwcom.net>
Dmitry Chapyshev <dmitry@reactos.org>
Emanuele Aliberti <ea@iol.it>
Eric Kohl
Eugene Ingerman <geneing@myrealbox.com>
Filip Navara <xnavara@volny.cz>
Frederik Leemans
Ge van Geldorp <ge@gse.nl>
Ged Murphy <gedmurphy@reactos.org>
Gregor Brunmar <gregor brunmar at home se>
Gregor Schneider <grschneider@gmail.com>
Guido de Jong
Gunnar Andre' Dalsnes <hardon@online.no>
Hans Kremer
Hartmut Birr <hartmut.birr@gmx.de>
Hernan Ochoa
Herve Poussineau <hpoussin@reactos.com>
Iwan Fatahi <i_fatahi@hotmail.com>
James Tabor <james.tabor@reactos.org> <jimtabor.rosdev@gmail.com> <jamestabor_rosdev@yahoo.com>
Jason Eager
Jason Filby <jasonfilby@yahoo.com>
Jason Weiler
Jean Michault
Jeffrey Morlan <mrnobo1024@yahoo.com>
Jim Noeth
Johannes Anderwald <johannes.anderwald@reactos.org>
Jonathan Wilson <jonwil@tpgi.com.au>
Jurgen van Gael <jurgen.vangael@student.kuleuven.ac.be>
KJK::Hyperion <noog@libero.it>
Klemens R. Friedl <klemens_friedl@gmx.net>
Maarten Bosma <maarten.paul@bosma.de>
Magnus Olsen <magnus@greatlord.com>
Mark Tempel <mtempel@visi.com>
Mark Weaver <mark@npsl.co.uk>
Martin Fuchs <martin-fuchs@gmx.net>
Marty Dill <mdill@uvic.ca>
Matthias Kupfer <mkupfer@reactos.org>
Matt Pyne
Mike Nordell <"tamlin">
Nathan Woods <npwoods@mess.org>
Pablo Borobia <pborobia@gmail.com>
Paolo Pantaleo <paolopan@freemail.it>
Peter Ward <dralnix@gmail.com>
Pierre Schweitzer <pschweitzer@reactos.org>
Phillip Susi <phreak@iag.net>
Rafal Harabien <rafalh@reactos.org>
Rex Jolliff <rex@lvcablemodem.com>
Richard Campbell <betam4x@gmail.com>
Robert Bergkvist <fragdance@hotmail.com>
Robert Dickenson <robd@reactos.org>
Royce Mitchell III <royce3@ev1.net>
Samuel Serapi<70>n <samdwise51@gmail.com>
Saveliy Tretiakov <saveliyt@mail.ru>
Stefan Ginsberg <stefan.ginsberg@reactos.org>
Steven Edwards <winehacker@gmail.com>
Thomas Weidenmueller <w3seek@users.sourceforge.net>
Timo Kreuzer <timo.kreuzer@reactos.org>
Victor Kirhenshtein <sauros@iname.com>
Vizzini <vizzini@plasmic.com>
Rex Jolliff (rex@lvcablemodem.com)
Boudewijn Dekker (ariadne@xs4all.nl)
Eric Kohl (ekohl@rz-online.de)
Emanuele Aliberti (ea@iol.it)
David Welch (welch@cwcom.net)
Iwan Fatahi (i_fatahi@hotmail.com)
Robert Bergkvist (fragdance@hotmail.com)
Victor Kirhenshtein (sauros@iname.com)
Jason Filby (jasonfilby@yahoo.com)
Brian Palmer (brianp@sginet.com)
Phillip Susi (phreak@iag.net)
Paolo Pantaleo (paolopan@freemail.it)
Casper S. Hornstrup (chorns@users.sourceforge.net)
Source and inspiration from
Graphic Design from
WINE (http://www.winehq.com)
WinFree (http://www.stack.nl/~onno/win32/)
Linux (http://www.kernel.org)
References (Rex's at least)
Baker, Art. The Windows NT Device Driver Book. Prentice Hall, 1997.
Borate, Dabak & Phadke. Undocumented Windows NT. M&T Books, 1999.
Brain, Marshall. Win32 System Services. Prentice Hall, 1996.
Cant, Chris. Writing Windows WDM Device Drivers. R&D Books, 1999.
Canton & Sanchez. IBM Microcomputers: A Programmer's Handbook. McGraw Hill, 1990.
Davis & Wallace. Windows Undocumented File Formats. R&D Books, 1997.
Mason & Viscarola. Windows NT Device Driver Development. Macmillan, 1999.
Mitchell, Stan. Inside the Windows 95 File System. O'Reilly, 1997.
Murray, James D. Windows NT Event Logging. O'Reilly, 1998.
Nagar, Rajeev. Windows NT File System Internals. O'Reilly, 1997.
Osbourne, Sandra. Windows NT Registry: A Settings Reference. New Riders, 1998.
Pietrek, Matt. Windows 95 System Programming Secrets. IDG, 1995.
Richter, Jeffery. Advanced Windows, 3rd ed. Microsoft, 1997.
Simon, Richard J. Windows NT Win32 API Superbible. Waite Group, 1996.
Solomon, David A. Inside Windows NT, 2nd Ed. Microsoft, 1998.
"The NT Insider." Open Systems Resources, 1999-2000.
Mindflyer <mf@mufunyo.net>
Tango Desktop Project <http://tango-project.org>
Everaldo <http://everaldo.com>

1113
reactos/ChangeLog Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,93 +1,74 @@
1. Build environment
--------------------
To build the system it is strongly advised to use the ReactOS Build Environment
(RosBE). Up-to-date versions for Windows and for Unix/GNU-Linux are available
from our download page at: http://www.reactos.org/wiki/Build_Environment/
Alternatively one can use Microsoft Visual C++ (MSVC) version 2010+, together
with separate installations of CMake and the Ninja build utility.
To build the system you need either mingw32 installed on Windows or a mingw32
cross compiler running on unix.
2. Building ReactOS
-------------------
A throughout guide for how to build ReactOS can be found at:
http://www.reactos.org/wiki/Building_ReactOS
In the following we only make a quick overview.
2.1 Building the binaries
To build ReactOS run 'ninja' (without the quotes), or alternatively run
'make' if you are using the Make utility, from the top directory.
NOTE: In the other examples listed in the following, similar modification
holds if you are using the Make utility instead of Ninja.
If you are using RosBE, follow on-screen instructions.
2.2 Building a bootable CD image
To build a bootable CD image run 'ninja bootcd' (without the quotes) from the
top directory. This will create a CD image with a filename, ReactOS.iso, in
the top directory.
To build from Windows run 'make' (wihout the quotes) from the top directory.
To build from unix, edit rules.mak and change the PREFIX variable to the
correct value for your cross-compiler, then run 'make'.
3. Installation
---------------
ReactOS can only be installed on a machine that has a FAT16 or FAT32 partition
as the active (bootable) partition. The partition on which ReactOS is to be
installed (which may or may not be the bootable partition) must also be
formatted as FAT16 or FAT32. ReactOS Setup can format the partitions if
needed.
The system can only be installed on the first partition on the first harddisk.
The partition must be formatted as FAT16 or FAT32. The system can only be
started from DOS and not from a Windows DOS-prompt.
ReactOS can be installed from the source distribution or from the bootable CD
ReactOS can be installed from the source distribution or from the binary
distribution. The two ways to install ReactOS are explained below.
3.1 Installation from sources
If you don't have an existing ReactOS installation you want to upgrade, then
build a bootable CD as described above. Burn the CD image, boot from it, and
follow the instructions to install ReactOS.
To install ReactOS after building it, type 'make install'. This will create
the directory 'reactos' in the top directory. Copy this directory to the root
of your first partition on your first harddisk. This is usually c:\ on a
Windows machine.
If you have an existing ReactOS installation you want to upgrade, then to
install ReactOS after building it, type 'ninja install'. This will create
the directory 'reactos' in the top directory. Copy the contents of this
directory over the existing installation.
If you don't want to copy the files manually every time you run a 'make install',
you can specify the directory where the files are to be copied to during
installation.
If you don't want to copy the files manually every time you run a
'ninja install', then you can specify the directory where the files are
to be copied to during installation.
In rules.mak find the variable INSTALL_DIR and change the assigned value to the
name of the directory where the files are to be copied to. If you are using
Windows this could be:
Set the ROS_INSTALL environment variable. If you are on Windows this could be
done by:
INSTALL_DIR = c:\reactos
set ROS_INSTALL=c:\reactos
If you are on linux this could be:
If you are on Linux this could be done by:
INSTALL_DIR = /mnt/windows/reactos
export ROS_INSTALL=/mnt/windows/reactos
Now run 'ninja install' to install the files to the new location.
Save the changes to rules.mak and run 'make install' to install the files to
the new location.
3.2 Installation from bootable CD distribution
3.2 Installation from binany distribution
To install ReactOS from the bootable CD distribution, extract the archive
contents. Then burn the CD image, boot from it, and follow instructions.
To install ReactOS from the binary distribution, extract the archive contents
to c:\reactos. Remember to extract the files with full paths.
4. Help
-------
4. Booting ReactOS
Startup in DOS mode. 'cd' to c:\reactos and type 'boot' and press <enter>.
ReactOS will now boot and when it has booted, you are asked for a username and
password. Just press <enter> twice as ReactOS does not currently have user
validation. A simple shell is started where you can use simple commands like
'cd' and 'dir'.
You may also want to try running the enhanced shell, cmd.exe, found in
the rosapps CVS module.
5. Help
If you run into problems or have suggestions for making ReactOS better, please
visit the address below. Mailing lists are available for a variety of topics,
bugs should be submitted to JIRA and general chat takes place in the forums,
or #reactos on freenode.
surf to the address below and subscribe to one or more of the mailing lists.
http://www.reactos.org/
http://www.reactos.com/index.php?tab=discussion&section=lists
ReactOS Development Team

504
reactos/LGPL.txt Normal file
View File

@@ -0,0 +1,504 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

788
reactos/Makefile Normal file
View File

@@ -0,0 +1,788 @@
#
# Global makefile
#
PATH_TO_TOP = .
#
# Define to build WINE modules
#
ifeq ($(ROS_BUILD_WINE),)
ROS_BUILD_WINE = no
else
ROS_BUILD_WINE = yes
endif
include $(PATH_TO_TOP)/rules.mak
# Required to run the system
COMPONENTS = iface_native iface_additional hallib ntoskrnl
# Hardware Abstraction Layers
# halx86
HALS = halx86
# Bus drivers
# acpi isapnp pci
BUS = acpi isapnp pci
# User mode libraries
# advapi32 crtdll fmifs gdi32 kernel32 libpcap packet msafd msvcrt ntdll ole32
# oleaut32 psapi rpcrt4 secur32 shell32 user32 version ws2help ws2_32 wsock32 wshirda
DLLS = advapi32 crtdll fmifs gdi32 kernel32 packet msafd msvcrt ntdll \
secur32 user32 version winmm ws2help ws2_32 wshirda
SUBSYS = smss win32k csrss
#
# Select the server(s) you want to build
#
#SERVERS = posix linux os2
SERVERS = win32
# Boot loaders
# dos
LOADERS = dos
# Driver support libraries
#bzip2 zlib
DRIVERS_LIB = bzip2 zlib
# Kernel mode device drivers
# beep blue floppy ide keyboard mouse null parallel ramdrv serenum serial vga vidport
DEVICE_DRIVERS = beep blue floppy ide null serial vga vidport
# Kernel mode input drivers
# keyboard mouclass psaux sermouse
INPUT_DRIVERS = keyboard mouclass psaux
# Kernel mode file system drivers
# cdfs ext2 fs_rec ms np vfat
FS_DRIVERS = cdfs fs_rec ms np vfat mup ntfs
# Kernel mode networking drivers
# afd ndis packet tcpip tdi wshtcpip
NET_DRIVERS = afd ndis packet tcpip tdi wshtcpip
# Kernel mode networking device drivers
# ne2000
NET_DEVICE_DRIVERS = ne2000
# Kernel mode storage drivers
# atapi cdrom class2 disk scsiport
STORAGE_DRIVERS = atapi cdrom class2 disk scsiport
# System applications
# autochk lsass services shell winlogon
SYS_APPS = autochk services shell winlogon gstart usetup
# System services
# rpcss eventlog
SYS_SVC = rpcss eventlog
# Test applications
# alive apc args atomtest bench consume count dump_shared_data
# event file gditest hello isotest lpc mstest mutex nptest
# pteb regtest sectest shm simple thread vmtest winhello
TEST_APPS = alive apc args atomtest bench consume count dump_shared_data \
event file gditest hello isotest lpc mstest mutex nptest \
pteb regtest sectest shm simple thread tokentest vmtest winhello dibtest
# Test applications
# cabman cat net objdir partinfo pice ps stats
UTIL_APPS = cat objdir partinfo stats
#
# Win32 Subsystem support (Based on WINE)
# FIXME: Move to this its own Makefile
#
WINE_OTHER = unicode library
WINE_TOOLS = bin2res wrc winebuild
WINE_DLLS = comcat crtdll comctl32 commdlg dsound dplayx imagehlp ole32 richedit \
shlwapi shell32 shdocvw twain urlmon winspool \
rpcrt4 # needed to make rcprt4 implib
# mapi32 oleaut32 oledlg olepro32 olecli olesvr shfolder
# winmm ddraw dinput dplay serialui tapi32 urlmon wintrust
# msinfo lzexpand (missing imports)
WINE_PROGS = control expand osversioncheck regedit regsvr32 winver uninstaller
# (waiting on wrc fix for the rest of these)
# clock cmdlgtst notepad progman wcmd
# winefile winemine winetest uninstaller
ifeq ($(ROS_BUILD_WINE),yes)
WINE_MODULES = $(WINE_OTHER) $(WINE_TOOLS) $(WINE_DLLS) $(WINE_PROGS)
else
WINE_MODULES =
endif
KERNEL_DRIVERS = $(DRIVERS_LIB) $(DEVICE_DRIVERS) $(INPUT_DRIVERS) $(FS_DRIVERS) \
$(NET_DRIVERS) $(NET_DEVICE_DRIVERS) $(STORAGE_DRIVERS)
all: tools dk implib $(COMPONENTS) $(HALS) $(BUS) $(DLLS) $(SUBSYS) \
$(LOADERS) $(KERNEL_DRIVERS) $(SYS_APPS) $(SYS_SVC) $(TEST_APPS) \
$(UTIL_APPS) $(WINE_MODULES)
implib: $(COMPONENTS:%=%_implib) $(HALS:%=%_implib) $(BUS:%=%_implib) \
$(DLLS:%=%_implib) $(LOADERS:%=%_implib) \
$(KERNEL_DRIVERS:%=%_implib) $(SUBSYS:%=%_implib) \
$(SYS_APPS:%=%_implib) $(SYS_SVC:%=%_implib) \
$(TEST_APPS:%=%_implib) $(UTIL_APPS:%=%_implib) \
$(WINE_MODULES:%=%_implib)
clean: tools dk_clean $(HALS:%=%_clean) \
$(COMPONENTS:%=%_clean) $(BUS:%=%_clean) $(DLLS:%=%_clean) \
$(LOADERS:%=%_clean) $(KERNEL_DRIVERS:%=%_clean) $(SUBSYS:%=%_clean) \
$(SYS_APPS:%=%_clean) $(SYS_SVC:%=%_clean) $(TEST_APPS:%=%_clean) \
$(UTIL_APPS:%=%_clean) $(NET_APPS:%=%_clean) $(WINE_MODULES:%=%_clean) \
clean_after tools_clean
clean_after:
$(RM) $(PATH_TO_TOP)/include/roscfg.h
install: tools install_dirs install_before \
$(COMPONENTS:%=%_install) $(HALS:%=%_install) $(BUS:%=%_install) \
$(DLLS:%=%_install) $(LOADERS:%=%_install) \
$(KERNEL_DRIVERS:%=%_install) $(SUBSYS:%=%_install) \
$(SYS_APPS:%=%_install) $(SYS_SVC:%=%_install) \
$(TEST_APPS:%=%_install) $(UTIL_APPS:%=%_install) \
$(WINE_MODULES:%=%_install)
dist: $(TOOLS_PATH)/rcopy$(EXE_POSTFIX) dist_clean dist_dirs \
$(HALS:%=%_dist) $(COMPONENTS:%=%_dist) $(BUS:%=%_dist) $(DLLS:%=%_dist) \
$(LOADERS:%=%_dist) $(KERNEL_DRIVERS:%=%_dist) $(SUBSYS:%=%_dist) \
$(SYS_APPS:%=%_dist) $(SYS_SVC:%=%_dist) $(TEST_APPS:%=%_dist) \
$(UTIL_APPS:%=%_dist) $(NET_APPS:%=%_dist) $(WINE_MODULES:%=%_dist)
.PHONY: all implib clean clean_before install dist
#
# System Applications
#
$(SYS_APPS): %:
make -C subsys/system/$*
$(SYS_APPS:%=%_implib): %_implib:
make -C subsys/system/$* implib
$(SYS_APPS:%=%_clean): %_clean:
make -C subsys/system/$* clean
$(SYS_APPS:%=%_dist): %_dist:
make -C subsys/system/$* dist
$(SYS_APPS:%=%_install): %_install:
make -C subsys/system/$* install
.PHONY: $(SYS_APPS) $(SYS_APPS:%=%_implib) $(SYS_APPS:%=%_clean) $(SYS_APPS:%=%_install) $(SYS_APPS:%=%_dist)
#
# System Services
#
$(SYS_SVC): %:
make -C services/$*
$(SYS_SVC:%=%_implib): %_implib:
make -C services/$* implib
$(SYS_SVC:%=%_clean): %_clean:
make -C services/$* clean
$(SYS_SVC:%=%_dist): %_dist:
make -C services/$* dist
$(SYS_SVC:%=%_install): %_install:
make -C services/$* install
.PHONY: $(SYS_SVC) $(SYS_SVC:%=%_implib) $(SYS_SVC:%=%_clean) $(SYS_SVC:%=%_install) $(SYS_SVC:%=%_dist)
#
# Test Applications
#
$(TEST_APPS): %:
make -C apps/tests/$*
$(TEST_APPS:%=%_implib): %_implib:
make -C apps/tests/$* implib
$(TEST_APPS:%=%_clean): %_clean:
make -C apps/tests/$* clean
$(TEST_APPS:%=%_dist): %_dist:
make -C apps/tests/$* dist
$(TEST_APPS:%=%_install): %_install:
make -C apps/tests/$* install
.PHONY: $(TEST_APPS) $(TEST_APPS:%=%_implib) $(TEST_APPS:%=%_clean) $(TEST_APPS:%=%_install) $(TEST_APPS:%=%_dist)
#
# Utility Applications
#
$(UTIL_APPS): %:
make -C apps/utils/$*
$(UTIL_APPS:%=%_implib): %_implib:
make -C apps/utils/$* implib
$(UTIL_APPS:%=%_clean): %_clean:
make -C apps/utils/$* clean
$(UTIL_APPS:%=%_dist): %_dist:
make -C apps/utils/$* dist
$(UTIL_APPS:%=%_install): %_install:
make -C apps/utils/$* install
.PHONY: $(UTIL_APPS) $(UTIL_APPS:%=%_implib) $(UTIL_APPS:%=%_clean) $(UTIL_APPS:%=%_install) $(UTIL_APPS:%=%_dist)
#
# Other Wine Modules
#
$(WINE_OTHER): %:
make -f makefile.ros -C $(WINE_PATH)/$*
$(WINE_OTHER:%=%_implib): %_implib:
make -f makefile.ros -C $(WINE_PATH)/$* implib
$(WINE_OTHER:%=%_clean): %_clean:
make -f makefile.ros -C $(WINE_PATH)/$* clean
$(WINE_OTHER:%=%_dist): %_dist:
make -f makefile.ros -C $(WINE_PATH)/$* dist
$(WINE_OTHER:%=%_install): %_install:
make -f makefile.ros -C $(WINE_PATH)/$* install
.PHONY: $(WINE_OTHER) $(WINE_OTHER:%=%_implib) $(WINE_OTHER:%=%_clean) $(WINE_OTHER:%=%_install) $(WINE_OTHER:%=%_dist)
#
# Wine Tools
#
$(WINE_TOOLS): %:
make -f makefile.ros -C $(WINE_PATH)/tools/$*
$(WINE_TOOLS:%=%_implib): %_implib:
make -f makefile.ros -C $(WINE_PATH)/tools/$* implib
$(WINE_TOOLS:%=%_clean): %_clean:
make -f makefile.ros -C $(WINE_PATH)/tools/$* clean
$(WINE_TOOLS:%=%_dist): %_dist:
make -f makefile.ros -C $(WINE_PATH)/tools/$* dist
$(WINE_TOOLS:%=%_install): %_install:
make -f makefile.ros -C $(WINE_PATH)/tools/$* install
.PHONY: $(WINE_DLLS) $(WINE_DLLS:%=%_implib) $(WINE_DLLS:%=%_clean) $(WINE_DLLS:%=%_install) $(WINE_DLLS:%=%_dist)
#
# Wine DLLs
#
$(WINE_DLLS): %:
make -f makefile.ros -C $(WINE_PATH)/dlls/$*
$(WINE_DLLS:%=%_implib): %_implib:
make -f makefile.ros -C $(WINE_PATH)/dlls/$* implib
$(WINE_DLLS:%=%_clean): %_clean:
make -f makefile.ros -C $(WINE_PATH)/dlls/$* clean
$(WINE_DLLS:%=%_dist): %_dist:
make -f makefile.ros -C $(WINE_PATH)/dlls/$* dist
$(WINE_DLLS:%=%_install): %_install:
make -f makefile.ros -C $(WINE_PATH)/dlls/$* install
.PHONY: $(WINE_DLLS) $(WINE_DLLS:%=%_implib) $(WINE_DLLS:%=%_clean) $(WINE_DLLS:%=%_install) $(WINE_DLLS:%=%_dist)
#
# Wine programs
#
$(WINE_PROGS): %:
make -f makefile.ros -C $(WINE_PATH)/programs/$*
$(WINE_PROGS:%=%_implib): %_implib:
make -f makefile.ros -C $(WINE_PATH)/programs/$* implib
$(WINE_PROGS:%=%_clean): %_clean:
make -f makefile.ros -C $(WINE_PATH)/programs/$* clean
$(WINE_PROGS:%=%_dist): %_dist:
make -f makefile.ros -C $(WINE_PATH)/programs/$* dist
$(WINE_PROGS:%=%_install): %_install:
make -f makefile.ros -C $(WINE_PATH)/programs/$* install
.PHONY: $(WINE_PROGS) $(WINE_PROGS:%=%_implib) $(WINE_PROGS:%=%_clean) $(WINE_PROGS:%=%_install) $(WINE_PROGS:%=%_dist)
#
# Tools
#
tools:
make -C tools
tools_implib:
tools_clean:
make -C tools clean
tools_install:
tools_dist:
.PHONY: tools tools_implib tools_clean tools_install tools_dist
#
# Developer Kits
#
dk:
$(RMKDIR) $(DK_PATH)
$(RMKDIR) $(DDK_PATH)
$(RMKDIR) $(DDK_PATH_LIB)
$(RMKDIR) $(DDK_PATH_INC)
$(RMKDIR) $(SDK_PATH)
$(RMKDIR) $(SDK_PATH_LIB)
$(RMKDIR) $(SDK_PATH_INC)
$(RMKDIR) $(XDK_PATH)
$(RMKDIR) $(XDK_PATH_LIB)
$(RMKDIR) $(XDK_PATH_INC)
dk_implib:
# WARNING! Be very sure that there are no important files
# in these directories before cleaning them!!!
dk_clean:
$(RM) $(DDK_PATH_LIB)/*.a
# $(RM) $(DDK_PATH_INC)/*.h
$(RMDIR) $(DDK_PATH_LIB)
# $(RMDIR) $(DDK_PATH_INC)
$(RM) $(SDK_PATH_LIB)/*.a
# $(RM) $(SDK_PATH_INC)/*.h
$(RMDIR) $(SDK_PATH_LIB)
# $(RMDIR) $(SDK_PATH_INC)
$(RM) $(XDK_PATH_LIB)/*.a
# $(RM) $(XDK_PATH_INC)/*.h
$(RMDIR) $(XDK_PATH_LIB)
# $(RMDIR) $(XDK_PATH_INC)
dk_install:
dk_dist:
.PHONY: dk dk_implib dk_clean dk_install dk_dist
#
# Interfaces
#
iface_native:
make -C iface/native
iface_native_implib:
iface_native_clean:
make -C iface/native clean
iface_native_install:
iface_native_dist:
iface_additional:
make -C iface/addsys
iface_additional_implib:
iface_additional_clean:
make -C iface/addsys clean
iface_additional_install:
iface_additional_dist:
.PHONY: iface_native iface_native_implib iface_native_clean iface_native_install \
iface_native_dist \
iface_additional iface_additional_implib iface_additional_clean \
iface_additional_install iface_additional_dist
#
# Bus driver rules
#
$(BUS): %:
make -C drivers/bus/$*
$(BUS:%=%_implib): %_implib:
make -C drivers/bus/$* implib
$(BUS:%=%_clean): %_clean:
make -C drivers/bus/$* clean
$(BUS:%=%_install): %_install:
make -C drivers/bus/$* install
$(BUS:%=%_dist): %_dist:
make -C drivers/bus/$* dist
.PHONY: $(BUS) $(BUS:%=%_implib) $(BUS:%=%_clean) \
$(BUS:%=%_install) $(BUS:%=%_dist)
#
# Driver support libraries rules
#
$(DRIVERS_LIB): %:
make -C drivers/lib/$*
$(DRIVERS_LIB:%=%_implib): %_implib:
make -C drivers/lib/$* implib
$(DRIVERS_LIB:%=%_clean): %_clean:
make -C drivers/lib/$* clean
$(DRIVERS_LIB:%=%_install): %_install:
make -C drivers/lib/$* install
$(DRIVERS_LIB:%=%_dist): %_dist:
make -C drivers/lib/$* dist
.PHONY: $(DRIVERS_LIB) $(DRIVERS_LIB:%=%_implib) $(DRIVERS_LIB:%=%_clean) \
$(DRIVERS_LIB:%=%_install) $(DRIVERS_LIB:%=%_dist)
#
# Device driver rules
#
$(DEVICE_DRIVERS): %:
make -C drivers/dd/$*
$(DEVICE_DRIVERS:%=%_implib): %_implib:
make -C drivers/dd/$* implib
$(DEVICE_DRIVERS:%=%_clean): %_clean:
make -C drivers/dd/$* clean
$(DEVICE_DRIVERS:%=%_install): %_install:
make -C drivers/dd/$* install
$(DEVICE_DRIVERS:%=%_dist): %_dist:
make -C drivers/dd/$* dist
.PHONY: $(DEVICE_DRIVERS) $(DEVICE_DRIVERS:%=%_implib) $(DEVICE_DRIVERS:%=%_clean) \
$(DEVICE_DRIVERS:%=%_install) $(DEVICE_DRIVERS:%=%_dist)
#
# Input driver rules
#
$(INPUT_DRIVERS): %:
make -C drivers/input/$*
$(INPUT_DRIVERS:%=%_implib): %_implib:
make -C drivers/input/$* implib
$(INPUT_DRIVERS:%=%_clean): %_clean:
make -C drivers/input/$* clean
$(INPUT_DRIVERS:%=%_install): %_install:
make -C drivers/input/$* install
$(INPUT_DRIVERS:%=%_dist): %_dist:
make -C drivers/input/$* dist
.PHONY: $(INPUT_DRIVERS) $(INPUT_DRIVERS:%=%_implib) $(INPUT_DRIVERS:%=%_clean)\
$(INPUT_DRIVERS:%=%_install) $(INPUT_DRIVERS:%=%_dist)
$(FS_DRIVERS): %:
make -C drivers/fs/$*
$(FS_DRIVERS:%=%_implib): %_implib:
make -C drivers/fs/$* implib
$(FS_DRIVERS:%=%_clean): %_clean:
make -C drivers/fs/$* clean
$(FS_DRIVERS:%=%_install): %_install:
make -C drivers/fs/$* install
$(FS_DRIVERS:%=%_dist): %_dist:
make -C drivers/fs/$* dist
.PHONY: $(FS_DRIVERS) $(FS_DRIVERS:%=%_implib) $(FS_DRIVERS:%=%_clean) \
$(FS_DRIVERS:%=%_install) $(FS_DRIVERS:%=%_dist)
#
# Network driver rules
#
$(NET_DRIVERS): %:
make -C drivers/net/$*
$(NET_DRIVERS:%=%_implib): %_implib:
make -C drivers/net/$* implib
$(NET_DRIVERS:%=%_clean): %_clean:
make -C drivers/net/$* clean
$(NET_DRIVERS:%=%_install): %_install:
make -C drivers/net/$* install
$(NET_DRIVERS:%=%_dist): %_dist:
make -C drivers/net/$* dist
.PHONY: $(NET_DRIVERS) $(NET_DRIVERS:%=%_implib) $(NET_DRIVERS:%=%_clean) \
$(NET_DRIVERS:%=%_install) $(NET_DRIVERS:%=%_dist)
$(NET_DEVICE_DRIVERS): %:
make -C drivers/net/dd/$*
$(NET_DEVICE_DRIVERS:%=%_implib): %_implib:
make -C drivers/net/dd/$* implib
$(NET_DEVICE_DRIVERS:%=%_clean): %_clean:
make -C drivers/net/dd/$* clean
$(NET_DEVICE_DRIVERS:%=%_install): %_install:
make -C drivers/net/dd/$* install
$(NET_DEVICE_DRIVERS:%=%_dist): %_dist:
make -C drivers/net/dd/$* dist
.PHONY: $(NET_DEVICE_DRIVERS) $(NET_DEVICE_DRIVERS:%=%_clean) $(NET_DEVICE_DRIVERS:%=%_implib) \
$(NET_DEVICE_DRIVERS:%=%_install) $(NET_DEVICE_DRIVERS:%=%_dist)
#
# storage driver rules
#
$(STORAGE_DRIVERS): %:
make -C drivers/storage/$*
$(STORAGE_DRIVERS:%=%_implib): %_implib:
make -C drivers/storage/$* implib
$(STORAGE_DRIVERS:%=%_clean): %_clean:
make -C drivers/storage/$* clean
$(STORAGE_DRIVERS:%=%_install): %_install:
make -C drivers/storage/$* install
$(STORAGE_DRIVERS:%=%_dist): %_dist:
make -C drivers/storage/$* dist
.PHONY: $(STORAGE_DRIVERS) $(STORAGE_DRIVERS:%=%_clean) \
$(STORAGE_DRIVERS:%=%_install) $(STORAGE_DRIVERS:%=%_dist)
#
# Kernel loaders
#
$(LOADERS): %:
make -C loaders/$*
$(LOADERS:%=%_implib): %_implib:
$(LOADERS:%=%_clean): %_clean:
make -C loaders/$* clean
$(LOADERS:%=%_install): %_install:
make -C loaders/$* install
$(LOADERS:%=%_dist): %_dist:
make -C loaders/$* dist
.PHONY: $(LOADERS) $(LOADERS:%=%_implib) $(LOADERS:%=%_clean) $(LOADERS:%=%_install) \
$(LOADERS:%=%_dist)
#
# Required system components
#
ntoskrnl:
make -C ntoskrnl
ntoskrnl_implib:
make -C ntoskrnl implib
ntoskrnl_clean:
make -C ntoskrnl clean
ntoskrnl_install:
make -C ntoskrnl install
ntoskrnl_dist:
make -C ntoskrnl dist
.PHONY: ntoskrnl ntoskrnl_implib ntoskrnl_clean ntoskrnl_install ntoskrnl_dist
#
# Hardware Abstraction Layer import library
#
hallib:
make -C hal/hal
hallib_implib:
make -C hal/hal implib
hallib_clean:
make -C hal/hal clean
hallib_install:
make -C hal/hal install
hallib_dist:
make -C hal/hal dist
.PHONY: hallib hallib_implib hallib_clean hallib_install hallib_dist
#
# Hardware Abstraction Layers
#
$(HALS): %:
make -C hal/$*
$(HALS:%=%_implib): %_implib:
make -C hal/$* implib
$(HALS:%=%_clean): %_clean:
make -C hal/$* clean
$(HALS:%=%_install): %_install:
make -C hal/$* install
$(HALS:%=%_dist): %_dist:
make -C hal/$* dist
.PHONY: $(HALS) $(HALS:%=%_implib) $(HALS:%=%_clean) $(HALS:%=%_install) $(HALS:%=%_dist)
#
# Required DLLs
#
$(DLLS): %:
make -C lib/$*
$(DLLS:%=%_implib): %_implib:
make -C lib/$* implib
$(DLLS:%=%_clean): %_clean:
make -C lib/$* clean
$(DLLS:%=%_install): %_install:
make -C lib/$* install
$(DLLS:%=%_dist): %_dist:
make -C lib/$* dist
.PHONY: $(DLLS) $(DLLS:%=%_implib) $(DLLS:%=%_clean) $(DLLS:%=%_install) $(DLLS:%=%_dist)
#
# Subsystem support modules
#
$(SUBSYS): %:
make -C subsys/$*
$(SUBSYS:%=%_implib): %_implib:
make -C subsys/$* implib
$(SUBSYS:%=%_clean): %_clean:
make -C subsys/$* clean
$(SUBSYS:%=%_install): %_install:
make -C subsys/$* install
$(SUBSYS:%=%_dist): %_dist:
make -C subsys/$* dist
.PHONY: $(SUBSYS) $(SUBSYS:%=%_implib) $(SUBSYS:%=%_clean) $(SUBSYS:%=%_install) \
$(SUBSYS:%=%_dist)
#
# Create an installation
#
install_clean:
$(RM) $(INSTALL_DIR)/system32/drivers/*.*
$(RM) $(INSTALL_DIR)/system32/config/*.*
$(RM) $(INSTALL_DIR)/system32/*.*
$(RM) $(INSTALL_DIR)/symbols/*.*
$(RM) $(INSTALL_DIR)/media/fonts/*.*
$(RM) $(INSTALL_DIR)/media/*.*
$(RM) $(INSTALL_DIR)/bin/*.*
$(RM) $(INSTALL_DIR)/*.com
$(RM) $(INSTALL_DIR)/*.bat
$(RMDIR) $(INSTALL_DIR)/system32/drivers
$(RMDIR) $(INSTALL_DIR)/system32/config
$(RMDIR) $(INSTALL_DIR)/system32
$(RMDIR) $(INSTALL_DIR)/symbols
$(RMDIR) $(INSTALL_DIR)/media/fonts
$(RMDIR) $(INSTALL_DIR)/media
$(RMDIR) $(INSTALL_DIR)/bin
$(RMDIR) $(INSTALL_DIR)
install_dirs:
$(RMKDIR) $(INSTALL_DIR)
$(RMKDIR) $(INSTALL_DIR)/bin
$(RMKDIR) $(INSTALL_DIR)/media
$(RMKDIR) $(INSTALL_DIR)/media/fonts
$(RMKDIR) $(INSTALL_DIR)/symbols
$(RMKDIR) $(INSTALL_DIR)/system32
$(RMKDIR) $(INSTALL_DIR)/system32/config
$(RMKDIR) $(INSTALL_DIR)/system32/drivers
install_before:
$(CP) bootc.lst $(INSTALL_DIR)/bootc.lst
$(CP) boot.bat $(INSTALL_DIR)/boot.bat
$(CP) aboot.bat $(INSTALL_DIR)/aboot.bat
$(CP) system.hiv $(INSTALL_DIR)/system32/config/system.hiv
$(CP) media/fonts/helb____.ttf $(INSTALL_DIR)/media/fonts/helb____.ttf
$(CP) media/fonts/timr____.ttf $(INSTALL_DIR)/media/fonts/timr____.ttf
.PHONY: install_clean install_dirs install_before
#
# Make a distribution saveset
#
dist_clean:
$(RM) $(DIST_DIR)/symbols/*.sym
$(RM) $(DIST_DIR)/drivers/*.sys
$(RM) $(DIST_DIR)/subsys/*.exe
$(RM) $(DIST_DIR)/dlls/*.dll
$(RM) $(DIST_DIR)/apps/*.exe
$(RM) $(DIST_DIR)/*.exe
$(RMDIR) $(DIST_DIR)/symbols
$(RMDIR) $(DIST_DIR)/subsys
$(RMDIR) $(DIST_DIR)/drivers
$(RMDIR) $(DIST_DIR)/dlls
$(RMDIR) $(DIST_DIR)/apps
$(RMDIR) $(DIST_DIR)
dist_dirs:
$(RMKDIR) $(DIST_DIR)
$(RMKDIR) $(DIST_DIR)/apps
$(RMKDIR) $(DIST_DIR)/dlls
$(RMKDIR) $(DIST_DIR)/drivers
$(RMKDIR) $(DIST_DIR)/subsys
$(RMKDIR) $(DIST_DIR)/symbols
.PHONY: dist_clean dist_dirs
etags:
find . -name "*.[ch]" -print | etags --language=c -
# EOF

15
reactos/NEWS Normal file
View File

@@ -0,0 +1,15 @@
0.0.14: Converted to PE format
All system libraries are now dlls
0.0.13: Mostly bugfixes (I think)
0.0.12: Added support for multiple processes (not really tested)
System calls
kernel32 now compiles (only as a static library)
Fixed invalid tss bug (hopefully)
Added section support
Added some of the ZwxxxVirtual calls
Added prototype caching functions (only the Minix fsd actually
uses them)
Added handle access and type checking
Prototype APC implementation (no support for user APCs)

View File

@@ -1,10 +0,0 @@
# small trick to get the real source directory at this stage
STRING(REPLACE "/PreLoad.cmake" "" REACTOS_HOME_DIR ${CMAKE_CURRENT_LIST_FILE})
#message("/PreLoad.cmake ... ${REACTOS_HOME_DIR}")
SET(CMAKE_MODULE_PATH "${REACTOS_HOME_DIR}/cmake" CACHE INTERNAL "")
#message("CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}")

View File

@@ -1,32 +1,24 @@
========================
ReactOS<EFBFBD> Version 0.4.x
Updated January 5, 2016
========================
About Reactos
1. What is ReactOS?
-------------------
1. What is Reactos
ReactOS<EFBFBD> is an Open Source effort to develop a quality operating system that is
compatible with applications and drivers written for the Microsoft<66> Windows<77> NT
family of operating systems (NT4, 2000, XP, 2003, Vista, Seven).
A project aiming to make an approximate clone of Windows NT, compatible
with most Windows applications.
The ReactOS project, although currently focused on Windows Server 2003
compatibility, is always keeping an eye toward compatibility with
Windows Vista and future Windows NT releases.
The project has a website at http://www.reactos.com/
More information is available at: http://www.reactos.org
2. Building ReactOS
-------------------
2. Building Reactos
See the INSTALL file for more details.
3. More information
-------------------
See the media\doc subdirectory for some sparse notes.
See the doc subdirectory for some sparse notes
4. Who is responsible
---------------------
See the CREDITS file.
See the CREDITS file
5. Recent developments
See the NEWS file

3
reactos/aboot.bat Normal file
View File

@@ -0,0 +1,3 @@
loadros system32\ntoskrnl.exe system32\hal.dll system32\drivers\acpi.sys /DEBUGPORT=SCREEN bootc.lst
rem comment added and changed for no reason

View File

@@ -1,30 +0,0 @@
; Format:
; COMPONENT_NAME PATH_TO_COMPONENT_SOURCES
; COMPONENT_NAME - Name of the module. Eg. kernel32.
; PATH_TO_COMPONENT_SOURCES - Relative path to sources (relative to where rgenstat is run from).
advapi32 ../reactos/dll/win32/advapi32
crtdll ../reactos/dll/win32/crtdll
gdi32 ../reactos/dll/win32/gdi32
gdiplus ../reactos/dll/win32/gdiplus
iphlpapi ../reactos/dll/win32/iphlpapi
kernel32 ../reactos/dll/win32/kernel32
msvcrt ../reactos/dll/win32/msvcrt
rasapi32 ../reactos/dll/win32/rasapi32
rasdlg ../reactos/dll/win32/rasdlg
rasman ../reactos/dll/win32/rasman
rpcrt4 ../reactos/dll/win32/rpcrt4
secur32 ../reactos/dll/win32/secur32
snmpapi ../reactos/dll/win32/snmpapi
user32 ../reactos/dll/win32/user32
version ../reactos/dll/win32/version
winspool ../reactos/dll/win32/winspool
ws2_32 ../reactos/dll/win32/ws2_32
wsock32 ../reactos/dll/win32/wsock32
videoprt ../reactos/drivers/video/videoprt
ndis ../reactos/drivers/network/ndis
tdi ../reactos/drivers/network/tdi
scsiport ../reactos/drivers/storage/scsiport
ntoskrnl ../reactos/ntoskrnl
rtl ../reactos/lib/rtl
win32k ../reactos/subsystems/win32/win32k

View File

@@ -0,0 +1,21 @@
# $Id: Makefile,v 1.6 2002/06/02 19:24:57 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = alive
TARGET_SDKLIBS = kernel32.a user32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -1,3 +1,6 @@
/* $Id: alive.c,v 1.2 2001/03/26 21:30:20 ea Exp $
*
*/
#include <windows.h>
#include <stdlib.h>

View File

@@ -0,0 +1,85 @@
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <windows.h>
#include <ddk/ntddk.h>
HANDLE OutputHandle;
HANDLE InputHandle;
VOID STDCALL
ApcRoutine(PVOID Context,
PIO_STATUS_BLOCK IoStatus,
ULONG Reserved)
{
printf("(apc.exe) ApcRoutine(Context %p)\n", Context);
}
int main(int argc, char* argv[])
{
NTSTATUS Status;
HANDLE FileHandle;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING FileName = UNICODE_STRING_INITIALIZER(L"\\C:\\a.txt");
IO_STATUS_BLOCK IoStatus;
CHAR Buffer[256];
HANDLE EventHandle;
AllocConsole();
InputHandle = GetStdHandle(STD_INPUT_HANDLE);
OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
printf("APC test program\n");
EventHandle = CreateEventW(NULL,
FALSE,
FALSE,
NULL);
if (EventHandle == INVALID_HANDLE_VALUE)
{
printf("Failed to create event\n");
return 0;
}
printf("Opening file\n");
InitializeObjectAttributes(&ObjectAttributes,
&FileName,
0,
NULL,
NULL);
printf("Creating file\n");
FileHandle = CreateFileW(L"C:\\a.txt",
FILE_GENERIC_READ | FILE_GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
NULL);
if (FileHandle == INVALID_HANDLE_VALUE)
{
printf("Open failed\n");
return 0;
}
printf("Reading file\n");
Status = ZwReadFile(FileHandle,
NULL,
(PIO_APC_ROUTINE)ApcRoutine,
(PVOID)0xdeadbeef,
&IoStatus,
Buffer,
256,
NULL,
NULL);
if (!NT_SUCCESS(Status))
{
printf("Read failed\n");
}
printf("Waiting\n");
WaitForSingleObjectEx(EventHandle, INFINITE, TRUE);
printf("Returned from wait\n");
ZwClose(FileHandle);
printf("Program finished\n");
return 0;
}

View File

@@ -0,0 +1,21 @@
# $Id: makefile,v 1.9 2002/06/02 19:24:57 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = apc
TARGET_SDKLIBS = ntdll.a kernel32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,19 @@
# $Id: makefile,v 1.15 2002/06/02 19:24:57 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = args
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -1,9 +1,7 @@
#include <stdio.h>
#include <string.h>
#define WIN32_NO_STATUS
#include <windows.h>
#define NTOS_MODE_USER
#include <ndk/ntndk.h>
#include <ddk/ntddk.h>
#define BUFFER_SIZE 256

View File

@@ -0,0 +1,21 @@
# $Id: makefile,v 1.5 2002/06/02 19:24:57 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = atomtest
TARGET_SDKLIBS = ntdll.a kernel32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -1,8 +1,8 @@
/*
*
*
*/
int main(int argc, char* argv[])
{
}

View File

@@ -7,7 +7,7 @@
DWORD WINAPI
thread_main1(LPVOID param)
{
printf("Thread 1 running (Counter %lu)\n", PtrToUlong(param));
printf("Thread 1 running (Counter %lu)\n", (DWORD)param);
SleepEx(INFINITE, TRUE);
return 0;
}
@@ -16,7 +16,7 @@ thread_main1(LPVOID param)
DWORD WINAPI
thread_main2(LPVOID param)
{
printf("Thread 2 running (Counter %lu)\n", PtrToUlong(param));
printf("Thread 2 running (Counter %lu)\n", (DWORD)param);
Sleep(INFINITE);
return 0;
}
@@ -24,6 +24,7 @@ thread_main2(LPVOID param)
int main (void)
{
HANDLE hThread;
DWORD i=0;
DWORD id;
@@ -34,7 +35,7 @@ int main (void)
CreateThread(NULL,
0,
thread_main1,
(LPVOID)(ULONG_PTR)i,
(LPVOID)i,
0,
&id);
@@ -47,7 +48,7 @@ int main (void)
}
printf("All threads created...\n");
/*
* Waiting for threads is not implemented yet.
* If you want to see all threads running, uncomment the

View File

@@ -0,0 +1,21 @@
# $Id: makefile,v 1.10 2002/06/02 19:24:57 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = bench-thread
TARGET_SDKLIBS = kernel32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,138 @@
// ------------------------------------------------------------------
// Windows 2000 Graphics API Black Book
// Chapter 1 - Listing 1.3 (BitBlt Bitmap Rendering Demo)
//
// Created by Damon Chandler <dmc27@ee.cornell.edu>
// Updates can be downloaded at: <www.coriolis.com>
//
// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
// if you have any questions about this code.
// ------------------------------------------------------------------
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#include <windows.h>
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
HINSTANCE HInst;
const char* WndClassName = "GMainWnd";
LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
LPARAM LParam);
int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
HInst = HInstance;
WNDCLASS wc;
memset(&wc, 0, sizeof(WNDCLASS));
wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
wc.lpfnWndProc = MainWndProc;
wc.hInstance = HInstance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_BTNFACE + 1);
wc.lpszClassName = WndClassName;
if (RegisterClass(&wc))
{
HWND HWnd =
CreateWindow(
WndClassName, TEXT("BitBlt Bitmap Rendering Demo"),
WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION |
WS_VISIBLE | WS_CLIPSIBLINGS,
0, 0, 220, 230,
NULL, NULL, HInst, NULL
);
if (HWnd)
{
ShowWindow(HWnd, nCmdShow);
UpdateWindow(HWnd);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
return 0;
}
//------------------------------------------------------------------
// image related
BITMAP bmp;
LPCSTR filename = TEXT("lena.bmp");
HDC HMemDC = NULL;
HBITMAP HOldBmp = NULL;
LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
LPARAM LParam)
{
switch (Msg)
{
case WM_CREATE:
{
// create a memory DC
HMemDC = CreateCompatibleDC(NULL);
if (HMemDC)
{
// load a bitmap from file
HBITMAP HBmp =
static_cast<HBITMAP>(
LoadImage(HInst, filename, IMAGE_BITMAP,
0, 0, LR_LOADFROMFILE)
);
if (HBmp)
{
// extract dimensions of the bitmap
GetObject(HBmp, sizeof(BITMAP), &bmp);
// associate the bitmap with the memory DC
HOldBmp = static_cast<HBITMAP>(
SelectObject(HMemDC, HBmp)
);
}
}
}
case WM_PAINT:
{
PAINTSTRUCT ps;
const HDC Hdc = BeginPaint(HWnd, &ps);
try
{
//
// TODO: add palette support (see Chapter 9)...
//
BitBlt(Hdc, 20, 15,
bmp.bmWidth, bmp.bmHeight,
HMemDC, 0, 0,
SRCCOPY);
}
catch (...)
{
EndPaint(HWnd, &ps);
}
EndPaint(HWnd, &ps);
break;
}
case WM_DESTROY:
{
// clean up
DeleteObject(SelectObject(HMemDC, HOldBmp));
DeleteDC(HMemDC);
PostQuitMessage(0);
return 0;
}
}
return DefWindowProc(HWnd, Msg, WParam, LParam);
}
//------------------------------------------------------------------

View File

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 87 KiB

View File

@@ -0,0 +1,66 @@
# Makefile - Proj_Listing1_5.dsp
ifndef CFG
CFG=Proj_Listing1_5 - Win32 Debug
endif
CC=gcc
CFLAGS=
CXX=g++
CXXFLAGS=$(CFLAGS)
RC=windres -O COFF
ifeq "$(CFG)" "Proj_Listing1_5 - Win32 Release"
CFLAGS+=-fexceptions -O2 -DWIN32 -DNDEBUG -D_WINDOWS -D_MBCS -W
LD=$(CXX) $(CXXFLAGS)
LDFLAGS=
LDFLAGS+=-Wl,--subsystem,windows
LIBS+=-lkernel32 -luser32 -lgdi32
else
ifeq "$(CFG)" "Proj_Listing1_5 - Win32 Debug"
CFLAGS+=-fexceptions -g -O0 -DWIN32 -D_DEBUG -D_WINDOWS -D_MBCS -W
LD=$(CXX) $(CXXFLAGS)
LDFLAGS=
LDFLAGS+=-Wl,--subsystem,windows
LIBS+=-lkernel32 -luser32 -lgdi32
endif
endif
ifndef TARGET
TARGET=bitblt.exe
endif
.PHONY: all
all: $(TARGET)
%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $<
%.res: %.rc
$(RC) $(CPPFLAGS) -o $@ -i $<
SOURCE_FILES= \
bitblt.cpp
HEADER_FILES=
RESOURCE_FILES=
SRCS=$(SOURCE_FILES) $(HEADER_FILES) $(RESOURCE_FILES)
OBJS=$(patsubst %.rc,%.res,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(filter %.c %.cpp %.rc,$(SRCS)))))
$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
.PHONY: clean
clean:
-del $(OBJS) $(TARGET)
.PHONY: depends
depends:
-$(CXX) $(CXXFLAGS) $(CPPFLAGS) -MM $(filter %.c %.cpp,$(SRCS)) > Proj_Listing1_5.dep
-include Proj_Listing1_5.dep

View File

@@ -0,0 +1,19 @@
# $Id: Makefile,v 1.7 2002/06/02 19:24:57 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = consume
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -7,10 +7,10 @@
ULONG x[SIZE / 4096];
int main()
{
{
int i;
PUCHAR BaseAddress;
BaseAddress = VirtualAlloc(NULL,
SIZE,
MEM_COMMIT,
@@ -26,6 +26,6 @@ int main()
printf("%.8x ", i*4096);
x[i] = BaseAddress[i*4096];
}
return(0);
}

View File

@@ -0,0 +1,21 @@
# $Id: Makefile,v 1.6 2002/06/02 19:24:58 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = count
TARGET_SDKLIBS = kernel32.a user32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,15 @@
/* $Id: count.c,v 1.1 2001/03/26 21:30:20 ea Exp $
*
*/
#include <stdlib.h>
int n = 0;
int
main (int argc, char * argv [])
{
while (1) printf ("%d ", n ++ );
return (0);
}
/* EOF */

View File

@@ -0,0 +1,81 @@
#include <windows.h>
extern BOOL STDCALL GdiDllInitialize(HANDLE hInstance, DWORD Event, LPVOID Reserved);
void __stdcall Test1BPP (HDC Desktop)
{
HDC TestDC;
HPEN WhitePen;
HBITMAP DIB1;
BITMAPINFOHEADER BitInf;
PBITMAPINFO BitPalInf;
DWORD bmiSize = sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 2;
// Create a 1BPP DIB
BitPalInf = (PBITMAPINFO)malloc(bmiSize);
BitInf.biSize = sizeof(BITMAPINFOHEADER);
BitInf.biWidth = 50;
BitInf.biHeight = -50; // it's top down (since BI_RGB is used, the sign is operative of direction)
BitInf.biPlanes = 1;
BitInf.biBitCount = 1;
BitInf.biCompression = BI_RGB;
BitInf.biSizeImage = 0;
BitInf.biXPelsPerMeter = 0;
BitInf.biYPelsPerMeter = 0;
BitInf.biClrUsed = 0;
BitInf.biClrImportant = 0;
BitPalInf->bmiHeader = BitInf;
BitPalInf->bmiColors[1].rgbBlue = 255;
BitPalInf->bmiColors[1].rgbGreen = 255;
BitPalInf->bmiColors[1].rgbRed = 255;
BitPalInf->bmiColors[1].rgbReserved = 255;
BitPalInf->bmiColors[0].rgbBlue = 0;
BitPalInf->bmiColors[0].rgbGreen = 0;
BitPalInf->bmiColors[0].rgbRed = 0;
BitPalInf->bmiColors[0].rgbReserved = 0;
DIB1 = (HBITMAP) CreateDIBSection(NULL, BitPalInf, DIB_RGB_COLORS, NULL, NULL, 0);
TestDC = CreateCompatibleDC(NULL);
SelectObject(TestDC, DIB1);
// Draw a white rectangle on the 1BPP DIB
WhitePen = CreatePen(PS_SOLID, 1, RGB(255, 255, 255));
SelectObject(TestDC, WhitePen);
Rectangle(TestDC, 0, 0, 40, 40);
// Blt the 1BPP DIB to the display
BitBlt(Desktop, 0, 0, 50, 50, TestDC, 0, 0, SRCCOPY);
free(BitPalInf);
// Rectangle(Desktop, 50, 50, 200, 200);
}
void DIBTest(void)
{
HDC Desktop;
// Set up a DC called Desktop that accesses DISPLAY
Desktop = CreateDCA("DISPLAY", NULL, NULL, NULL);
if(Desktop == NULL) {
printf("Can't create desktop\n");
return;
}
// 1BPP Test
Test1BPP(Desktop);
Sleep(50000);
// Free up everything
DeleteDC(Desktop);
}
int main(int argc, char* argv[])
{
printf("Entering DIBTest..\n");
GdiDllInitialize (NULL, DLL_PROCESS_ATTACH, NULL);
DIBTest();
return 0;
}

View File

@@ -0,0 +1,21 @@
# $Id: makefile,v 1.1 2002/09/22 20:09:01 jfilby Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = dibtest
TARGET_SDKLIBS = kernel32.a gdi32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,51 @@
#include <stdio.h>
#include <ntddk.h>
int main()
{
int i;
printf("TickCountLow: %x\n",
SharedUserData->TickCountLow);
printf("Drives: ");
for (i = 0; i < 26; i++)
{
printf("%c", (SharedUserData->DosDeviceMap & (1 << i))?'1':'0');
}
printf("\n");
for (i = 0; i < 26; i++)
{
if (SharedUserData->DosDeviceMap & (1 << i))
{
printf("%c: ", 'A'+i);
switch(SharedUserData->DosDeviceDriveType[i])
{
case DOSDEVICE_DRIVE_UNKNOWN:
printf("Unknown\n");
break;
case DOSDEVICE_DRIVE_CALCULATE:
printf("No root\n");
break;
case DOSDEVICE_DRIVE_REMOVABLE:
printf("Removable\n");
break;
case DOSDEVICE_DRIVE_FIXED:
printf("Fixed\n");
break;
case DOSDEVICE_DRIVE_REMOTE:
printf("Remote\n");
break;
case DOSDEVICE_DRIVE_CDROM:
printf("CD-ROM\n");
break;
case DOSDEVICE_DRIVE_RAMDISK:
printf("Ram disk\n");
break;
default:
printf("undefined type\n");
break;
}
}
}
printf("\n\n");
}

View File

@@ -0,0 +1,20 @@
# $Id: makefile,v 1.6 2002/06/02 19:24:58 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = dump_shared_data
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,21 @@
# $Id: makefile,v 1.7 2002/06/02 19:24:58 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = event
TARGET_SDKLIBS = kernel32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,19 @@
# $Id: Makefile,v 1.8 2002/06/02 19:24:58 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = file
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,54 @@
/***********************************************************
* File read/write test utility *
**********************************************************/
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
int main( void )
{
HANDLE file;
char buffer[4096];
DWORD wrote;
int c;
file = CreateFile("test.dat",
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
CREATE_ALWAYS,
0,
0);
if (file == INVALID_HANDLE_VALUE)
{
printf("Error opening file (Status %x)\n", GetLastError());
return 1;
}
for( c = 0; c < sizeof( buffer ); c++ )
buffer[c] = (char)c;
printf("Writing file\n");
if (WriteFile( file, buffer, 4096, &wrote, NULL) == FALSE)
{
printf("Error writing file (Status %x)\n", GetLastError());
exit(2);
}
printf("Reading file\n");
SetFilePointer( file, 0, 0, FILE_BEGIN );
if (ReadFile( file, buffer, 4096, &wrote, NULL) == FALSE)
{
printf("Error reading file (Status %x)\n", GetLastError());
exit(3);
}
for( c = 0; c < sizeof( buffer ); c++ )
if( buffer[c] != (char)c )
{
printf( "Error: data read back is not what was written\n" );
CloseHandle( file );
return 0;
}
printf("Finished, works fine\n");
CloseHandle( file );
return 0;
}

View File

@@ -0,0 +1,344 @@
/*
* gditest
dec 26, 2001 -- gditest bug fix by Richard Campbell
*/
#include <windows.h>
extern BOOL STDCALL GdiDllInitialize(HANDLE hInstance, DWORD Event, LPVOID Reserved);
void __stdcall Background (HDC Desktop)
{
HPEN Pen;
int x, y;
Pen = CreatePen(PS_SOLID, 1, RGB(64, 64, 128));
SelectObject (Desktop, Pen);
MoveToEx (Desktop, 0, 0, NULL);
LineTo (Desktop, 640, 480);
for (y = 479, x = 0; x < 640; x+=42)
{
MoveToEx (Desktop, 0, 0, NULL);
LineTo (Desktop, x, y);
}
for (y = 0, x = 639; y < 480; y+=42)
{
MoveToEx (Desktop, 0, 0, NULL);
LineTo (Desktop, x, y);
}
}
void gditest( void ){
HDC Desktop, MyDC, DC24;
HPEN RedPen, GreenPen, BluePen, WhitePen;
HBITMAP MyBitmap, DIB24;
HFONT hf, tf;
BITMAPINFOHEADER BitInf;
BITMAPINFO BitPalInf;
HRGN hRgn1, hRgn2, hRgn3;
HBRUSH BlueBrush, DefBrush;
// Set up a DC called Desktop that accesses DISPLAY
Desktop = CreateDCA("DISPLAY", NULL, NULL, NULL);
if (Desktop == NULL){
printf("Can't create desktop\n");
return;
}
// Background
Background (Desktop);
//ei
BlueBrush = CreateSolidBrush( RGB(0, 0, 0xff) );
DefBrush = SelectObject( Desktop, BlueBrush );
hRgn1 = CreateRectRgn( 1, 2, 100, 101 );
hRgn2 = CreateRectRgn( 10, 20, 150, 151 );
hRgn3 = CreateRectRgn( 1, 1, 1, 1);
CombineRgn( hRgn3, hRgn1, hRgn2, RGN_XOR );
PaintRgn( Desktop, hRgn3 );
SelectObject( Desktop, DefBrush );
DeleteObject( BlueBrush );
// Create a blue pen and select it into the DC
BluePen = CreatePen(PS_SOLID, 8, RGB(0, 0, 0xff));
SelectObject(Desktop, BluePen);
// Draw a shape on the DC
MoveToEx(Desktop, 50, 50, NULL);
LineTo(Desktop, 200, 60);
LineTo(Desktop, 200, 300);
LineTo(Desktop, 50, 50);
MoveToEx(Desktop, 50, 50, NULL);
LineTo(Desktop, 200, 50);
WhitePen = CreatePen(PS_SOLID, 3, RGB(0xff, 0xff, 0xff));
SelectObject(Desktop, WhitePen);
MoveToEx(Desktop, 20, 70, NULL);
LineTo(Desktop, 500, 70);
MoveToEx(Desktop, 70, 20, NULL);
LineTo(Desktop, 70, 150);
// Test font support
GreenPen = CreatePen(PS_SOLID, 3, RGB(0, 0xff, 0));
RedPen = CreatePen(PS_SOLID, 3, RGB(0xff, 0, 0));
hf = CreateFontA(24, 0, 0, TA_BASELINE, FW_NORMAL, FALSE, FALSE, FALSE,
ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY, FIXED_PITCH|FF_DONTCARE, "Helmet");
SelectObject(Desktop, hf);
SetTextColor(Desktop, RGB(0xff, 0, 0));
TextOutA(Desktop, 70, 70, "React", 5);
SetTextColor(Desktop, RGB(0, 0xff, 0));
TextOutA(Desktop, 140, 70, "OS", 2);
tf = CreateFontA(14, 0, 0, TA_BASELINE, FW_NORMAL, FALSE, FALSE, FALSE,
ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
DEFAULT_QUALITY, FIXED_PITCH|FF_DONTCARE, "Timmons");
SelectObject(Desktop, tf);
SetTextColor(Desktop, RGB(0xff, 0xff, 0xff));
TextOutA(Desktop, 70, 90, "This is a test of ReactOS text, using the FreeType 2 library!", 61);
// TEST 1: Copy from the VGA into a device compatible DC, draw on it, then blt it to the VGA again
MyDC = CreateCompatibleDC(Desktop);
MyBitmap = CreateCompatibleBitmap(Desktop, 151, 251);
SelectObject(MyDC, MyBitmap);
BitBlt(MyDC, 0, 0, 151, 251, Desktop, 50, 50, SRCCOPY); // can we say 151, 251 since bottom corner is not inclusive?
SelectObject(MyDC, GreenPen);
Rectangle(MyDC, 10, 10, 50, 50);
// TEST 2: Copy from the device compatible DC into a 24BPP bitmap, draw on it, then blt to the VGA again
BitInf.biSize = sizeof(BITMAPINFOHEADER);
BitInf.biWidth = 152;
BitInf.biHeight = -252; // it's top down (since BI_RGB is used, the sign is operative of direction)
BitInf.biPlanes = 1;
BitInf.biBitCount = 24;
BitInf.biCompression = BI_RGB;
BitInf.biSizeImage = 0;
BitInf.biXPelsPerMeter = 0;
BitInf.biYPelsPerMeter = 0;
BitInf.biClrUsed = 0;
BitInf.biClrImportant = 0;
BitPalInf.bmiHeader = BitInf;
DIB24 = (HBITMAP) CreateDIBSection(NULL, &BitPalInf, DIB_RGB_COLORS, NULL, NULL, 0);
DC24 = CreateCompatibleDC(NULL);
SelectObject(DC24, DIB24);
BitBlt(DC24, 0, 0, 101, 201, MyDC, 0, 0, SRCCOPY);
SelectObject(DC24, RedPen);
Rectangle(DC24, 80, 90, 100, 110);
MoveToEx(DC24, 80, 90, NULL);
LineTo(DC24, 100, 110);
BitBlt(Desktop, 200, 200, 110, 120, DC24, 0, 0, SRCCOPY);
Sleep( 10000 ); // fixme delay only 10000 (for 10 seconds)
// Free up everything
DeleteDC(Desktop);
DeleteDC(MyDC);
}
void DumpRgnData( HRGN hRgn )
{
int size, ret, i;
LPRGNDATA rgnData;
size = GetRegionData( hRgn, 0, NULL );
if( size == 0 ){
printf("GetRegionData returned 0\n");
return;
}
rgnData = (LPRGNDATA) malloc( size );
ret = GetRegionData( hRgn, size, rgnData );
if( ret == 0 ){
printf("GetRegionData( hRgn, size, rgnData ) returned 0\n");
return;
}
printf("Bounds: left=%d top=%d right=%d bottom=%d, count: %d, type: %i\n\n",
rgnData->rdh.rcBound.left, rgnData->rdh.rcBound.top, rgnData->rdh.rcBound.right, rgnData->rdh.rcBound.bottom,
rgnData->rdh.nCount, rgnData->rdh.iType);
printf("Rects:\t i \t left \t top \t right \t bottom\n");
for ( i = 0; i < rgnData->rdh.nCount; i++ ) {
PRECT pr = (PRECT) rgnData->Buffer + i;
printf("\t %d \t %d \t %d \t %d \t %d\n", i, pr->left, pr->top, pr->right, pr->bottom );
}
printf("\n");
}
void rgntest( void )
{
HRGN hRgn1, hRgn2, hRgn3;
RECT Rect;
int i;
hRgn1 = CreateRectRgn( 1, 2, 100, 101 );
if( hRgn1 == NULL ) {
printf("Failed at hRgn1 = CreateRectRgn( 1, 2, 100, 101 )\n");
return;
}
i = GetRgnBox( hRgn1, &Rect );
if( i==0 ){
printf("Failed GetRgnBox( hRgn1, &Rect )\n");
return;
}
printf("GetRgnBox( hRgn1, &Rect ): i=%d, left=%d top=%d right=%d bottom=%d\n\n",
i, Rect.left, Rect.top, Rect.right, Rect.bottom );
DumpRgnData( hRgn1 );
hRgn2 = CreateRectRgn( 51, 53, 150, 152 );
if( hRgn2 == NULL ) {
printf("Failed at hRgn2 = CreateRectRgn( 51, 53, 150, 152 )\n");
return;
}
i = GetRgnBox( hRgn2, &Rect );
if( i==0 ){
printf("Failed GetRgnBox( hRgn2, &Rect )\n");
return;
}
printf("GetRgnBox( hRgn2, &Rect ): i=%d, left=%d top=%d right=%d bottom=%d\n\n",
i, Rect.left, Rect.top, Rect.right, Rect.bottom );
DumpRgnData( hRgn2 );
if( EqualRgn( hRgn1, hRgn2 ) == TRUE ){
printf("\t hRgn1, hRgn2 are equal\n");
}
else{
printf("\t hRgn1, hRgn2 are NOT equal\n\n");
}
i = OffsetRgn(hRgn1,50,51);
if( i==ERROR ){
printf("Failed OffsetRgn(hRgn1,50,51)\n");
return;
}
i = GetRgnBox( hRgn1, &Rect );
if( i==0 ){
printf("Failed GetRgnBox( hRgn1, &Rect )\n");
return;
}
printf("After offset\nGetRgnBox( hRgn1, &Rect ): i=%d, left=%d top=%d right=%d bottom=%d\n\n",
i, Rect.left, Rect.top, Rect.right, Rect.bottom );
if( EqualRgn( hRgn1, hRgn2 ) == TRUE ){
printf("\t hRgn1, hRgn2 are equal after offset\n");
}
else{
printf("\t hRgn1, hRgn2 are NOT equal after offset!\n\n");
}
i = SetRectRgn(hRgn1, 10, 11, 110, 111 );
if( i==0 ){
printf("Failed SetRectRgn(hRgn1... )\n");
return;
}
i = GetRgnBox( hRgn1, &Rect );
if( i==0 ){
printf("Failed GetRgnBox( hRgn1, &Rect )\n");
return;
}
printf("after SetRectRgn(hRgn1, 10, 11, 110, 111 ):\n i=%d, left=%d top=%d right=%d bottom=%d\n\n",
i, Rect.left, Rect.top, Rect.right, Rect.bottom );
hRgn3 = CreateRectRgn( 1, 1, 1, 1);
i = CombineRgn( hRgn3, hRgn1, hRgn2, RGN_AND );
if( i==ERROR ){
printf("Fail: CombineRgn( hRgn3, hRgn1, hRgn2, RGN_AND ). LastError: %d\n", GetLastError);
return;
}
if( GetRgnBox( hRgn3, &Rect )==0 ){
printf("Failed GetRgnBox( hRgn1, &Rect )\n");
return;
}
printf("After CombineRgn( hRgn3, hRgn1, hRgn2, RGN_AND ): \nGetRgnBox( hRgn3, &Rect ): CR_i=%d, left=%d top=%d right=%d bottom=%d\n\n",
i, Rect.left, Rect.top, Rect.right, Rect.bottom );
DumpRgnData( hRgn3 );
i = CombineRgn( hRgn3, hRgn1, hRgn2, RGN_OR );
if( i==ERROR ){
printf("Fail: CombineRgn( hRgn3, hRgn1, hRgn2, RGN_OR ). LastError: %d\n", GetLastError);
return;
}
if( GetRgnBox( hRgn3, &Rect )==0 ){
printf("Failed GetRgnBox( hRgn1, &Rect )\n");
return;
}
printf("After CombineRgn( hRgn3, hRgn1, hRgn2, RGN_OR ): \nGetRgnBox( hRgn3, &Rect ): CR_i=%d, left=%d top=%d right=%d bottom=%d\n\n",
i, Rect.left, Rect.top, Rect.right, Rect.bottom );
DumpRgnData( hRgn3 );
i = CombineRgn( hRgn3, hRgn1, hRgn2, RGN_DIFF );
if( i==ERROR ){
printf("Fail: CombineRgn( hRgn3, hRgn1, hRgn2, RGN_DIFF ). LastError: %d\n", GetLastError);
return;
}
if( GetRgnBox( hRgn3, &Rect )==0 ){
printf("Failed GetRgnBox( hRgn1, &Rect )\n");
return;
}
printf("After CombineRgn( hRgn3, hRgn1, hRgn2, RGN_DIFF ): \nGetRgnBox( hRgn3, &Rect ): CR_i=%d, left=%d top=%d right=%d bottom=%d\n\n",
i, Rect.left, Rect.top, Rect.right, Rect.bottom );
DumpRgnData( hRgn3 );
i = CombineRgn( hRgn3, hRgn1, hRgn2, RGN_XOR );
if( i==ERROR ){
printf("Fail: CombineRgn( hRgn3, hRgn1, hRgn2, RGN_XOR ). LastError: %d\n", GetLastError);
return;
}
if( GetRgnBox( hRgn3, &Rect )==0 ){
printf("Failed GetRgnBox( hRgn3, &Rect )\n");
return;
}
printf("After CombineRgn( hRgn3, hRgn1, hRgn2, RGN_XOR ): \nGetRgnBox( hRgn3, &Rect ): CR_i=%d, left=%d top=%d right=%d bottom=%d\n\n",
i, Rect.left, Rect.top, Rect.right, Rect.bottom );
DumpRgnData( hRgn3 );
i = CombineRgn( hRgn1, hRgn3, hRgn2, RGN_COPY );
if( i==ERROR ){
printf("Fail: CombineRgn( hRgn1, hRgn3, hRgn2, RGN_COPY ). LastError: %d\n", GetLastError);
return;
}
if( GetRgnBox( hRgn1, &Rect )==0 ){
printf("Failed GetRgnBox( hRgn1, &Rect )\n");
return;
}
printf("After CombineRgn( hRgn1, hRgn3, hRgn2, RGN_COPY ): \nGetRgnBox( hRgn1, &Rect ): CR_i=%d, left=%d top=%d right=%d bottom=%d\n\n",
i, Rect.left, Rect.top, Rect.right, Rect.bottom );
DumpRgnData( hRgn1 );
DeleteObject( hRgn1 );
DeleteObject( hRgn2 );
DeleteObject( hRgn3 );
printf("region test finished\n");
}
int main (int argc, char* argv[])
{
printf("Entering GDITest..\n");
printf("use gditest for older tests\n");
printf("use gditest 1 for region test\n");
GdiDllInitialize (NULL, DLL_PROCESS_ATTACH, NULL);
if( argc < 2 )
gditest();
else {
if( !strncmp( argv[1], "1", 1 ) ) {
rgntest();
}
}
return 0;
}

View File

@@ -0,0 +1,21 @@
# $Id: makefile,v 1.8 2002/06/02 19:24:58 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = gditest
TARGET_SDKLIBS = kernel32.a gdi32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,8 @@
#include <stdio.h>
#include <string.h>
int main(int argc, char* argv[])
{
printf("Hello world\n");
return(0);
}

View File

@@ -0,0 +1,19 @@
# $Id: makefile,v 1.16 2002/06/02 19:24:59 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = hello
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -2,16 +2,10 @@
* isotest - display cdrom information
*/
#define WIN32_NO_STATUS
#include <windows.h>
#define NTOS_MODE_USER
#include <ndk/ntndk.h>
//#include <winioctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <wchar.h>
void HexDump(char *buffer, ULONG size)
@@ -21,7 +15,7 @@ void HexDump(char *buffer, ULONG size)
while (offset < (size & ~15))
{
ptr = (unsigned char*)((ULONG_PTR)buffer + offset);
ptr = (unsigned char*)((ULONG)buffer + offset);
printf("%08lx %02hx %02hx %02hx %02hx %02hx %02hx %02hx %02hx-%02hx %02hx %02hx %02hx %02hx %02hx %02hx %02hx",
offset,
ptr[0],
@@ -62,7 +56,7 @@ void HexDump(char *buffer, ULONG size)
offset += 16;
}
ptr = (unsigned char*)((ULONG_PTR)buffer + offset);
ptr = (unsigned char*)((ULONG)buffer + offset);
if (offset < size)
{
printf("%08lx ", offset);
@@ -144,6 +138,7 @@ int main (int argc, char *argv[])
{
HANDLE hDisk;
DWORD dwRead;
DWORD i;
char *Buffer;
CHAR Filename[80];
LARGE_INTEGER FilePosition;

View File

@@ -0,0 +1,23 @@
# $Id: makefile,v 1.2 2002/06/02 19:24:59 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = isotest
#TARGET_CFLAGS = -fnative_struct
TARGET_SDKLIBS = ntdll.a kernel32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -1,11 +1,12 @@
/*
/* $Id: conport.c,v 1.6 2000/04/25 23:22:46 ea Exp $
*
* reactos/apps/lpc/conport.c
*
* To be run in a real WNT 4.0 system with
* "\SmApiPort" as argument. Do not try to
* connect to "\Windows\ApiPort" since that
* reboots immeditely.
*
*
* Use Russinovich' HandleEx to verify
* conport.exe owns two unnamed LPC ports:
* the one created by kernel32.dll connecting
@@ -30,7 +31,7 @@
#define LPC_CONNECT_FLAG5 0x00010000
NTSTATUS
(WINAPI * ConnectPort)(
(STDCALL * ConnectPort)(
OUT PHANDLE PortHandle,
IN PUNICODE_STRING PortName,
IN POBJECT_ATTRIBUTES ObjectAttributes,
@@ -42,16 +43,16 @@ NTSTATUS
);
NTSTATUS
(WINAPI * QueryObject)(
(STDCALL * QueryObject)(
IN HANDLE ObjectHandle,
IN CINT ObjectInformationClass,
OUT PVOID ObjectInformation,
IN ULONG Length,
OUT PULONG ResultLength
);
NTSTATUS
(WINAPI * YieldExecution)(VOID);
(STDCALL * YieldExecution)(VOID);
#define BUF_SIZE 1024
#define MAXARG 1000000

View File

@@ -1,9 +1,10 @@
/*
/* $Id: creport.c,v 1.2 1999/07/17 23:10:12 ea Exp $
*
* reactos/apps/lpc/creport.c
*
* To be run in a real WNT 4.0 system to
* create an LPC named port.
*
*
* Use Russinovich' HandleEx to verify
* creport.exe owns the named LPC port
* you asked to create.
@@ -22,26 +23,26 @@
#define LPC_CONNECT_FLAG5 0x00010000
NTSTATUS
(WINAPI * CreatePort)(
(STDCALL * CreatePort)(
/*OUT PHANDLE PortHandle,*/
PVOID Buffer,
IN POBJECT_ATTRIBUTES PortAttributes OPTIONAL,
IN POBJECT_ATTRIBUTES PortAttributes OPTIONAL,
IN ACCESS_MASK DesiredAccess,
IN DWORD Unknown3,
IN ULONG Flags
);
NTSTATUS
(WINAPI * QueryObject)(
(STDCALL * QueryObject)(
IN HANDLE ObjectHandle,
IN CINT ObjectInformationClass,
OUT PVOID ObjectInformation,
IN ULONG Length,
OUT PULONG ResultLength
);
NTSTATUS
(WINAPI * YieldExecution)(VOID);
(STDCALL * YieldExecution)(VOID);
#define BUF_SIZE 1024
#define MAXARG 5000000

View File

@@ -1,4 +1,5 @@
/*
/* $Id: dumpinfo.c,v 1.2 1999/07/17 23:10:12 ea Exp $
*
* reactos/apps/lpc/dumpinfo.c
*
* ReactOS Operating System
@@ -11,7 +12,7 @@
* Added code to find the basic information buffer size
* for the LPC port object.
* 19990710 (EA)
*
*
*/
#include <windows.h>
#include <stdio.h>
@@ -24,7 +25,7 @@
extern
NTSTATUS
(WINAPI * QueryObject)(
(STDCALL * QueryObject)(
IN HANDLE ObjectHandle,
IN CINT ObjectInformationClass,
OUT PVOID ObjectInformation,
@@ -34,7 +35,7 @@ NTSTATUS
extern
NTSTATUS
(WINAPI * QueryInformationPort)(
(STDCALL * QueryInformationPort)(
IN HANDLE PortHandle,
IN CINT PortInformationClass, /* guess */
OUT PVOID PortInformation, /* guess */
@@ -76,7 +77,7 @@ DumpInfo (
{
BYTE ObjectInformation [BUF_SIZE] = {0};
ULONG ResultLength;
wprintf(
L"Port \"%s\" %s:\n",
Name,
@@ -101,7 +102,7 @@ DumpInfo (
PLPC_PORT_BASIC_INFORMATION i;
i = (PLPC_PORT_BASIC_INFORMATION) ObjectInformation;
printf( "\tUnknown01 = 0x%08X\n", i->Unknown0 );
printf( "\tUnknown02 = 0x%08X\n", i->Unknown1 );
printf( "\tUnknown03 = 0x%08X\n", i->Unknown2 );
@@ -134,7 +135,7 @@ DumpInfo (
OBJECT_TYPE_INFORMATION * i;
i = (OBJECT_TYPE_INFORMATION *) ObjectInformation;
wprintf(
L"\tName: \"%s\"\n",
(i->Name.Length ? i->Name.Buffer : L"")

View File

@@ -1,10 +1,11 @@
/*
/* $Id: lpcclt.c,v 1.12 2002/11/03 20:01:04 chorns Exp $
*
* DESCRIPTION: Simple LPC Client
* PROGRAMMER: David Welch
*/
#include <ddk/ntddk.h>
#include <rosrtl/string.h>
#include <windows.h>
#include <napi/lpc.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
@@ -30,16 +31,16 @@ void debug_printf(char* fmt, ...)
int main(int argc, char* argv[])
{
UNICODE_STRING PortName = ROS_STRING_INITIALIZER(TEST_PORT_NAME_U);
UNICODE_STRING PortName = UNICODE_STRING_INITIALIZER(TEST_PORT_NAME_U);
NTSTATUS Status;
HANDLE PortHandle;
LPC_MAX_MESSAGE Request;
ULONG ConnectInfo;
ULONG ConnectInfoLength = 0;
SECURITY_QUALITY_OF_SERVICE Sqos;
printf("%s: Lpc test client\n", MyName);
printf("%s: Connecting to port \"%s\"...\n", MyName, TEST_PORT_NAME);
ConnectInfoLength = 0;
ZeroMemory (& Sqos, sizeof Sqos);
@@ -62,24 +63,24 @@ int main(int argc, char* argv[])
ZeroMemory(& Request, sizeof Request);
strcpy(Request.Data, GetCommandLineA());
Request.Header.DataSize = strlen(Request.Data);
Request.Header.MessageSize = sizeof(LPC_MESSAGE) +
Request.Header.MessageSize = sizeof(LPC_MESSAGE) +
Request.Header.DataSize;
printf("%s: Sending to port 0x%x message \"%s\"...\n",
printf("%s: Sending to port 0x%x message \"%s\"...\n",
MyName,
PortHandle,
(char *) Request.Data);
Status = NtRequestPort(PortHandle,
Status = NtRequestPort(PortHandle,
&Request.Header);
if (!NT_SUCCESS(Status))
{
printf("%s: NtRequestPort(0x%x) failed with status = 0x%8X.\n",
printf("%s: NtRequestPort(0x%x) failed with status = 0x%8X.\n",
MyName,
PortHandle,
Status);
return EXIT_FAILURE;
}
printf("%s: Sending datagram to port 0x%x succeeded.\n", MyName, PortHandle);
Sleep(2000);

View File

@@ -1,10 +1,11 @@
/*
/* $Id: lpcsrv.c,v 1.11 2002/09/08 10:21:58 chorns Exp $
*
* DESCRIPTION: Simple LPC Server
* PROGRAMMER: David Welch
*/
#include <ddk/ntddk.h>
#include <rosrtl/string.h>
#include <windows.h>
#include <napi/lpc.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
@@ -31,13 +32,13 @@ void debug_printf(char* fmt, ...)
int main(int argc, char* argv[])
{
UNICODE_STRING PortName = ROS_STRING_INITIALIZER(TEST_PORT_NAME_U);
UNICODE_STRING PortName = UNICODE_STRING_INITIALIZER(TEST_PORT_NAME_U);
OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS Status;
HANDLE NamedPortHandle;
HANDLE PortHandle;
LPC_MAX_MESSAGE ConnectMsg;
printf("%s: Lpc test server\n", MyName);
InitializeObjectAttributes(&ObjectAttributes,
@@ -45,7 +46,7 @@ int main(int argc, char* argv[])
0,
NULL,
NULL);
printf("%s: Creating port \"%s\"...\n", MyName, TEST_PORT_NAME);
Status = NtCreatePort(&NamedPortHandle,
&ObjectAttributes,
@@ -58,9 +59,9 @@ int main(int argc, char* argv[])
return EXIT_FAILURE;
}
printf("%s: Port \"%s\" created (0x%x).\n\n", MyName, TEST_PORT_NAME, NamedPortHandle);
for (;;)
{
{
printf("%s: Listening for connections requests on port 0x%x...\n", MyName, NamedPortHandle);
Status = NtListenPort(NamedPortHandle,
&ConnectMsg.Header);
@@ -73,9 +74,9 @@ int main(int argc, char* argv[])
printf("%s: Received connection request 0x%08x on port 0x%x.\n", MyName,
ConnectMsg.Header.MessageId, NamedPortHandle);
printf("%s: Request from: PID=%x, TID=%x.\n", MyName,
ConnectMsg.Header.ClientId.UniqueProcess, ConnectMsg.Header.ClientId.UniqueThread);
printf("%s: Accepting connection request 0x%08x...\n", MyName,
ConnectMsg.Header.Cid.UniqueProcess, ConnectMsg.Header.Cid.UniqueThread);
printf("%s: Accepting connection request 0x%08x...\n", MyName,
ConnectMsg.Header.MessageId);
Status = NtAcceptConnectPort(&PortHandle,
NamedPortHandle,
@@ -87,11 +88,11 @@ int main(int argc, char* argv[])
{
printf("%s: NtAcceptConnectPort() failed with status = 0x%08lX.\n", MyName, Status);
return EXIT_FAILURE;
}
printf("%s: Connection request 0x%08x accepted as port 0x%x.\n", MyName,
}
printf("%s: Connection request 0x%08x accepted as port 0x%x.\n", MyName,
ConnectMsg.Header.MessageId, PortHandle);
printf("%s: Completing connection for port 0x%x (0x%08x).\n", MyName,
printf("%s: Completing connection for port 0x%x (0x%08x).\n", MyName,
PortHandle, ConnectMsg.Header.MessageId);
Status = NtCompleteConnectPort(PortHandle);
if (!NT_SUCCESS(Status))
@@ -99,12 +100,12 @@ int main(int argc, char* argv[])
printf("%s: NtCompleteConnectPort() failed with status = 0x%08lX.\n", MyName, Status);
return EXIT_FAILURE;
}
printf("%s: Entering server loop for port 0x%x...\n", MyName, PortHandle);
printf("%s: Entering server loop for port 0x%x...\n", MyName, PortHandle);
for(;;)
{
LPC_MAX_MESSAGE Request;
Status = NtReplyWaitReceivePort(PortHandle,
0,
NULL,
@@ -118,7 +119,7 @@ int main(int argc, char* argv[])
if (LPC_DATAGRAM == PORT_MESSAGE_TYPE(Request))
{
printf("%s: Datagram message contents are <%s>.\n",
MyName,
MyName,
Request.Data);
}
else

View File

@@ -0,0 +1,45 @@
#
#
#
PATH_TO_TOP = ../../..
include $(PATH_TO_TOP)/rules.mak
SRV_OBJECTS= lpcsrv.o
CLT_OBJECTS= lpcclt.o
PROGS= lpcsrv.exe lpcclt.exe
BASE_CFLAGS = -I$(PATH_TO_TOP)/include
LIBS = $(SDK_PATH_LIB)/kernel32.a \
$(SDK_PATH_LIB)/ntdll.a
all: $(PROGS)
.phony: all
implib:
clean:
- $(RM) lpcsrv.o lpcsrv.exe lpcsrv.sym lpcclt.o lpcclt.exe lpcsrv.sym
.phony: implib clean
install: $(PROGS:%=$(INSTALL_DIR)/bin/%)
$(PROGS:%=$(INSTALL_DIR)/bin/%): $(INSTALL_DIR)/bin/%: %
$(CP) $* $(INSTALL_DIR)/bin/$*
dist: $(PROGS:%=$(DIST_DIR)/apps/%)
$(PROGS:%=$(DIST_DIR)/apps/%): $(DIST_DIR)/apps/%: %
$(CP) $* $(DIST_DIR)/apps/$*
lpcsrv.exe: $(SRV_OBJECTS) $(LIBS)
$(CC) $(SRV_OBJECTS) $(LIBS) -o lpcsrv.exe
$(NM) --numeric-sort lpcsrv.exe > lpcsrv.sym
lpcclt.exe: $(CLT_OBJECTS) $(LIBS)
$(CC) $(CLT_OBJECTS) $(LIBS) -o lpcclt.exe
$(NM) --numeric-sort lpcclt.exe > lpcclt.sym

View File

@@ -0,0 +1,19 @@
# $Id: makefile,v 1.1 2002/09/25 01:09:49 sedwards Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = mktime
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,28 @@
#include <stdio.h>
#include <time.h>
struct tm time_str;
char daybuf[20];
int main(void)
{
printf("Testing mktime() by asking\n");
printf("What day of the week is July 4, 2001?\n");
time_str.tm_year = 2001 - 1900;
time_str.tm_mon = 7 - 1;
time_str.tm_mday = 4;
time_str.tm_hour = 0;
time_str.tm_min = 0;
time_str.tm_sec = 1;
time_str.tm_isdst = -1;
if (mktime(&time_str) == -1)
(void)puts("-unknown-");
else {
(void)strftime(daybuf, sizeof(daybuf), "%A", &time_str);
(void)puts(daybuf);
}
return 0;
}

View File

@@ -0,0 +1,45 @@
#
#
#
PATH_TO_TOP = ../../..
include $(PATH_TO_TOP)/rules.mak
SRV_OBJECTS = msserver.o
CLT_OBJECTS = msclient.o
PROGS = msserver.exe msclient.exe
BASE_CFLAGS = -I$(PATH_TO_TOP)/include
LIBS = $(SDK_PATH_LIB)/kernel32.a \
$(SDK_PATH_LIB)/ntdll.a
all: $(PROGS)
.phony: all
implib:
clean:
- $(RM) *.o *.exe *.sym
.phony: implib clean
install: $(PROGS:%=$(INSTALL_DIR)/bin/%)
$(PROGS:%=$(INSTALL_DIR)/bin/%): $(INSTALL_DIR)/bin/%: %
$(CP) $* $(INSTALL_DIR)/bin/$*
dist: $(PROGS:%=$(DIST_DIR)/apps/%)
$(PROGS:%=$(DIST_DIR)/apps/%): $(DIST_DIR)/apps/%: %
$(CP) $* $(DIST_DIR)/apps/$*
msserver.exe: $(SRV_OBJECTS) $(LIBS)
$(CC) $(SRV_OBJECTS) $(LIBS) -o msserver.exe
$(NM) --numeric-sort msserver.exe > msserver.sym
msclient.exe: $(CLT_OBJECTS) $(LIBS)
$(CC) $(CLT_OBJECTS) $(LIBS) -o msclient.exe
$(NM) --numeric-sort msclient.exe > msclient.sym

View File

@@ -14,7 +14,7 @@ int main(int argc, char *argv[])
LPSTR lpszMailslotName = "\\\\.\\MAILSLOT\\mymailslot";
LPSTR lpszTestMessage = "Mailslot test message!";
DWORD cbLength, cbWritten;
hMailslot = CreateFile(lpszMailslotName,
GENERIC_WRITE,
FILE_SHARE_READ,
@@ -28,17 +28,17 @@ int main(int argc, char *argv[])
printf("CreateFile() failed\n");
return 0;
}
cbLength = (ULONG)strlen(lpszTestMessage)+1;
WriteFile(hMailslot,
lpszTestMessage,
cbLength,
&cbWritten,
NULL);
CloseHandle(hMailslot);
return 0;
}

View File

@@ -0,0 +1,22 @@
#
# $Id: makefile,v 1.2 2002/06/02 19:24:59 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = mutex
TARGET_SDKLIBS = ntdll.a kernel32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,116 @@
#include <ddk/ntddk.h>
#include <windows.h>
#include <string.h>
#include <stdio.h>
HANDLE OutputHandle;
HANDLE InputHandle;
HANDLE hThread[2];
DWORD dwCounter = 0;
HANDLE hMutex;
void dprintf(char* fmt, ...)
{
va_list args;
char buffer[255];
va_start(args,fmt);
vsprintf(buffer,fmt,args);
WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
va_end(args);
}
DWORD WINAPI thread1(LPVOID crap)
{
DWORD dwError = 0;
DWORD i;
dprintf("Thread 1 running!\n");
for (i = 0; i < 10; i++)
{
dwError = WaitForSingleObject(hMutex, INFINITE);
if (dwError == WAIT_FAILED)
{
dprintf("Thread2: WaitForSingleObject failed!\n");
return 1;
}
else if (dwError == WAIT_ABANDONED_0)
{
dprintf("Thread2: WaitForSingleObject returned WAIT_ABANDONED_0\n");
}
dprintf("Thread1: dwCounter : %lu -->", dwCounter);
dwCounter++;
dprintf(" %lu\n", dwCounter);
ReleaseMutex(hMutex);
}
return 1;
}
DWORD WINAPI thread2(LPVOID crap)
{
DWORD dwError = 0;
DWORD i;
dprintf("Thread 2 running!\n");
for (i = 0; i < 10; i++)
{
dwError = WaitForSingleObject(hMutex, INFINITE);
if (dwError == WAIT_FAILED)
{
dprintf("Thread2: WaitForSingleObject failed!\n");
return 1;
}
else if (dwError == WAIT_ABANDONED_0)
{
dprintf("Thread2: WaitForSingleObject returned WAIT_ABANDONED_0\n");
}
dprintf("Thread2: dwCounter : %lu -->", dwCounter);
dwCounter++;
dprintf(" %lu\n", dwCounter);
ReleaseMutex(hMutex);
}
return 1;
}
int main(int argc, char* argv[])
{
DWORD dwError;
DWORD id1,id2;
AllocConsole();
InputHandle = GetStdHandle(STD_INPUT_HANDLE);
OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
dprintf("Calling CreateMutex()\n");
hMutex = CreateMutexW(NULL, FALSE, L"TestMutex");
if (hMutex == INVALID_HANDLE_VALUE)
{
dprintf("CreateMutex() failed! Error: %lu\n", GetLastError);
return 0;
}
dprintf("CreateMutex() succeeded!\n");
hThread[0] = CreateThread(0, 0, thread1, 0, 0, &id1);
hThread[1] = CreateThread(0, 0, thread2, 0, 0, &id2);
dprintf("Calling WaitForMultipleObject()\n");
dwError = WaitForMultipleObjects(2, hThread, TRUE, INFINITE);
dprintf("WaitForMultipleObject() Error: %lu\n", dwError);
CloseHandle(hThread[0]);
CloseHandle(hThread[1]);
CloseHandle(hMutex);
return 0;
}

View File

@@ -0,0 +1,44 @@
#
#
#
PATH_TO_TOP = ../../..
include $(PATH_TO_TOP)/rules.mak
SRV_OBJECTS = npserver.o
CLT_OBJECTS = npclient.o
PROGS = npserver.exe npclient.exe
BASE_CFLAGS = -I$(PATH_TO_TOP)/include
LIBS = $(SDK_PATH_LIB)/kernel32.a
all: $(PROGS)
.phony: all
implib:
clean:
- $(RM) *.o *.exe *.sym
.phony: implib clean
install: $(PROGS:%=$(INSTALL_DIR)/bin/%)
$(PROGS:%=$(INSTALL_DIR)/bin/%): $(INSTALL_DIR)/bin/%: %
$(CP) $* $(INSTALL_DIR)/bin/$*
dist: $(PROGS:%=$(DIST_DIR)/apps/%)
$(PROGS:%=$(DIST_DIR)/apps/%): $(DIST_DIR)/apps/%: %
$(CP) $* $(DIST_DIR)/apps/$*
npserver.exe: $(SRV_OBJECTS) $(LIBS)
$(CC) $(SRV_OBJECTS) $(LIBS) -o npserver.exe
$(NM) --numeric-sort npserver.exe > npserver.sym
npclient.exe: $(CLT_OBJECTS) $(LIBS)
$(CC) $(CLT_OBJECTS) $(LIBS) -o npclient.exe
$(NM) --numeric-sort npclient.exe > npclient.sym

View File

@@ -91,7 +91,7 @@ VOID InstanceThread (LPVOID lpvParam)
DWORD cbBytesRead, cbReplyBytes, cbWritten;
BOOL fSuccess;
HANDLE hPipe;
hPipe = (HANDLE)lpvParam;
while (1)
{

View File

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

@@ -0,0 +1,66 @@
# Makefile - Proj_Listing2_1.dsp
ifndef CFG
CFG=Proj_Listing2_1 - Win32 Debug
endif
CC=gcc
CFLAGS=
CXX=g++
CXXFLAGS=$(CFLAGS)
RC=windres -O COFF
ifeq "$(CFG)" "Proj_Listing2_1 - Win32 Release"
CFLAGS+=-fexceptions -O2 -DWIN32 -DNDEBUG -D_WINDOWS -D_MBCS -W
LD=$(CXX) $(CXXFLAGS)
LDFLAGS=
LDFLAGS+=-Wl,--subsystem,windows
LIBS+=-lkernel32 -luser32 -lgdi32
else
ifeq "$(CFG)" "Proj_Listing2_1 - Win32 Debug"
CFLAGS+=-fexceptions -g -O0 -DWIN32 -D_DEBUG -D_WINDOWS -D_MBCS -W
LD=$(CXX) $(CXXFLAGS)
LDFLAGS=
LDFLAGS+=-Wl,--subsystem,windows
LIBS+=-lkernel32 -luser32 -lgdi32
endif
endif
ifndef TARGET
TARGET=patblt.exe
endif
.PHONY: all
all: $(TARGET)
%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $<
%.res: %.rc
$(RC) $(CPPFLAGS) -o $@ -i $<
SOURCE_FILES= \
patblt.cpp
HEADER_FILES=
RESOURCE_FILES=
SRCS=$(SOURCE_FILES) $(HEADER_FILES) $(RESOURCE_FILES)
OBJS=$(patsubst %.rc,%.res,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(filter %.c %.cpp %.rc,$(SRCS)))))
$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
.PHONY: clean
clean:
-del $(OBJS) $(TARGET)
.PHONY: depends
depends:
-$(CXX) $(CXXFLAGS) $(CPPFLAGS) -MM $(filter %.c %.cpp,$(SRCS)) > Proj_Listing2_1.dep
-include Proj_Listing2_1.dep

View File

@@ -6,7 +6,7 @@
// Created by Damon Chandler <dmc27@ee.cornell.edu>
// Updates can be downloaded at: <www.coriolis.com>
//
// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
// if you have any questions about this code.
// ------------------------------------------------------------------
@@ -18,18 +18,18 @@
HINSTANCE HInst;
const char* WndClassName = "GMainWnd";
LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
LPARAM LParam);
int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE, LPTSTR,
int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE, LPTSTR,
int nCmdShow)
{
HInst = HInstance;
WNDCLASS wc;
memset(&wc, 0, sizeof(WNDCLASS));
wc.style = CS_VREDRAW | CS_HREDRAW;
wc.lpszClassName = WndClassName;
wc.lpfnWndProc = MainWndProc;
@@ -41,14 +41,14 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE, LPTSTR,
if (RegisterClass(&wc))
{
HWND HWnd =
CreateWindow(WndClassName,
HWND HWnd =
CreateWindow(WndClassName,
TEXT("PatBlt Tracking Rect Demo"),
WS_OVERLAPPEDWINDOW | WS_CAPTION |
WS_OVERLAPPEDWINDOW | WS_CAPTION |
WS_VISIBLE | WS_CLIPCHILDREN,
CW_USEDEFAULT, CW_USEDEFAULT, 640, 480,
NULL, NULL, HInst, NULL);
if (HWnd)
{
ShowWindow(HWnd, nCmdShow);
@@ -59,7 +59,7 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE, LPTSTR,
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
}
return 0;
@@ -101,31 +101,31 @@ void RenderTrackingRect(IN HDC HDestDC, IN const RECT& RRender)
const DWORD dwROP3 = DSTINVERT; // experiment with others
// render top bar
PatBlt(HDestDC,
RRender.left, RRender.top,
width, line_width,
PatBlt(HDestDC,
RRender.left, RRender.top,
width, line_width,
dwROP3);
// render bottom bar
PatBlt(HDestDC,
RRender.left, RRender.bottom - line_width,
width, line_width,
PatBlt(HDestDC,
RRender.left, RRender.bottom - line_width,
width, line_width,
dwROP3);
// render left bar
PatBlt(HDestDC,
RRender.left, RRender.top + line_width,
line_width, height - (2 * line_width),
PatBlt(HDestDC,
RRender.left, RRender.top + line_width,
line_width, height - (2 * line_width),
dwROP3);
// render right bar
PatBlt(HDestDC,
RRender.right - line_width, RRender.top + line_width,
line_width, height - (2 * line_width),
PatBlt(HDestDC,
RRender.right - line_width, RRender.top + line_width,
line_width, height - (2 * line_width),
dwROP3);
}
//------------------------------------------------------------------
LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
LPARAM LParam)
{
switch (Msg)
@@ -138,15 +138,15 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
{
// load the penguin bitmap
HBITMAP HBmp = static_cast<HBITMAP>(
LoadImage(HInst, filename, IMAGE_BITMAP, 0, 0,
LoadImage(HInst, filename, IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE | LR_DEFAULTSIZE)
);
);
if (HBmp)
{
// get the bitmap's dimensions
BITMAP bmp;
if (GetObject(HBmp, sizeof(BITMAP), &bmp))
{
{
RImage.right += bmp.bmWidth;
RImage.bottom += bmp.bmHeight;
@@ -166,9 +166,9 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
PMouse.y = HIWORD(LParam);
RECT RClient;
if (PtInRect(&RImage, PMouse) &&
if (PtInRect(&RImage, PMouse) &&
GetClientRect(HWnd, &RClient))
{
{
MapRect(HWnd, HWND_DESKTOP, RClient);
ClipCursor(&RClient);
@@ -178,23 +178,23 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
HRGN HClipRgn = CreateRectRgnIndirect(&RClient);
SelectClipRgn(HScreenDC, HClipRgn);
DeleteObject(HClipRgn);
CopyRect(&RTrack, &RImage);
MapRect(HWnd, HWND_DESKTOP, RTrack);
MapRect(HWnd, HWND_DESKTOP, RTrack);
// render the first tracking rect
RenderTrackingRect(HScreenDC, RTrack);
is_tracking = true;
}
}
break;
}
case WM_MOUSEMOVE:
{
if (HScreenDC && is_tracking)
{
POINT PCurrent = {LOWORD(LParam), HIWORD(LParam)};
{
POINT PCurrent = {LOWORD(LParam), HIWORD(LParam)};
const int dX = PCurrent.x - PMouse.x;
const int dY = PCurrent.y - PMouse.y;
const int dY = PCurrent.y - PMouse.y;
// erase the previous rectangle
RenderTrackingRect(HScreenDC, RTrack);
@@ -227,12 +227,12 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
break;
}
case WM_PAINT:
{
{
PAINTSTRUCT ps;
HDC Hdc = BeginPaint(HWnd, &ps);
try
{
//
//
// TODO: Add palette support...
//
@@ -240,7 +240,7 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
BitBlt(Hdc, RImage.left, RImage.top,
RImage.right - RImage.left,
RImage.bottom - RImage.top,
HMemDC, 0, 0,
HMemDC, 0, 0,
SRCCOPY);
}
catch (...)
@@ -249,11 +249,11 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
}
EndPaint(HWnd, &ps);
break;
}
}
case WM_DESTROY:
{
// clean up
if (HOldBmp)
if (HOldBmp)
{
DeleteObject(SelectObject(HMemDC, HOldBmp));
}

View File

@@ -0,0 +1,21 @@
# $Id: Makefile,v 1.8 2002/06/02 19:25:00 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = pteb
TARGET_SDKLIBS = ntdll.a kernel32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,23 @@
#include <ntos.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
int x;
PTEB Teb;
printf("TEB dumpper\n");
__asm__("movl %%fs:0x18, %0\n\t"
: "=a" (x)
: /* no inputs */);
printf("fs[0x18] %x\n", x);
Teb = (PTEB)x;
printf("StackBase: 0x%08lX\n", Teb->Tib.StackBase);
printf("StackLimit: 0x%08lX\n", Teb->Tib.StackLimit);
printf("DeallocationStack: 0x%08lX\n", Teb->DeallocationStack);
return(0);
}

View File

@@ -0,0 +1,22 @@
#
# $Id: makefile,v 1.0
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = regdump
TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,234 @@
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <windows.h>
#include <tchar.h>
#include <ddk/ntddk.h>
HANDLE OutputHandle;
HANDLE InputHandle;
void dprintf(char* fmt, ...)
{
va_list args;
char buffer[255];
va_start(args,fmt);
vsprintf(buffer,fmt,args);
WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
va_end(args);
}
#define MAX_NAME_LEN 500
/*
BOOL DumpRegKey(TCHAR* KeyPath, HKEY hKey)
{
TCHAR keyPath[1000];
int keyPathLen = 0;
keyPath[0] = _T('\0');
dprintf("\n[%s]\n", KeyPath);
if (hKey != NULL) {
HKEY hNewKey;
LONG errCode = RegOpenKeyEx(hKey, keyPath, 0, KEY_READ, &hNewKey);
if (errCode == ERROR_SUCCESS) {
TCHAR Name[MAX_NAME_LEN];
DWORD cName = MAX_NAME_LEN;
FILETIME LastWriteTime;
DWORD dwIndex = 0L;
while (RegEnumKeyEx(hNewKey, dwIndex, Name, &cName, NULL, NULL, NULL, &LastWriteTime) == ERROR_SUCCESS) {
HKEY hSubKey;
DWORD dwCount = 0L;
dprintf("\n[%s\\%s]\n", KeyPath, Name);
errCode = RegOpenKeyEx(hNewKey, Name, 0, KEY_READ, &hSubKey);
if (errCode == ERROR_SUCCESS) {
TCHAR SubName[MAX_NAME_LEN];
DWORD cSubName = MAX_NAME_LEN;
// if (RegEnumKeyEx(hSubKey, 0, SubName, &cSubName, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
while (RegEnumKeyEx(hSubKey, dwCount, SubName, &cSubName, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
dprintf("\t%s (%d)\n", SubName, dwCount);
cSubName = MAX_NAME_LEN;
++dwCount;
}
}
RegCloseKey(hSubKey);
//AddEntryToTree(hwndTV, pnmtv->itemNew.hItem, Name, NULL, dwCount);
cName = MAX_NAME_LEN;
++dwIndex;
}
RegCloseKey(hNewKey);
}
} else {
}
dprintf("\n");
return TRUE;
}
*/
BOOL _DumpRegKey(TCHAR* KeyPath, HKEY hKey)
{
if (hKey != NULL) {
HKEY hNewKey;
LONG errCode = RegOpenKeyEx(hKey, NULL, 0, KEY_READ, &hNewKey);
if (errCode == ERROR_SUCCESS) {
TCHAR Name[MAX_NAME_LEN];
DWORD cName = MAX_NAME_LEN;
FILETIME LastWriteTime;
DWORD dwIndex = 0L;
TCHAR* pKeyName = &KeyPath[_tcslen(KeyPath)];
while (RegEnumKeyEx(hNewKey, dwIndex, Name, &cName, NULL, NULL, NULL, &LastWriteTime) == ERROR_SUCCESS) {
HKEY hSubKey;
DWORD dwCount = 0L;
_tcscat(KeyPath, _T("\\"));
_tcscat(KeyPath, Name);
dprintf("\n[%s]\n", KeyPath);
errCode = RegOpenKeyEx(hNewKey, Name, 0, KEY_READ, &hSubKey);
if (errCode == ERROR_SUCCESS) {
#if 1
_DumpRegKey(KeyPath, hSubKey);
#else
TCHAR SubName[MAX_NAME_LEN];
DWORD cSubName = MAX_NAME_LEN;
// if (RegEnumKeyEx(hSubKey, 0, SubName, &cSubName, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
while (RegEnumKeyEx(hSubKey, dwCount, SubName, &cSubName, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) {
dprintf("\t%s (%d)\n", SubName, dwCount);
cSubName = MAX_NAME_LEN;
++dwCount;
}
#endif
}
RegCloseKey(hSubKey);
cName = MAX_NAME_LEN;
*pKeyName = _T('\0');
++dwIndex;
}
RegCloseKey(hNewKey);
}
} else {
}
return TRUE;
}
BOOL DumpRegKey(TCHAR* KeyPath, HKEY hKey)
{
dprintf("\n[%s]\n", KeyPath);
return _DumpRegKey(KeyPath, hKey);
}
void RegKeyPrint(int which)
{
TCHAR szKeyPath[1000];
switch (which) {
case '1':
strcpy(szKeyPath, _T("HKEY_CLASSES_ROOT"));
DumpRegKey(szKeyPath, HKEY_CLASSES_ROOT);
break;
case '2':
strcpy(szKeyPath, _T("HKEY_CURRENT_USER"));
DumpRegKey(szKeyPath, HKEY_CURRENT_USER);
break;
case '3':
strcpy(szKeyPath, _T("HKEY_LOCAL_MACHINE"));
DumpRegKey(szKeyPath, HKEY_LOCAL_MACHINE);
break;
case '4':
strcpy(szKeyPath, _T("HKEY_USERS"));
DumpRegKey(szKeyPath, HKEY_USERS);
break;
case '5':
strcpy(szKeyPath, _T("HKEY_CURRENT_CONFIG"));
DumpRegKey(szKeyPath, HKEY_CURRENT_CONFIG);
break;
case '6':
// DumpRegKey(szKeyPath, HKEY_CLASSES_ROOT);
// DumpRegKey(szKeyPath, HKEY_CURRENT_USER);
// DumpRegKey(szKeyPath, HKEY_LOCAL_MACHINE);
// DumpRegKey(szKeyPath, HKEY_USERS);
// DumpRegKey(szKeyPath, HKEY_CURRENT_CONFIG);
dprintf("unimplemented...\n");
break;
}
}
int main(int argc, char* argv[])
{
char Buffer[10];
TCHAR szKeyPath[1000];
DWORD Result;
AllocConsole();
InputHandle = GetStdHandle(STD_INPUT_HANDLE);
OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
if (argc > 1) {
// if (0 == _tcsstr(argv[1], _T("HKLM"))) {
if (strstr(argv[1], _T("help"))) {
} else if (strstr(argv[1], _T("HKCR"))) {
RegKeyPrint('1');
} else if (strstr(argv[1], _T("HKCU"))) {
RegKeyPrint('2');
} else if (strstr(argv[1], _T("HKLM"))) {
RegKeyPrint('3');
} else if (strstr(argv[1], _T("HKU"))) {
RegKeyPrint('4');
} else if (strstr(argv[1], _T("HKCC"))) {
RegKeyPrint('5');
} else if (strstr(argv[1], _T("HKRR"))) {
RegKeyPrint('6');
} else {
dprintf("started with argc = %d, argv[1] = %s (unknown?)\n", argc, argv[1]);
}
} else while (1) {
dprintf("choose test :\n");
dprintf(" 0 = Exit\n");
dprintf(" 1 = HKEY_CLASSES_ROOT\n");
dprintf(" 2 = HKEY_CURRENT_USER\n");
dprintf(" 3 = HKEY_LOCAL_MACHINE\n");
dprintf(" 4 = HKEY_USERS\n");
dprintf(" 5 = HKEY_CURRENT_CONFIG\n");
dprintf(" 6 = REGISTRY ROOT\n");
ReadConsoleA(InputHandle, Buffer, 3, &Result, NULL) ;
switch (Buffer[0]) {
case '0':
return(0);
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
RegKeyPrint(Buffer[0]/* - '0'*/);
break;
default:
dprintf("invalid input.\n");
break;
}
}
return 0;
}
/*
[HKEY_LOCAL_MACHINE]
[HKEY_LOCAL_MACHINE\HARDWARE]
[HKEY_LOCAL_MACHINE\HARDWARE\ACPI]
[HKEY_LOCAL_MACHINE\HARDWARE\ACPI\DSDT]
[HKEY_LOCAL_MACHINE\HARDWARE\ACPI\DSDT\VIA694]
[HKEY_LOCAL_MACHINE\HARDWARE\ACPI\DSDT\VIA694\AWRDACPI]
*/

View File

@@ -0,0 +1,22 @@
#
# $Id: makefile,v 1.7 2002/06/02 19:25:00 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = regtest
TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,882 @@
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <windows.h>
#include <ddk/ntddk.h>
HANDLE OutputHandle;
HANDLE InputHandle;
void dprintf(char* fmt, ...)
{
va_list args;
char buffer[255];
va_start(args,fmt);
vsprintf(buffer,fmt,args);
WriteConsoleA(OutputHandle, buffer, strlen(buffer), NULL, NULL);
va_end(args);
}
void do_enumeratekey(PWSTR Name)
{
ULONG Index,Length,i;
KEY_BASIC_INFORMATION KeyInformation[5];
NTSTATUS Status;
OBJECT_ATTRIBUTES ObjectAttributes;
HANDLE hKey1;
UNICODE_STRING KeyName;
RtlInitUnicodeString(&KeyName, Name);
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, NULL, NULL);
Status=NtOpenKey( &hKey1, MAXIMUM_ALLOWED, &ObjectAttributes);
dprintf("NtEnumerateKey : \n");
Index=0;
while(Status == STATUS_SUCCESS)
{
Status=NtEnumerateKey(hKey1,Index++,KeyBasicInformation
,&KeyInformation[0], sizeof(KeyInformation)
,&Length);
if(Status== STATUS_SUCCESS)
{
dprintf("\tSubKey Name = ");
for (i=0;i<KeyInformation[0].NameLength/2;i++)
dprintf("%C",KeyInformation[0].Name[i]);
dprintf("\n");
}
}
NtClose(hKey1);
}
void test1(void)
{
HKEY hKey = NULL,hKey1;
OBJECT_ATTRIBUTES ObjectAttributes;
NTSTATUS Status;
UNICODE_STRING KeyName = UNICODE_STRING_INITIALIZER(L"\\Registry");
ULONG Index,Length,i;
KEY_BASIC_INFORMATION KeyInformation[5];
KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
dprintf("NtOpenKey \\Registry : ");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status=NtOpenKey( &hKey1, MAXIMUM_ALLOWED, &ObjectAttributes);
dprintf("\t\t\t\tStatus =%x\n",Status);
if(Status==0)
{
dprintf("NtQueryKey : ");
Status=NtQueryKey(hKey1,KeyBasicInformation
,&KeyInformation[0], sizeof(KeyInformation)
,&Length);
dprintf("\t\t\t\t\tStatus =%x\n",Status);
if (Status == STATUS_SUCCESS)
{
dprintf("\tKey Name = ");
for (i=0;i<KeyInformation[0].NameLength/2;i++)
dprintf("%C",KeyInformation[0].Name[i]);
dprintf("\n");
}
dprintf("NtEnumerateKey : \n");
Index=0;
while(Status == STATUS_SUCCESS)
{
Status=NtEnumerateKey(hKey1,Index++,KeyBasicInformation
,&KeyInformation[0], sizeof(KeyInformation)
,&Length);
if(Status== STATUS_SUCCESS)
{
dprintf("\tSubKey Name = ");
for (i=0;i<KeyInformation[0].NameLength/2;i++)
dprintf("%C",KeyInformation[0].Name[i]);
dprintf("\n");
}
}
dprintf("NtClose : ");
Status = NtClose( hKey1 );
dprintf("\t\t\t\t\tStatus =%x\n",Status);
}
NtClose(hKey);
dprintf("NtOpenKey \\Registry\\Machine : ");
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status=NtOpenKey( &hKey1, MAXIMUM_ALLOWED, &ObjectAttributes);
dprintf("\t\t\tStatus =%x\n",Status);
dprintf("NtOpenKey System\\Setup : ");
RtlInitUnicodeStringFromLiteral(&KeyName, L"System\\Setup");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, hKey1 , NULL);
Status = NtOpenKey ( &hKey, KEY_READ , &ObjectAttributes);
dprintf("\t\t\tStatus =%x\n",Status);
if(Status==0)
{
dprintf("NtQueryValueKey : ");
RtlInitUnicodeStringFromLiteral(&KeyName, L"CmdLine");
Status=NtQueryValueKey(hKey,&KeyName,KeyValueFullInformation
,&KeyValueInformation[0], sizeof(KeyValueInformation)
,&Length);
dprintf("\t\t\t\tStatus =%x\n",Status);
if (Status == STATUS_SUCCESS)
{
dprintf("\tValue:DO=%d, DL=%d, NL=%d, Name = "
,KeyValueInformation[0].DataOffset
,KeyValueInformation[0].DataLength
,KeyValueInformation[0].NameLength);
for (i=0;i<10 && i<KeyValueInformation[0].NameLength/2;i++)
dprintf("%C",KeyValueInformation[0].Name[i]);
dprintf("\n");
dprintf("\t\tType = %d\n",KeyValueInformation[0].Type);
if (KeyValueInformation[0].Type == REG_SZ)
dprintf("\t\tValue = %S\n",KeyValueInformation[0].Name+1
+KeyValueInformation[0].NameLength/2);
}
dprintf("NtEnumerateValueKey : \n");
Index=0;
while(Status == STATUS_SUCCESS)
{
Status=NtEnumerateValueKey(hKey,Index++,KeyValueFullInformation
,&KeyValueInformation[0], sizeof(KeyValueInformation)
,&Length);
if(Status== STATUS_SUCCESS)
{
dprintf("\tValue:DO=%d, DL=%d, NL=%d, Name = "
,KeyValueInformation[0].DataOffset
,KeyValueInformation[0].DataLength
,KeyValueInformation[0].NameLength);
for (i=0;i<KeyValueInformation[0].NameLength/2;i++)
dprintf("%C",KeyValueInformation[0].Name[i]);
dprintf(", Type = %d\n",KeyValueInformation[0].Type);
if (KeyValueInformation[0].Type == REG_SZ)
dprintf("\t\tValue = %S\n",((char*)&KeyValueInformation[0]
+KeyValueInformation[0].DataOffset));
}
}
dprintf("NtClose : ");
Status = NtClose( hKey );
dprintf("\t\t\t\t\tStatus =%x\n",Status);
}
NtClose( hKey1 );
}
void test2(void)
{
HKEY hKey,hKey1;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName,ValueName;
NTSTATUS Status;
KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
ULONG Index,Length,i;
char Buffer[10];
DWORD Result;
dprintf("NtCreateKey volatile: \n");
dprintf(" \\Registry\\Machine\\Software\\test2reactos: ");
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, NULL, NULL);
Status = NtCreateKey ( &hKey, KEY_ALL_ACCESS , &ObjectAttributes
,0,NULL,REG_OPTION_VOLATILE,NULL);
dprintf("\t\tStatus=%x\n",Status);
NtClose(hKey);
do_enumeratekey(L"\\Registry\\Machine\\Software");
dprintf(" ...\\test2 :");
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos\\test2");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, NULL, NULL);
Status = NtCreateKey ( &hKey1, KEY_ALL_ACCESS , &ObjectAttributes
,0,NULL,REG_OPTION_VOLATILE,NULL);
dprintf("\t\t\t\t\tStatus=%x\n",Status);
dprintf(" ...\\TestVolatile :");
RtlInitUnicodeStringFromLiteral(&KeyName, L"TestVolatile");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, hKey1, NULL);
Status = NtCreateKey ( &hKey, KEY_ALL_ACCESS , &ObjectAttributes
,0,NULL,REG_OPTION_VOLATILE,NULL);
dprintf("\t\t\t\tStatus=%x\n",Status);
NtClose(hKey1);
RtlInitUnicodeStringFromLiteral(&ValueName, L"TestREG_SZ");
dprintf("NtSetValueKey reg_sz: ");
Status=NtSetValueKey(hKey,&ValueName,0,REG_SZ,(PVOID)L"Test Reg_sz",24);
dprintf("\t\t\t\tStatus=%x\n",Status);
RtlInitUnicodeStringFromLiteral(&ValueName, L"TestDWORD");
dprintf("NtSetValueKey reg_dword: ");
Status=NtSetValueKey(hKey,&ValueName,0,REG_DWORD,(PVOID)"reac",4);
dprintf("\t\t\tStatus=%x\n",Status);
NtClose(hKey);
dprintf("NtOpenKey \\Registry\\Machine\\Software\\test2reactos\\test2\\TestVolatile : ");
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos\\test2\\TestVolatile");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status=NtOpenKey( &hKey, MAXIMUM_ALLOWED, &ObjectAttributes);
dprintf("\t\t\t\tStatus =%x\n",Status);
if(Status==0)
{
dprintf("NtEnumerateValueKey : \n");
Index=0;
while(Status == STATUS_SUCCESS)
{
Status=NtEnumerateValueKey(hKey,Index++,KeyValueFullInformation
,&KeyValueInformation[0], sizeof(KeyValueInformation)
,&Length);
if(Status== STATUS_SUCCESS)
{
dprintf("\tValue:DO=%d, DL=%d, NL=%d, Name = "
,KeyValueInformation[0].DataOffset
,KeyValueInformation[0].DataLength
,KeyValueInformation[0].NameLength);
for (i=0;i<KeyValueInformation[0].NameLength/2;i++)
dprintf("%C",KeyValueInformation[0].Name[i]);
dprintf(", Type = %d\n",KeyValueInformation[0].Type);
if (KeyValueInformation[0].Type == REG_SZ)
dprintf("\t\tValue = %S\n",((char*)&KeyValueInformation[0]
+KeyValueInformation[0].DataOffset));
}
}
}
NtClose(hKey);
dprintf("delete \\Registry\\Machine\\software\\test2reactos ?");
ReadConsoleA(InputHandle, Buffer, 3, &Result, NULL) ;
if (Buffer[0] != 'y' && Buffer[0] != 'Y') return;
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos\\test2\\TestVolatile");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
dprintf("NtOpenKey : ");
Status=NtOpenKey( &hKey, KEY_ALL_ACCESS, &ObjectAttributes);
dprintf("\t\t\t\tStatus =%x\n",Status);
dprintf("NtDeleteKey : ");
Status=NtDeleteKey(hKey);
dprintf("\t\t\t\tStatus =%x\n",Status);
NtClose(hKey);
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos\\test2");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
dprintf("NtOpenKey : ");
Status=NtOpenKey( &hKey, KEY_ALL_ACCESS, &ObjectAttributes);
dprintf("\t\t\t\tStatus =%x\n",Status);
dprintf("NtDeleteKey : ");
Status=NtDeleteKey(hKey);
dprintf("\t\t\t\tStatus =%x\n",Status);
NtClose(hKey);
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test2reactos");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
dprintf("NtOpenKey : ");
Status=NtOpenKey( &hKey, KEY_ALL_ACCESS, &ObjectAttributes);
dprintf("\t\t\t\tStatus =%x\n",Status);
dprintf("NtDeleteKey : ");
Status=NtDeleteKey(hKey);
dprintf("\t\t\t\tStatus =%x\n",Status);
NtClose(hKey);
}
void test3(void)
{
HKEY hKey,hKey1;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName,ValueName;
NTSTATUS Status;
KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
ULONG Index,Length,i;
char Buffer[10];
DWORD Result;
dprintf("NtCreateKey non volatile: \n");
dprintf(" \\Registry\\Machine\\Software\\test3reactos: ");
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, NULL, NULL);
Status = NtCreateKey ( &hKey, KEY_ALL_ACCESS , &ObjectAttributes
,0,NULL,REG_OPTION_NON_VOLATILE,NULL);
dprintf("\t\tStatus=%x\n",Status);
NtClose(hKey);
do_enumeratekey(L"\\Registry\\Machine\\Software");
dprintf("NtOpenKey: ");
Status=NtOpenKey( &hKey, MAXIMUM_ALLOWED, &ObjectAttributes);
dprintf("\t\tStatus=%x\n",Status);
NtClose(hKey);
dprintf(" ...\\test3 :");
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos\\test3");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, NULL, NULL);
Status = NtCreateKey ( &hKey, KEY_ALL_ACCESS , &ObjectAttributes
,0,NULL,REG_OPTION_NON_VOLATILE,NULL);
dprintf("\t\t\t\t\tStatus=%x\n",Status);
dprintf("NtOpenKey: ");
Status=NtOpenKey( &hKey1, MAXIMUM_ALLOWED, &ObjectAttributes);
dprintf("\t\tStatus=%x\n",Status);
NtClose(hKey);
dprintf(" ...\\testNonVolatile :");
RtlInitUnicodeStringFromLiteral(&KeyName, L"TestNonVolatile");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, hKey1, NULL);
Status = NtCreateKey ( &hKey, KEY_ALL_ACCESS , &ObjectAttributes
,0,NULL,REG_OPTION_NON_VOLATILE,NULL);
dprintf("\t\t\t\tStatus=%x\n",Status);
NtClose(hKey1);
RtlInitUnicodeStringFromLiteral(&ValueName, L"TestREG_SZ");
dprintf("NtSetValueKey reg_sz: ");
Status=NtSetValueKey(hKey,&ValueName,0,REG_SZ,(PVOID)L"Test Reg_sz",24);
dprintf("\t\t\t\tStatus=%x\n",Status);
RtlInitUnicodeStringFromLiteral(&ValueName, L"TestDWORD");
dprintf("NtSetValueKey reg_dword: ");
Status=NtSetValueKey(hKey,&ValueName,0,REG_DWORD,(PVOID)"reac",4);
dprintf("\t\t\tStatus=%x\n",Status);
NtClose(hKey);
dprintf("NtOpenKey \\Registry\\Machine\\Software\\test3reactos\\test3\\testNonVolatile : ");
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos\\test3\\testNonVolatile");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status=NtOpenKey( &hKey, MAXIMUM_ALLOWED, &ObjectAttributes);
dprintf("\t\t\t\tStatus =%x\n",Status);
if(Status==0)
{
dprintf("NtEnumerateValueKey : \n");
Index=0;
while(Status == STATUS_SUCCESS)
{
Status=NtEnumerateValueKey(hKey,Index++,KeyValueFullInformation
,&KeyValueInformation[0], sizeof(KeyValueInformation)
,&Length);
if(Status== STATUS_SUCCESS)
{
dprintf("\tValue:DO=%d, DL=%d, NL=%d, Name = "
,KeyValueInformation[0].DataOffset
,KeyValueInformation[0].DataLength
,KeyValueInformation[0].NameLength);
for (i=0;i<KeyValueInformation[0].NameLength/2;i++)
dprintf("%C",KeyValueInformation[0].Name[i]);
dprintf(", Type = %d\n",KeyValueInformation[0].Type);
if (KeyValueInformation[0].Type == REG_SZ)
dprintf("\t\tValue = %S\n",((char*)&KeyValueInformation[0]
+KeyValueInformation[0].DataOffset));
}
}
}
NtClose(hKey);
dprintf("delete \\Registry\\Machine\\software\\test3reactos ?");
ReadConsoleA(InputHandle, Buffer, 3, &Result, NULL) ;
if (Buffer[0] != 'y' && Buffer[0] != 'Y') return;
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos\\test3\\testNonvolatile");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
dprintf("NtOpenKey : ");
Status=NtOpenKey( &hKey, KEY_ALL_ACCESS, &ObjectAttributes);
dprintf("\t\t\t\tStatus =%x\n",Status);
dprintf("NtDeleteKey : ");
Status=NtDeleteKey(hKey);
dprintf("\t\t\t\tStatus =%x\n",Status);
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos\\test3");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
dprintf("NtOpenKey : ");
Status=NtOpenKey( &hKey, KEY_ALL_ACCESS, &ObjectAttributes);
dprintf("\t\t\t\tStatus =%x\n",Status);
dprintf("NtDeleteKey : ");
Status=NtDeleteKey(hKey);
dprintf("\t\t\t\tStatus =%x\n",Status);
NtClose(hKey);
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\Software\\test3reactos");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
dprintf("NtOpenKey : ");
Status=NtOpenKey( &hKey, KEY_ALL_ACCESS, &ObjectAttributes);
dprintf("\t\t\t\tStatus =%x\n",Status);
dprintf("NtDeleteKey : ");
Status=NtDeleteKey(hKey);
dprintf("\t\t\t\tStatus =%x\n",Status);
NtClose(hKey);
}
void test4(void)
{
HKEY hKey = NULL,hKey1;
DWORD dwDisposition;
DWORD dwError;
DWORD RegDataType, RegDataSize;
BOOL GlobalFifoEnable;
HKEY hPortKey;
DWORD RegDisposition;
WCHAR szClass[260];
DWORD cchClass;
DWORD cSubKeys;
DWORD cchMaxSubkey;
DWORD cchMaxClass;
DWORD cValues;
DWORD cchMaxValueName;
DWORD cbMaxValueData;
DWORD cbSecurityDescriptor;
FILETIME ftLastWriteTime;
SYSTEMTIME LastWriteTime;
dprintf ("RegOpenKeyExW HKLM\\System\\Setup: ");
dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
L"System\\Setup",
0,
KEY_ALL_ACCESS,
&hKey1);
dprintf("\t\tdwError =%x\n",dwError);
if (dwError == ERROR_SUCCESS)
{
dprintf("RegQueryInfoKeyW: ");
cchClass=260;
dwError = RegQueryInfoKeyW(hKey1
, szClass, &cchClass, NULL, &cSubKeys
, &cchMaxSubkey, &cchMaxClass, &cValues, &cchMaxValueName
, &cbMaxValueData, &cbSecurityDescriptor, &ftLastWriteTime);
dprintf ("\t\t\t\tdwError %x\n", dwError);
FileTimeToSystemTime(&ftLastWriteTime,&LastWriteTime);
dprintf ("\tnb of subkeys=%d,last write : %d/%d/%d %d:%02.2d'%02.2d''%03.3d\n",cSubKeys
,LastWriteTime.wMonth
,LastWriteTime.wDay
,LastWriteTime.wYear
,LastWriteTime.wHour
,LastWriteTime.wMinute
,LastWriteTime.wSecond
,LastWriteTime.wMilliseconds
);
}
dprintf ("RegOpenKeyExW: ");
dwError = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
L"System\\ControlSet001\\Services\\Serial",
0,
KEY_ALL_ACCESS,
&hKey);
dprintf ("\t\t\t\t\tdwError %x\n", dwError);
RegDataSize = sizeof(GlobalFifoEnable);
if (dwError == ERROR_SUCCESS)
{
dprintf ("RegQueryValueExW: ");
dwError = RegQueryValueExW(hKey,
L"ForceFifoEnable",
NULL,
&RegDataType,
(PBYTE)&GlobalFifoEnable,
&RegDataSize);
dprintf("\t\t\t\tdwError =%x\n",dwError);
if (dwError == 0)
{
dprintf("\tValue:DT=%d, DS=%d, Value=%d\n"
,RegDataType
,RegDataSize
,GlobalFifoEnable);
}
}
dprintf ("RegCreateKeyExW: ");
dwError = RegCreateKeyExW(hKey,
L"Parameters\\Serial001",
0,
NULL,
0,
KEY_ALL_ACCESS,
NULL,
&hPortKey,
&RegDisposition
);
dprintf ("\t\t\t\tdwError %x\n", dwError);
dprintf ("RegCreateKeyExW: ");
dwError = RegCreateKeyExW (HKEY_LOCAL_MACHINE,
L"Software\\test4reactos\\test",
0,
NULL,
REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS,
NULL,
&hKey,
&dwDisposition);
dprintf ("\t\t\t\tdwError %x ", dwError);
dprintf ("dwDisposition %x\n", dwDisposition);
if (dwError == ERROR_SUCCESS)
{
dprintf ("RegSetValueExW: ");
dwError = RegSetValueExW (hKey,
L"TestValue",
0,
REG_SZ,
(BYTE*)L"TestString",
20);
dprintf ("\t\t\t\tdwError %x\n", dwError);
dprintf ("RegCloseKey: ");
dwError = RegCloseKey (hKey);
dprintf ("\t\t\t\t\tdwError %x\n", dwError);
}
dprintf ("\n\n");
hKey = NULL;
dprintf ("RegCreateKeyExW: ");
dwError = RegCreateKeyExW (HKEY_LOCAL_MACHINE,
L"software\\Test",
0,
NULL,
REG_OPTION_VOLATILE,
KEY_ALL_ACCESS,
NULL,
&hKey,
&dwDisposition);
dprintf ("\t\t\t\tdwError %x ", dwError);
dprintf ("dwDisposition %x\n", dwDisposition);
if (dwError == ERROR_SUCCESS)
{
dprintf("RegQueryInfoKeyW: ");
cchClass=260;
dwError = RegQueryInfoKeyW(hKey
, szClass, &cchClass, NULL, &cSubKeys
, &cchMaxSubkey, &cchMaxClass, &cValues, &cchMaxValueName
, &cbMaxValueData, &cbSecurityDescriptor, &ftLastWriteTime);
dprintf ("\t\t\t\tdwError %x\n", dwError);
FileTimeToSystemTime(&ftLastWriteTime,&LastWriteTime);
dprintf ("\tnb of subkeys=%d,last write : %d/%d/%d %d:%02.2d'%02.2d''%03.3d\n",cSubKeys
,LastWriteTime.wMonth
,LastWriteTime.wDay
,LastWriteTime.wYear
,LastWriteTime.wHour
,LastWriteTime.wMinute
,LastWriteTime.wSecond
,LastWriteTime.wMilliseconds
);
dprintf ("RegCloseKey: ");
dwError = RegCloseKey (hKey);
dprintf ("\t\t\t\t\tdwError %x\n", dwError);
}
dprintf ("\nTests done...\n");
}
void test5(void)
{
HKEY hKey,hKey1;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName,ValueName;
NTSTATUS Status;
KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
ULONG Index,Length,i;
char Buffer[10];
DWORD Result;
dprintf("NtOpenKey : \n");
dprintf(" \\Registry\\Machine\\Software\\reactos : ");
RtlInitUnicodeStringFromLiteral(&KeyName,L"\\Registry\\Machine\\Software\\reactos");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, NULL, NULL);
Status=NtOpenKey( &hKey, KEY_ALL_ACCESS, &ObjectAttributes);
dprintf("\t\tStatus=%x\n",Status);
dprintf("NtFlushKey : \n");
Status = NtFlushKey(hKey);
dprintf("\t\tStatus=%x\n",Status);
dprintf("NtCloseKey : \n");
Status=NtClose(hKey);
dprintf("\t\tStatus=%x\n",Status);
}
/* registry link create test */
void test6(void)
{
HKEY hKey;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName,ValueName;
NTSTATUS Status;
KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
ULONG Index,Length,i;
char Buffer[10];
DWORD Result;
dprintf("Create target key\n");
dprintf(" Key: \\Registry\\Machine\\SOFTWARE\\Reactos\n");
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\SOFTWARE\\Reactos");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, NULL, NULL);
Status = NtCreateKey(&hKey, KEY_ALL_ACCESS , &ObjectAttributes
,0,NULL, REG_OPTION_VOLATILE,NULL);
dprintf(" NtCreateKey() called (Status %lx)\n",Status);
if (!NT_SUCCESS(Status))
return;
dprintf("Create target value\n");
dprintf(" Value: TestValue = 'Test String'\n");
RtlInitUnicodeStringFromLiteral(&ValueName, L"TestValue");
Status=NtSetValueKey(hKey,&ValueName,0,REG_SZ,(PVOID)L"TestString",22);
dprintf(" NtSetValueKey() called (Status %lx)\n",Status);
if (!NT_SUCCESS(Status))
return;
dprintf("Close target key\n");
NtClose(hKey);
dprintf("Create link key\n");
dprintf(" Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\SOFTWARE\\Test");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE | OBJ_OPENLINK,
NULL,
NULL);
Status = NtCreateKey(&hKey,
KEY_ALL_ACCESS | KEY_CREATE_LINK,
&ObjectAttributes,
0,
NULL,
REG_OPTION_VOLATILE | REG_OPTION_CREATE_LINK,
NULL);
dprintf(" NtCreateKey() called (Status %lx)\n",Status);
if (!NT_SUCCESS(Status))
return;
dprintf("Create link value\n");
dprintf(" Value: SymbolicLinkValue = '\\Registry\\Machine\\SOFTWARE\\Reactos'\n");
RtlInitUnicodeStringFromLiteral(&ValueName, L"SymbolicLinkValue");
Status=NtSetValueKey(hKey,&ValueName,0,REG_LINK,(PVOID)L"\\Registry\\Machine\\SOFTWARE\\Reactos",68);
dprintf(" NtSetValueKey() called (Status %lx)\n",Status);
if (!NT_SUCCESS(Status))
{
dprintf("Creating link value failed! Test failed!\n");
NtClose(hKey);
return;
}
dprintf("Close link key\n");
NtClose(hKey);
dprintf("Open link key\n");
dprintf(" Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\SOFTWARE\\Test");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE | OBJ_OPENIF
, NULL, NULL);
Status = NtCreateKey(&hKey, KEY_ALL_ACCESS , &ObjectAttributes
,0,NULL, REG_OPTION_VOLATILE, NULL);
dprintf(" NtCreateKey() called (Status %lx)\n",Status);
if (!NT_SUCCESS(Status))
return;
dprintf("Query value\n");
dprintf(" Value: TestValue\n");
RtlInitUnicodeStringFromLiteral(&ValueName, L"TestValue");
Status=NtQueryValueKey(hKey,
&ValueName,
KeyValueFullInformation,
&KeyValueInformation[0],
sizeof(KeyValueInformation),
&Length);
dprintf(" NtQueryValueKey() called (Status %lx)\n",Status);
if (Status == STATUS_SUCCESS)
{
dprintf(" Value: Type %d DataLength %d NameLength %d Name '",
KeyValueInformation[0].Type,
KeyValueInformation[0].DataLength,
KeyValueInformation[0].NameLength);
for (i=0; i < KeyValueInformation[0].NameLength / sizeof(WCHAR); i++)
dprintf("%C",KeyValueInformation[0].Name[i]);
dprintf("'\n");
if (KeyValueInformation[0].Type == REG_SZ)
dprintf(" Value '%S'\n",
KeyValueInformation[0].Name+1
+KeyValueInformation[0].NameLength/2);
}
dprintf("Close link key\n");
NtClose(hKey);
dprintf("Test successful!\n");
}
/* registry link delete test */
void test7(void)
{
HKEY hKey;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName,ValueName;
NTSTATUS Status;
dprintf("Open link key\n");
dprintf(" Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine\\SOFTWARE\\Test");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE | OBJ_OPENIF | OBJ_OPENLINK,
NULL,
NULL);
Status = NtCreateKey(&hKey,
KEY_ALL_ACCESS,
&ObjectAttributes,
0,
NULL,
REG_OPTION_VOLATILE | REG_OPTION_OPEN_LINK,
NULL);
dprintf(" NtCreateKey() called (Status %lx)\n",Status);
if (!NT_SUCCESS(Status))
{
dprintf("Could not open the link key. Please run the link create test first!\n");
return;
}
dprintf("Delete link value\n");
RtlInitUnicodeStringFromLiteral(&ValueName, L"SymbolicLinkValue");
Status = NtDeleteValueKey(hKey,
&ValueName);
dprintf(" NtDeleteValueKey() called (Status %lx)\n",Status);
dprintf("Delete link key\n");
Status=NtDeleteKey(hKey);
dprintf(" NtDeleteKey() called (Status %lx)\n",Status);
dprintf("Close link key\n");
NtClose(hKey);
}
void test8(void)
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName;
NTSTATUS Status;
LONG dwError;
TOKEN_PRIVILEGES NewPrivileges;
HANDLE Token,hKey;
LUID Luid;
BOOLEAN bRes;
Status=NtOpenProcessToken(GetCurrentProcess()
,TOKEN_ADJUST_PRIVILEGES,&Token);
// ,TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY,&Token);
dprintf("\t\t\t\tStatus =%x\n",Status);
// bRes=LookupPrivilegeValueA(NULL,SE_RESTORE_NAME,&Luid);
// dprintf("\t\t\t\tbRes =%x\n",bRes);
NewPrivileges.PrivilegeCount = 1;
NewPrivileges.Privileges[0].Luid = Luid;
// NewPrivileges.Privileges[0].Luid.u.LowPart=18;
// NewPrivileges.Privileges[0].Luid.u.HighPart=0;
NewPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
// Status = NtAdjustPrivilegesToken(
bRes = AdjustTokenPrivileges(
Token,
FALSE,
&NewPrivileges,
0,
NULL,
NULL
);
dprintf("\t\t\t\tbRes =%x\n",bRes);
// Status=NtClose(Token);
// dprintf("\t\t\t\tStatus =%x\n",Status);
RtlInitUnicodeStringFromLiteral(&KeyName,L"test5");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, NULL, NULL);
Status = NtLoadKey(HKEY_LOCAL_MACHINE,&ObjectAttributes);
dprintf("\t\t\t\tStatus =%x\n",Status);
dwError=RegLoadKey(HKEY_LOCAL_MACHINE,"def"
,"test5");
dprintf("\t\t\t\tdwError =%x\n",dwError);
dprintf("NtOpenKey \\Registry\\Machine : ");
RtlInitUnicodeStringFromLiteral(&KeyName, L"\\Registry\\Machine");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status=NtOpenKey( &hKey, MAXIMUM_ALLOWED, &ObjectAttributes);
dprintf("\t\t\tStatus =%x\n",Status);
RtlInitUnicodeStringFromLiteral(&KeyName,L"test5");
InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE
, NULL, NULL);
Status = NtLoadKey(hKey,&ObjectAttributes);
dprintf("\t\t\t\tStatus =%x\n",Status);
}
int main(int argc, char* argv[])
{
char Buffer[10];
DWORD Result;
AllocConsole();
InputHandle = GetStdHandle(STD_INPUT_HANDLE);
OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);
while(1)
{
dprintf("choose test :\n");
dprintf(" 0=Exit\n");
dprintf(" 1=Ntxxx read functions\n");
dprintf(" 2=Ntxxx write functions : volatile keys\n");
dprintf(" 3=Ntxxx write functions : non volatile keys\n");
dprintf(" 4=Regxxx functions\n");
dprintf(" 5=FlushKey \n");
dprintf(" 6=Registry link create test\n");
dprintf(" 7=Registry link delete test\n");
ReadConsoleA(InputHandle, Buffer, 3, &Result, NULL) ;
switch (Buffer[0])
{
case '0':
return(0);
case '1':
test1();
break;
case '2':
test2();
break;
case '3':
test3();
break;
case '4':
test4();
break;
case '5':
test5();
break;
case '6':
test6();
break;
case '7':
test7();
break;
#if 0
case '8':
test8();
break;
#endif
}
}
return 0;
}

View File

@@ -0,0 +1,19 @@
# $Id: Makefile,v 1.3 2002/06/02 19:25:00 chorns Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = sectest
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,71 @@
/* $Id: sectest.c,v 1.4 2002/09/08 10:22:01 chorns Exp $ */
#define UNICODE
#define _UNICODE
#include <windows.h>
int main(int argc, char* argv[])
{
HANDLE hFile;
HANDLE Section;
PVOID BaseAddress;
printf("Section Test\n");
hFile = CreateFile(_T("sectest.txt"),
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
CREATE_ALWAYS,
0,
0);
if (hFile == INVALID_HANDLE_VALUE)
{
printf("Failed to create file (err=%d)", GetLastError());
return 1;
}
Section = CreateFileMapping(hFile,
NULL,
PAGE_READWRITE,
0,
4096,
NULL);
if (Section == NULL)
{
printf("Failed to create section (err=%d)", GetLastError());
return 1;
}
printf("Mapping view of section\n");
BaseAddress = MapViewOfFile(Section,
FILE_MAP_ALL_ACCESS,
0,
0,
4096);
printf("BaseAddress %x\n", (UINT) BaseAddress);
if (BaseAddress == NULL)
{
printf("Failed to map section (%d)\n", GetLastError());
return 1;
}
printf("Clearing section\n");
FillMemory(BaseAddress, 4096, ' ');
printf("Copying test data to section\n");
strcpy(BaseAddress, "test data");
if (!UnmapViewOfFile(BaseAddress))
{
printf("Failed to unmap view of file (%d)\n", GetLastError());
return 1;
}
if (!CloseHandle(hFile))
{
printf("Failed to close file (%d)\n", GetLastError());
return 1;
}
return 0;
}

View File

@@ -0,0 +1,22 @@
#
# $Id: makefile,v 1.0
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = sertest
TARGET_SDKLIBS = ntdll.a kernel32.a advapi32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,113 @@
#include <windows.h>
#include <stdio.h>
#define BUFSIZE 128
#define MAX_PORTNAME_LEN 20
#define APP_VERSION_STR "0.01"
int main(int argc, char *argv[])
{
CHAR txBuffer[BUFSIZE];
CHAR rxBuffer[BUFSIZE];
DWORD dwBaud = 9600;
DWORD dwNumWritten;
DWORD dwNumRead;
DWORD dwErrors;
DCB dcb;
BOOL bResult;
HANDLE hPort;
int i;
int nPortNum = 1;
TCHAR szPortName[MAX_PORTNAME_LEN];
if (argc > 1) {
//sscanf(argv[1], "%d", &dwBaud);
sscanf(argv[1], "%d", &nPortNum);
}
sprintf(szPortName, _T("COM%d"), nPortNum);
printf("Serial Port Test Application Version %s\n", APP_VERSION_STR);
printf("Attempting to open serial port %d - %s\n", nPortNum, szPortName);
hPort = CreateFile(szPortName,
GENERIC_READ|GENERIC_WRITE,
0, // exclusive
NULL, // sec attr
OPEN_EXISTING,
0, // no attributes
NULL); // no template
if (hPort == (HANDLE)-1) {
printf("ERROR: CreateFile() failed with result: %lx\n", hPort);
return 1;
}
printf("CreateFile() returned: %lx\n", hPort);
printf("Fiddling with DTR and RTS control lines...\n");
bResult = EscapeCommFunction(hPort, SETDTR);
if (!bResult) {
printf("WARNING: EscapeCommFunction(SETDTR) failed: %lx\n", bResult);
}
bResult = EscapeCommFunction(hPort, SETRTS);
if (!bResult) {
printf("WARNING: EscapeCommFunction(SETRTS) failed: %lx\n", bResult);
}
printf("Getting the default line characteristics...\n");
dcb.DCBlength = sizeof(DCB);
if (!GetCommState(hPort, &dcb)) {
printf("ERROR: failed to get the dcb: %d\n", GetLastError());
return 2;
}
printf("Setting the line characteristics to 9600,8,N,1\n");
dcb.BaudRate = dwBaud;
dcb.ByteSize = 8;
dcb.Parity = NOPARITY;
dcb.StopBits = ONESTOPBIT;
bResult = SetCommState(hPort, &dcb);
if (!bResult) {
printf("ERROR: failed to set the comm state: %lx\n", bResult);
return 3;
}
printf("INFO: preparing the transmit buffer: %lx\n", bResult);
for (i = 0; i < BUFSIZE; i++) {
txBuffer[i] = (CHAR)i;
}
for (i = 0; i < BUFSIZE; i++) {
printf(" %d ", txBuffer[i]);
}
for (i = 0; i < BUFSIZE; i++) {
rxBuffer[i] = 0xFF;
}
printf("\n");
printf("Writting transmit buffer to the serial port\n");
bResult = WriteFile(hPort, txBuffer, BUFSIZE, &dwNumWritten, NULL);
if (!bResult) {
printf("ERROR: failed to write to the serial port: %lx\n", bResult);
return 4;
}
printf("WriteFile() returned: %lx, byteswritten: %lx\n", bResult, dwNumWritten);
#if 0
printf("Attempting to read %d bytes from the serial port\n", BUFSIZE);
bResult = ReadFile(hPort, rxBuffer, BUFSIZE, &dwNumRead, NULL);
if (!bResult) {
printf("ERROR: failed to read from the serial port: %lx\n", bResult);
return 5;
}
printf("ReadFile() returned: %lx, bytesread: %lx\n", bResult, dwNumRead);
for (i = 0; i < BUFSIZE; i++) {
printf(" %d ",rxBuffer[i]);
}
#endif
printf("Attempting to close the serial port\n");
bResult = ClearCommError(hPort, &dwErrors, NULL);
printf("ClearCommError returned: %lx, dwErrors: %lx\n", bResult, dwErrors);
bResult = CloseHandle(hPort);
if (!bResult) {
printf("ERROR: failed to close the serial port: %lx\n", bResult);
return 6;
}
printf("Finished\n");
return 0;
}

View File

@@ -0,0 +1,47 @@
#
#
#
PATH_TO_TOP = ../../..
include $(PATH_TO_TOP)/rules.mak
SRV_OBJECTS= shmsrv.o
CLT_OBJECTS= shmclt.o
PROGS= shmsrv.exe shmclt.exe
BASE_CFLAGS = -I$(PATH_TO_TOP)/include
LIBS = $(SDK_PATH_LIB)/kernel32.a \
$(SDK_PATH_LIB)/ntdll.a
all: $(PROGS)
.phony: all
implib:
clean:
- $(RM) *.o *.exe *.sym
.phony: implib clean
install: $(PROGS:%=$(INSTALL_DIR)/bin/%)
$(PROGS:%=$(INSTALL_DIR)/bin/%): $(INSTALL_DIR)/bin/%: %
$(CP) $* $(INSTALL_DIR)/bin/$*
dist: $(PROGS:%=$(DIST_DIR)/apps/%)
$(PROGS:%=$(DIST_DIR)/apps/%): $(DIST_DIR)/apps/%: %
$(CP) $* $(DIST_DIR)/apps/$*
shmsrv.exe: $(SRV_OBJECTS) $(LIBS)
$(CC) $(SRV_OBJECTS) $(LIBS) -o shmsrv.exe
$(NM) --numeric-sort shmsrv.exe > shmsrv.sym
shmclt.exe: $(CLT_OBJECTS) $(LIBS)
$(CC) $(CLT_OBJECTS) $(LIBS) -o shmclt.exe
$(NM) --numeric-sort shmsrv.exe > shmclt.sym
# EOF

View File

@@ -25,9 +25,9 @@ main(int argc, char* argv[])
HANDLE Section;
PVOID BaseAddress;
char buffer[256];
printf("Shm test server\n");
Section = OpenFileMappingW (
// PAGE_EXECUTE_READWRITE, invalid parameter
FILE_MAP_WRITE,
@@ -39,7 +39,7 @@ main(int argc, char* argv[])
printf("Failed to open section (err=%d)", GetLastError());
return 1;
}
BaseAddress = MapViewOfFile(Section,
FILE_MAP_ALL_ACCESS,
0,
@@ -54,7 +54,7 @@ main(int argc, char* argv[])
printf("Copying from section\n");
strcpy(buffer, BaseAddress);
printf("Copyed <%s>\n", buffer);
// for(;;);
return 0;
}

View File

@@ -1,4 +1,5 @@
/*
/* $Id: shmsrv.c,v 1.5 2000/06/29 23:35:10 dwelch Exp $
*
* FILE : reactos/apps/shm/shmsrv.c
* AUTHOR: David Welch
*/
@@ -12,13 +13,13 @@ int main(int argc, char* argv[])
{
HANDLE Section;
PVOID BaseAddress;
printf("Shm test server\n");
Section = CreateFileMappingW (
(HANDLE) 0xFFFFFFFF,
NULL,
PAGE_READWRITE,
PAGE_READWRITE,
0,
8192,
L"TestSection"
@@ -28,7 +29,7 @@ int main(int argc, char* argv[])
printf("Failed to create section (err=%d)", GetLastError());
return 1;
}
printf("Mapping view of section\n");
BaseAddress = MapViewOfFile(Section,
FILE_MAP_ALL_ACCESS,
@@ -40,11 +41,11 @@ int main(int argc, char* argv[])
{
printf("Failed to map section\n");
}
printf("Copying to section\n");
printf("Copying %s\n", GetCommandLineA());
strcpy(BaseAddress, GetCommandLineA());
Sleep(INFINITE);
return 0;

View File

@@ -0,0 +1,20 @@
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = windows
TARGET_NAME = simple
TARGET_SDKLIBS = kernel32.a gdi32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -0,0 +1,15 @@
/*
* The simplest Windows program you will ever write.
*
* This source code is in the PUBLIC DOMAIN and has NO WARRANTY.
*
* Colin Peters <colinp at ma.kcom.ne.jp>, July 1, 2001.
*/
#include <windows.h>
int STDCALL
WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
{
MessageBox (NULL, "Hello, ReactOS!", "Hello", MB_OK);
return 0;
}

View File

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 87 KiB

View File

@@ -0,0 +1,66 @@
# Makefile - Proj_Listing1_5.dsp
ifndef CFG
CFG=Proj_Listing1_5 - Win32 Debug
endif
CC=gcc
CFLAGS=
CXX=g++
CXXFLAGS=$(CFLAGS)
RC=windres -O COFF
ifeq "$(CFG)" "Proj_Listing1_5 - Win32 Release"
CFLAGS+=-fexceptions -O2 -DWIN32 -DNDEBUG -D_WINDOWS -D_MBCS -W
LD=$(CXX) $(CXXFLAGS)
LDFLAGS=
LDFLAGS+=-Wl,--subsystem,windows
LIBS+=-lkernel32 -luser32 -lgdi32
else
ifeq "$(CFG)" "Proj_Listing1_5 - Win32 Debug"
CFLAGS+=-fexceptions -g -O0 -DWIN32 -D_DEBUG -D_WINDOWS -D_MBCS -W
LD=$(CXX) $(CXXFLAGS)
LDFLAGS=
LDFLAGS+=-Wl,--subsystem,windows
LIBS+=-lkernel32 -luser32 -lgdi32
endif
endif
ifndef TARGET
TARGET=stretchblt.exe
endif
.PHONY: all
all: $(TARGET)
%.o: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -o $@ -c $<
%.res: %.rc
$(RC) $(CPPFLAGS) -o $@ -i $<
SOURCE_FILES= \
stretchblt.cpp
HEADER_FILES=
RESOURCE_FILES=
SRCS=$(SOURCE_FILES) $(HEADER_FILES) $(RESOURCE_FILES)
OBJS=$(patsubst %.rc,%.res,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(filter %.c %.cpp %.rc,$(SRCS)))))
$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
.PHONY: clean
clean:
-del $(OBJS) $(TARGET)
.PHONY: depends
depends:
-$(CXX) $(CXXFLAGS) $(CPPFLAGS) -MM $(filter %.c %.cpp,$(SRCS)) > Proj_Listing1_5.dep
-include Proj_Listing1_5.dep

View File

@@ -0,0 +1,258 @@
// ------------------------------------------------------------------
// Windows 2000 Graphics API Black Book
// Chapter 1 - Listing 1.5 (StretchBlt Zooming Demo)
//
// Created by Damon Chandler <dmc27@ee.cornell.edu>
// Updates can be downloaded at: <www.coriolis.com>
//
// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
// if you have any questions about this code.
// ------------------------------------------------------------------
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#include <windows.h>
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
HWND HListBox = NULL;
const int ID_LISTBOX = 101;
HINSTANCE HInst;
const char* WndClassName = "GMainWnd";
LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
LPARAM LParam);
int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
LPTSTR lpCmdLine, int nCmdShow)
{
HInst = HInstance;
WNDCLASS wc;
memset(&wc, 0, sizeof(WNDCLASS));
wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
wc.lpfnWndProc = MainWndProc;
wc.hInstance = HInstance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = reinterpret_cast<HBRUSH>(COLOR_BTNFACE + 1);
wc.lpszClassName = WndClassName;
if (RegisterClass(&wc))
{
HWND HWnd =
CreateWindow(WndClassName, TEXT("StretchBlt Zooming Demo"),
WS_OVERLAPPEDWINDOW | WS_CAPTION |
WS_VISIBLE | WS_CLIPSIBLINGS,
0, 0, 675, 560,
NULL, NULL, HInst, NULL);
if (HWnd)
{
HListBox =
CreateWindowEx(WS_EX_CLIENTEDGE, "LISTBOX", "",
LBS_NOTIFY | WS_CHILD | WS_VISIBLE,
530, 5, 130, 150, HWnd,
reinterpret_cast<HMENU>(ID_LISTBOX),
HInst, NULL);
if (HListBox)
{
SNDMSG(HListBox, LB_ADDSTRING, 0,
reinterpret_cast<LPARAM>("Zoom 25%"));
SNDMSG(HListBox, LB_ADDSTRING, 0,
reinterpret_cast<LPARAM>("Zoom 50%"));
SNDMSG(HListBox, LB_ADDSTRING, 0,
reinterpret_cast<LPARAM>("Zoom 75%"));
SNDMSG(HListBox, LB_ADDSTRING, 0,
reinterpret_cast<LPARAM>("Zoom 100%"));
SNDMSG(HListBox, LB_ADDSTRING, 0,
reinterpret_cast<LPARAM>("Zoom 125%"));
SNDMSG(HListBox, LB_ADDSTRING, 0,
reinterpret_cast<LPARAM>("Zoom 150%"));
SNDMSG(HListBox, LB_ADDSTRING, 0,
reinterpret_cast<LPARAM>("Zoom 200%"));
SNDMSG(HListBox, LB_ADDSTRING, 0,
reinterpret_cast<LPARAM>("Zoom 300%"));
}
ShowWindow(HWnd, nCmdShow);
UpdateWindow(HWnd);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
return 0;
}
//------------------------------------------------------------------
// image related
BITMAP bmp;
const char* filename = "LENA.BMP";
HDC HMemDC = NULL;
HBITMAP HOldBmp = NULL;
// zooming related
float zoom_factor = 0.5;
RECT RDest = {5, 5, 0, 0};
enum {ID_ZOOM25, ID_ZOOM50, ID_ZOOM75, ID_ZOOM100,
ID_ZOOM125, ID_ZOOM150, ID_ZOOM200, ID_ZOOM300};
LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
LPARAM LParam)
{
switch (Msg)
{
case WM_CREATE:
{
// create a memory DC
HMemDC = CreateCompatibleDC(NULL);
if (HMemDC)
{
// load a bitmap from file
HBITMAP HBmp =
static_cast<HBITMAP>(
LoadImage(HInst, filename, IMAGE_BITMAP,
0, 0, LR_LOADFROMFILE)
);
if (HBmp)
{
// extract dimensions of the bitmap
GetObject(HBmp, sizeof(BITMAP), &bmp);
// associate the bitmap with the memory DC
HOldBmp = static_cast<HBITMAP>(
SelectObject(HMemDC, HBmp)
);
}
}
}
case WM_COMMAND:
{
if (WParam == MAKEWPARAM(ID_LISTBOX, LBN_SELCHANGE))
{
switch (SNDMSG(HListBox, LB_GETCURSEL, 0, 0))
{
case ID_ZOOM25: zoom_factor = 0.25; break;
case ID_ZOOM50: zoom_factor = 0.50; break;
case ID_ZOOM75: zoom_factor = 0.75; break;
case ID_ZOOM100: zoom_factor = 1.00; break;
case ID_ZOOM125: zoom_factor = 1.25; break;
case ID_ZOOM150: zoom_factor = 1.50; break;
case ID_ZOOM200: zoom_factor = 2.00; break;
case ID_ZOOM300: zoom_factor = 3.00; break;
}
// calculate the new width and height
const int new_width =
static_cast<int>(zoom_factor * bmp.bmWidth);
const int new_height =
static_cast<int>(zoom_factor * bmp.bmHeight);
// is zooming in?
bool zoom_in = (new_width > RDest.right - RDest.left);
// caculate the area that needs to be updated
RECT RUpdate = {
RDest.left, RDest.top,
RDest.left + max(new_width, RDest.right - RDest.left),
RDest.top + max(new_height, RDest.bottom - RDest.top)
};
// adjust the dimenstions of the
// destination rectangle
RDest.right = RDest.left + new_width;
RDest.bottom = RDest.top + new_height;
// create an update region from the XOR combination
// of the update and destination rectangles
HRGN HUpdateRgn = CreateRectRgnIndirect(&RUpdate);
HRGN HDestRgn = CreateRectRgnIndirect(&RDest);
int result =
CombineRgn(HUpdateRgn, HUpdateRgn, HDestRgn, RGN_XOR);
// incite a repaint
if (result != NULLREGION && result != ERROR)
{
InvalidateRgn(HWnd, HUpdateRgn, true);
RedrawWindow(HWnd, &RDest, NULL, RDW_NOERASE | RDW_INVALIDATE);
}
else if (result == NULLREGION)
{
InvalidateRect(HWnd, &RUpdate, zoom_in ? false : true);
}
// clean up
DeleteObject(HUpdateRgn);
DeleteObject(HDestRgn);
}
break;
}
case WM_PAINT:
{
PAINTSTRUCT ps;
const HDC Hdc = BeginPaint(HWnd, &ps);
try
{
//
// TODO: add palette support (see Chapter 9)...
//
if (RDest.right - RDest.left > 0)
{
// use BitBlt when not zooming
if (zoom_factor == 1.0)
{
BitBlt(Hdc, RDest.left, RDest.top,
RDest.right - RDest.left,
RDest.bottom - RDest.top,
HMemDC, 0, 0,
SRCCOPY);
}
else
{
if (zoom_factor < 1.0)
{
SetStretchBltMode(Hdc, COLORONCOLOR);
}
// render the zoomed image
StretchBlt(Hdc, RDest.left, RDest.top,
RDest.right - RDest.left,
RDest.bottom - RDest.top,
HMemDC, 0, 0,
bmp.bmWidth, bmp.bmHeight,
SRCCOPY);
}
}
}
catch (...)
{
EndPaint(HWnd, &ps);
}
EndPaint(HWnd, &ps);
break;
}
case WM_DESTROY:
{
// clean up
DeleteObject(SelectObject(HMemDC, HOldBmp));
DeleteDC(HMemDC);
PostQuitMessage(0);
return 0;
}
}
return DefWindowProc(HWnd, Msg, WParam, LParam);
}
//------------------------------------------------------------------

View File

@@ -0,0 +1,21 @@
# $Id: makefile,v 1.1 2002/06/17 06:01:17 sedwards Exp $
PATH_TO_TOP = ../../..
TARGET_NORC = yes
TARGET_TYPE = program
TARGET_APPTYPE = console
TARGET_NAME = tcpsvr
TARGET_SDKLIBS = kernel32.a ws2_32.a
TARGET_OBJECTS = $(TARGET_NAME).o
include $(PATH_TO_TOP)/rules.mak
include $(TOOLS_PATH)/helper.mk
# EOF

View File

@@ -1,9 +1,9 @@
/* tcpServer.c
/* tcpServer.c
*
* Simple Winsock TCP server test.
* Later will be used as base for ReactOS telnetd
*
* HISTORY:
* Later will be used as base for ReactOS telnetd
*
* HISTORY:
* 6-15-02 - Added Winsock support to UNIX tcp test
* 6-16-02 - Removed Unix support
* 6-17-02 - Added extra comments to code
@@ -12,8 +12,6 @@
#include <winsock2.h>
#include <stdio.h>
#include <string.h>
#include <io.h>
#undef ERROR
#define SUCCESS 0
@@ -27,20 +25,20 @@
int read_line();
int main (int argc, char *argv[]) {
WORD wVersionRequested;
WSADATA WsaData;
INT Status;
int sd, newSd, cliLen;
struct sockaddr_in cliAddr, servAddr;
char line[MAX_MSG];
char line[MAX_MSG];
wVersionRequested = MAKEWORD(2, 2);
Status = WSAStartup(wVersionRequested, &WsaData);
if (Status != 0) {
printf("Could not initialize winsock dll.\n");
printf("Could not initialize winsock dll.\n");
return FALSE;
}
@@ -51,12 +49,12 @@ int main (int argc, char *argv[]) {
WSACleanup();
return ERROR;
}
/* bind server port */
servAddr.sin_family = AF_INET;
servAddr.sin_addr.s_addr = htonl(INADDR_ANY);
servAddr.sin_port = htons(SERVER_PORT);
if(bind(sd, (struct sockaddr *) &servAddr, sizeof(servAddr))<0) {
perror("cannot bind port ");
WSACleanup();
@@ -64,13 +62,13 @@ int main (int argc, char *argv[]) {
}
listen(sd,5);
while(1) {
printf("%s: \n"
"To start test, Please telnet to localhost (127.0.0.1) port 23 \n"
"When connected input raw data followed by End of Line\n"
"Test is now running on TCP port %u\n",argv[0],SERVER_PORT);
printf("%s: \n
To start test, Please telnet to localhost (127.0.0.1) port 23 \n
When connected input raw data followed by End of Line\n
Test is now running on TCP port %u\n",argv[0],SERVER_PORT);
cliLen = sizeof(cliAddr);
newSd = accept(sd, (struct sockaddr *) &cliAddr, &cliLen);
@@ -79,21 +77,21 @@ int main (int argc, char *argv[]) {
WSACleanup();
return ERROR;
}
/* init line */
memset(line,0x0,MAX_MSG);
/* receive segments */
while(read_line(newSd,line)!=ERROR) {
printf("%s: received from %s:TCP%d : %s\n", argv[0],
printf("%s: received from %s:TCP%d : %s\n", argv[0],
inet_ntoa(cliAddr.sin_addr),
ntohs(cliAddr.sin_port), line);
/* init line */
memset(line,0x0,MAX_MSG);
} /* while(read_line) */
} /* while (1) */
}
@@ -112,11 +110,11 @@ int main (int argc, char *argv[]) {
/* You can set END_CHAR to whatever means endofline for you. (0x0A is \n)*/
/* read_lin returns the number of bytes returned in line_to_return */
int read_line(int newSd, char *line_to_return) {
static int rcv_ptr=0;
static char rcv_msg[MAX_MSG];
static int n;
int offset;
int offset;
offset=0;
@@ -130,12 +128,12 @@ int read_line(int newSd, char *line_to_return) {
return ERROR;
} else if (n==0) {
printf(" connection closed by client\n");
closesocket(newSd);
close(newSd);
WSACleanup();
return ERROR;
}
}
/* if new data read on socket */
/* OR */
/* if another line is still in buffer */
@@ -146,15 +144,15 @@ int read_line(int newSd, char *line_to_return) {
offset++;
rcv_ptr++;
}
/* end of line + end of buffer => return line */
if(rcv_ptr==n-1) {
if(rcv_ptr==n-1) {
/* set last byte to END_LINE */
*(line_to_return+offset)=END_LINE;
rcv_ptr=0;
return ++offset;
}
}
/* end of line but still some data in buffer => return line */
if(rcv_ptr <n-1) {
/* set last byte to END_LINE */
@@ -167,9 +165,9 @@ int read_line(int newSd, char *line_to_return) {
/* wait for more data to arrive on socket */
if(rcv_ptr == n) {
rcv_ptr = 0;
}
}
} /* while */
}

View File

@@ -0,0 +1,11 @@
#include <stdio.h>
int
main (void)
{
int i;
puts ("This should print \"wow = I\" for I from 0 to 39 inclusive.");
for (i = 0; i < 40; i++)
printf ("%s = %d\n", "wow", i);
return 0;
}

View File

@@ -0,0 +1,53 @@
#include <stdio.h>
#include <string.h>
int
main (void)
{
FILE *f;
int i;
const char filename[] = "/tmp/bug3.test";
f = fopen(filename, "w+");
for (i=0; i<9000; i++)
putc ('x', f);
fseek (f, 8180L, 0);
fwrite ("Where does this text go?", 1, 24, f);
fflush (f);
rewind (f);
for (i=0; i<9000; i++)
{
int j;
if ((j = getc(f)) != 'x')
{
if (i != 8180)
{
printf ("Test FAILED!");
return 1;
}
else
{
char buf[25];
buf[0] = j;
fread (buf + 1, 1, 23, f);
buf[24] = '\0';
if (strcmp (buf, "Where does this text go?") != 0)
{
printf ("%s\nTest FAILED!\n", buf);
return 1;
}
i += 23;
}
}
}
fclose(f);
remove(filename);
puts ("Test succeeded.");
return 0;
}

View File

@@ -0,0 +1,73 @@
#
#
#
PATH_TO_TOP = ../..
PROGS= test-stdio tst-printf tstdiomisc bug2 bug3 \
temptest test-fseek test_rdwr testfsd time_t
all: $(PROGS:%=%.exe)
.phony: all
implib:
clean:
- $(RM) *.o *.exe *.sym
.phony: implib clean
install: # $(PROGS:%=$(FLOPPY_DIR)/apps/%.exe)
$(PROGS:%=$(FLOPPY_DIR)/apps/%.exe): $(FLOPPY_DIR)/apps/%.exe: %.exe
dist: $(PROGS:%=$(DIST_DIR)/apps/%.exe)
$(PROGS:%=$(DIST_DIR)/apps/%.exe): $(DIST_DIR)/apps/%.exe: %.exe
$(CP) $*.exe $(DIST_DIR)/apps/$*.exe
bug2.exe: bug2.c
$(CC) bug2.c -lkernel32 -o bug2.exe
$(NM) --numeric-sort bug2.exe > bug2.sym
bug3.exe: bug3.c
$(CC) bug3.c -lkernel32 -o bug3.exe
$(NM) --numeric-sort bug3.exe > bug3.sym
temptest.exe: temptest.c
$(CC) temptest.c -lkernel32 -o temptest.exe
$(NM) --numeric-sort temptest.exe > temptest.sym
test-fseek.exe: test-fseek.c
$(CC) test-fseek.c -lkernel32 -o test-fseek.exe
$(NM) --numeric-sort test-fseek.exe > test-fseek.sym
test-fwrite.exe: test-fwrite.c
$(CC) test-fwrite.c -lkernel32 -o test-fwrite.exe
$(NM) --numeric-sort test-fwrite.exe > test-fwrite.sym
test_rdwr.exe: test_rdwr.c
$(CC) test_rdwr.c -lkernel32 -o test_rdwr.exe
$(NM) --numeric-sort test_rdwr.exe > test_rdwr.sym
test-stdio.exe: test-stdio.c
$(CC) test-stdio.c -lkernel32 -o test-stdio.exe
$(NM) --numeric-sort test-stdio.exe > test-stdio.sym
tst-printf.exe: tst-printf.c
$(CC) tst-printf.c -lkernel32 -o tst-printf.exe
$(NM) --numeric-sort tst-printf.exe > tst-printf.sym
tstdiomisc.exe: tstdiomisc.c
$(CC) tstdiomisc.c -lkernel32 -o tstdiomisc.exe
$(NM) --numeric-sort tstdiomisc.exe > tstdiomisc.sym
testfsd.exe: testfsd.c testsuite.c
$(CC) testfsd.c testsuite.c -lkernel32 -o testfsd.exe
$(NM) --numeric-sort testfsd.exe > testfsd.sym
time_t.exe: time_t.c
$(CC) time_t.c -lkernel32 -o time_t.exe
$(NM) --numeric-sort time_t.exe > time_t.sym
include ../../rules.mak

View File

@@ -0,0 +1,27 @@
#include <stdio.h>
#include <string.h>
char *files[500];
int
main (int argc, char *argv[])
{
FILE *fp;
int i;
for (i = 0; i < 500; i++) {
files[i] = tempnam (NULL, "file");
if (files[i] == NULL) {
printf ("tempnam failed\n");
exit (1);
}
printf ("file: %s\n", files[i]);
fp = fopen (files[i], "w");
fclose (fp);
}
for (i = 0; i < 500; i++)
remove (files[i]);
exit (0);
}

View File

@@ -0,0 +1,85 @@
/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stdio.h>
#define TESTFILE "/tmp/test.dat"
int
main (void)
{
FILE *fp;
int i, j;
puts ("\nFile seek test");
fp = fopen (TESTFILE, "w");
if (fp == NULL)
{
perror (TESTFILE);
return 1;
}
for (i = 0; i < 256; i++)
putc (i, fp);
if (freopen (TESTFILE, "r", fp) != fp)
{
perror ("Cannot open file for reading");
return 1;
}
for (i = 1; i <= 255; i++)
{
printf ("%3d\n", i);
fseek (fp, (long) -i, SEEK_END);
if ((j = getc (fp)) != 256 - i)
{
printf ("SEEK_END failed %d\n", j);
break;
}
if (fseek (fp, (long) i, SEEK_SET))
{
puts ("Cannot SEEK_SET");
break;
}
if ((j = getc (fp)) != i)
{
printf ("SEEK_SET failed %d\n", j);
break;
}
if (fseek (fp, (long) i, SEEK_SET))
{
puts ("Cannot SEEK_SET");
break;
}
if (fseek (fp, (long) (i >= 128 ? -128 : 128), SEEK_CUR))
{
puts ("Cannot SEEK_CUR");
break;
}
if ((j = getc (fp)) != (i >= 128 ? i - 128 : i + 128))
{
printf ("SEEK_CUR failed %d\n", j);
break;
}
}
fclose (fp);
remove (TESTFILE);
puts ((i > 255) ? "Test succeeded." : "Test FAILED!");
return (i > 255) ? 0 : 1;
}

View File

@@ -0,0 +1,68 @@
#include <stdio.h>
#include <string.h>
int
main (int argc, char *argv[])
{
FILE *f = tmpfile ();
char obuf[99999], ibuf[sizeof obuf];
char *line;
size_t linesz;
if (! f)
{
perror ("tmpfile");
return 1;
}
if (fputs ("line\n", f) == EOF)
{
perror ("fputs");
return 1;
}
memset (obuf, 'z', sizeof obuf);
memset (ibuf, 'y', sizeof ibuf);
if (fwrite (obuf, sizeof obuf, 1, f) != 1)
{
perror ("fwrite");
return 1;
}
rewind (f);
line = NULL;
linesz = 0;
if (getline (&line, &linesz, f) != 5)
{
perror ("getline");
return 1;
}
if (strcmp (line, "line\n"))
{
puts ("Lines differ. Test FAILED!");
return 1;
}
if (fread (ibuf, sizeof ibuf, 1, f) != 1)
{
perror ("fread");
return 1;
}
if (memcmp (ibuf, obuf, sizeof ibuf))
{
puts ("Buffers differ. Test FAILED!");
return 1;
}
asprintf (&line, "\
GDB is free software and you are welcome to distribute copies of it\n\
under certain conditions; type \"show copying\" to see the conditions.\n\
There is absolutely no warranty for GDB; type \"show warranty\" for details.\n\
");
puts ("Test succeeded.");
return 0;
}

View File

@@ -0,0 +1,55 @@
#include <stdio.h>
#include <string.h>
int main()
{
char msg1[] = "testing _write\n";
char msg2[] = "testing putchar.";
char msg3[] = "testing printf.";
char tmpbuf[255];
FILE* f1;
write(1, msg1, strlen(msg1));
write(1, msg2, strlen(msg2));
putchar('o'); putchar('k'); putchar('\n');
write(1, msg3, strlen(msg3));
printf("ok\n");
printf("Testing fopen\n");
f1 = fopen("tmp.txt","w+b");
if (f1 == NULL)
{
printf("fopen failed\n");
return(1);
}
printf("Testing fwrite\n");
if (fwrite(msg1, 1, strlen(msg1)+1, f1) != (strlen(msg1)+1))
{
printf("fwrite failed\n");
return(1);
}
printf("Testing fread\n");
fseek(f1, 0, SEEK_SET);
if (fread(tmpbuf, 1, strlen(msg1)+1, f1) != (strlen(msg1)+1))
{
printf("fread failed\n");
return(1);
}
if (strcmp(tmpbuf,msg1) != 0)
{
printf("fread failed, data corrupt\n");
return(1);
}
printf("Testing fclose\n");
if (fclose(f1) != 0)
{
printf("fclose failed\n");
return(1);
}
return(0);
}

View File

@@ -0,0 +1,129 @@
/* Copyright (C) 1991, 1992, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int
main (int argc, char **argv)
{
static const char hello[] = "Hello, world.\n";
static const char replace[] = "Hewwo, world.\n";
static const size_t replace_from = 2, replace_to = 4;
char filename[FILENAME_MAX];
char *name = strrchr (*argv, '/');
char buf[BUFSIZ];
FILE *f;
int lose = 0;
if (name != NULL)
++name;
else
name = *argv;
(void) sprintf (filename, "/tmp/%s.test", name);
f = fopen (filename, "w+");
if (f == NULL)
{
perror (filename);
exit (1);
}
(void) fputs (hello, f);
rewind (f);
(void) fgets (buf, sizeof (buf), f);
rewind (f);
(void) fputs (buf, f);
rewind (f);
{
size_t i;
for (i = 0; i < replace_from; ++i)
{
int c = getc (f);
if (c == EOF)
{
printf ("EOF at %Zu.\n", i);
lose = 1;
break;
}
else if (c != hello[i])
{
printf ("Got '%c' instead of '%c' at %Zu.\n",
(unsigned char) c, hello[i], i);
lose = 1;
break;
}
}
}
{
long int where = ftell (f);
if (where == (long int) replace_from)
{
register size_t i;
for (i = replace_from; i < replace_to; ++i)
if (putc(replace[i], f) == EOF)
{
printf ("putc('%c') got %s at %Zu.\n",
replace[i], strerror (errno), i);
lose = 1;
break;
}
}
else if (where == -1L)
{
printf ("ftell got %s (should be at %Zu).\n",
strerror (errno), replace_from);
lose = 1;
}
else
{
printf ("ftell returns %lu; should be %Zu.\n", where, replace_from);
lose = 1;
}
}
if (!lose)
{
rewind (f);
if (fgets (buf, sizeof (buf), f) == NULL)
{
printf ("fgets got %s.\n", strerror(errno));
lose = 1;
}
else if (strcmp (buf, replace))
{
printf ("Read \"%s\" instead of \"%s\".\n", buf, replace);
lose = 1;
}
}
if (lose)
printf ("Test FAILED! Losing file is \"%s\".\n", filename);
else
{
(void) remove (filename);
puts ("Test succeeded.");
}
exit (lose ? EXIT_FAILURE : EXIT_SUCCESS);
}

Some files were not shown because too many files have changed in this diff Show More