mirror of
https://github.com/reactos/reactos
synced 2025-10-08 09:22:51 +02:00
Compare commits
1 Commits
alex-netwo
...
backups/po
Author | SHA1 | Date | |
---|---|---|---|
|
3a3d839af3 |
@@ -1,46 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<!--
|
|
||||||
Copyright (C) 2005 Casper S. Hornstrup
|
|
||||||
|
|
||||||
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 2 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, write to the Free Software
|
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
-->
|
|
||||||
<project name="ReactOS.ApiStatus" default="publish">
|
|
||||||
|
|
||||||
<property name="reactos.dir" value="reactos" />
|
|
||||||
<property name="apistatus.xsl" value="rapistatus.xsl" />
|
|
||||||
<property name="apistatus.xml" value="rapistatus.xml" />
|
|
||||||
<property name="apistatus.html" value="index2.html" />
|
|
||||||
<include buildfile="config.include" />
|
|
||||||
|
|
||||||
<target name="publish">
|
|
||||||
<delete dir="${reactos.dir}" if="${directory::exists(reactos.dir)}" />
|
|
||||||
<exec program="svn" commandline="export -r HEAD ${source.url} ${reactos.dir}" />
|
|
||||||
<exec program="rgenstat" commandline="reactos\apistatus.lst ${apistatus.xml}" />
|
|
||||||
<style style="${apistatus.xsl}" destdir="${reactos.dir}" in="${apistatus.xml}" out="${apistatus.html}" />
|
|
||||||
<copy todir="${publish.dir}" overwrite="true">
|
|
||||||
<fileset basedir=".">
|
|
||||||
<include name="${apistatus.xml}" />
|
|
||||||
<include name="${apistatus.html}" />
|
|
||||||
</fileset>
|
|
||||||
</copy>
|
|
||||||
<delete>
|
|
||||||
<fileset basedir=".">
|
|
||||||
<include name="${apistatus.xml}" />
|
|
||||||
<include name="${apistatus.html}" />
|
|
||||||
</fileset>
|
|
||||||
</delete>
|
|
||||||
<delete dir="${reactos.dir}" if="${directory::exists(reactos.dir)}" />
|
|
||||||
</target>
|
|
||||||
</project>
|
|
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright (C) 2005 Casper S. Hornstrup
|
|
||||||
|
|
||||||
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 2 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, write to the Free Software
|
|
||||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
-->
|
|
||||||
<project>
|
|
||||||
<property name="source.url" value="svn://svn.reactos.com/trunk/reactos" />
|
|
||||||
<property name="publish.dir" value="C:\api" />
|
|
||||||
</project>
|
|
@@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/* Rename to config.php */
|
|
||||||
|
|
||||||
define(ISO_BASE_URL, "http://www.server.com/iso/");
|
|
||||||
define(ISO_PATH, "C:\\iso\\");
|
|
||||||
|
|
||||||
?>
|
|
@@ -1,230 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
include ('config.php');
|
|
||||||
|
|
||||||
function dm_usort_cmp ($a, $b) {
|
|
||||||
if ($a == $b) return 0;
|
|
||||||
return ($a > $b) ? -1 : 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
function dm_usort_cmp_desc ($a, $b) {
|
|
||||||
if ($a == $b) return 0;
|
|
||||||
return ($a > $b) ? 1 : -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
function printHeader()
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>ReactOS Revison ISOs</title>
|
|
||||||
<meta name="generator" content="Editpad">
|
|
||||||
<meta name="keywords" content="OS, ReactOS, operating system">
|
|
||||||
<meta name="author" content="ReactOS Project (ros-dev@reactos.com)">
|
|
||||||
<style>
|
|
||||||
.box
|
|
||||||
{
|
|
||||||
padding: 0px;
|
|
||||||
background-color: #88aadd;
|
|
||||||
border-left: 1px solid #f0f0f0;
|
|
||||||
border-right: 1px solid #000000;
|
|
||||||
border-top: 1px solid #f0f0f0;
|
|
||||||
border-bottom: 1px solid #000000;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body bgcolor="#88aadd">
|
|
||||||
<form method="post" action="">
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
function printMenu($revision)
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<table border="0" class="box" cellpadding="5">
|
|
||||||
<tr>
|
|
||||||
<td height="2px">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
<table border="0" cellpadding="0" cellspacing="0">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<b>Branch:</b>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<select name="branch" tabindex="1">
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$d = dir(ISO_PATH);
|
|
||||||
$i = 0;
|
|
||||||
$dirlist = array();
|
|
||||||
while (false !== ($entry = $d->read())) {
|
|
||||||
if ((strcasecmp($entry, ".") != 0) && (strcasecmp($entry, "..") != 0) && is_dir(ISO_PATH . "\\" . $entry) == "dir") {
|
|
||||||
$dirlist[$i++] = $entry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$d->close();
|
|
||||||
|
|
||||||
if (is_array($dirlist)) {
|
|
||||||
usort($dirlist, "dm_usort_cmp");
|
|
||||||
reset($dirlist);
|
|
||||||
while (list($key, $val) = each($dirlist)) {
|
|
||||||
$branch = $val;
|
|
||||||
if ($branch == $_POST["branch"] || (!isset($_POST["branch"]) && $branch == "trunk"))
|
|
||||||
$selected = " selected";
|
|
||||||
else
|
|
||||||
$selected = "";
|
|
||||||
echo "<option$selected>$branch</option>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<b>Revision:</b>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<?php
|
|
||||||
echo "<input type=\"text\" name=\"revision\" size=\"10\" maxlength=\"10\" tabindex=\"2\" value=\"" . $revision . "\"></input>";
|
|
||||||
?>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input type="submit" name="getiso" value="Download" tabindex="3" style="border: 1px solid #000000"></input>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="7">
|
|
||||||
<hr size="2" width="100%" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="4">
|
|
||||||
<input type="submit" name="getnextiso" value="Next ISO" tabindex="4" style="border: 1px solid #000000"></input>
|
|
||||||
</td>
|
|
||||||
<td colspan="3" align="right">
|
|
||||||
<input type="submit" name="getlatestiso" value="Latest ISO" tabindex="5" style="border: 1px solid #000000"></input>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td height="2px">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
function printFooter()
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var revision = document.getElementById('revision');
|
|
||||||
if (revision) revision.focus();
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
|
|
||||||
function locateRevisionISO($branch, $revision, $latest)
|
|
||||||
{
|
|
||||||
$revision = intval($revision);
|
|
||||||
$path = ISO_PATH . "\\" . $branch;
|
|
||||||
$d = dir($path);
|
|
||||||
$i = 0;
|
|
||||||
$filelist = array();
|
|
||||||
while (false !== ($entry = $d->read())) {
|
|
||||||
if (is_dir($path . "\\" . $entry) != "dir")
|
|
||||||
$filelist[$i++] = $entry;
|
|
||||||
}
|
|
||||||
$d->close();
|
|
||||||
|
|
||||||
if (is_array($filelist)) {
|
|
||||||
$sortFunction = $latest ? "dm_usort_cmp" : "dm_usort_cmp_desc";
|
|
||||||
usort($filelist, $sortFunction);
|
|
||||||
reset($filelist);
|
|
||||||
while (list($key, $filename) = each($filelist)) {
|
|
||||||
if (ereg('ReactOS-' . $branch . '-r([0-9]*).iso', $filename, $regs))
|
|
||||||
{
|
|
||||||
$thisRevision = intval($regs[1]);
|
|
||||||
if (($latest) && ($thisRevision < $revision))
|
|
||||||
return $regs[1];
|
|
||||||
else if ($thisRevision > $revision)
|
|
||||||
return $regs[1];
|
|
||||||
$lastRevision = $thisRevision;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function getNextRevisionISO($branch, $revision)
|
|
||||||
{
|
|
||||||
return locateRevisionISO($branch, $revision, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getLatestRevisionISO($branch)
|
|
||||||
{
|
|
||||||
return locateRevisionISO($branch, 999999, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
function main()
|
|
||||||
{
|
|
||||||
$branch = $_POST["branch"];
|
|
||||||
$revision = $_POST["revision"];
|
|
||||||
|
|
||||||
$filename = "ReactOS-" . $branch . "-r" . $revision . ".iso";
|
|
||||||
if (file_exists(ISO_PATH . $branch . "\\" . $filename))
|
|
||||||
{
|
|
||||||
$location = ISO_BASE_URL . $branch . "/" . $filename;
|
|
||||||
header("Location: $location");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printHeader();
|
|
||||||
printMenu($_POST["revision"]);
|
|
||||||
echo "<br><b>No ISO exist for branch '" . $branch . "' and revision " . $revision . ".</b><br><br>";
|
|
||||||
printFooter();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($_POST["getiso"]) && !empty($_POST["branch"]) && !empty($_POST["revision"]) && is_numeric($_POST["revision"]))
|
|
||||||
main();
|
|
||||||
else if (!empty($_POST["getnextiso"]) && !empty($_POST["branch"]) && !empty($_POST["revision"]) && is_numeric($_POST["revision"]))
|
|
||||||
{
|
|
||||||
printHeader();
|
|
||||||
printMenu(getNextRevisionISO($_POST["branch"], $_POST["revision"]));
|
|
||||||
printFooter();
|
|
||||||
}
|
|
||||||
else if (!empty($_POST["getlatestiso"]) && !empty($_POST["branch"]))
|
|
||||||
{
|
|
||||||
printHeader();
|
|
||||||
printMenu(getLatestRevisionISO($_POST["branch"]));
|
|
||||||
printFooter();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printHeader();
|
|
||||||
printMenu($_POST["revision"]);
|
|
||||||
printFooter();
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
|
@@ -12,11 +12,18 @@
|
|||||||
#include "trim.h"
|
#include "trim.h"
|
||||||
|
|
||||||
#include "IRCClient.h"
|
#include "IRCClient.h"
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::vector;
|
using std::vector;
|
||||||
|
|
||||||
|
#if defined(_DEBUG) && 0
|
||||||
|
const char* BOTNAME = "RoyBot";
|
||||||
|
const char* CHANNEL = "#RoyBotTest";
|
||||||
|
#else
|
||||||
|
const char* BOTNAME = "ArchBlackmann";
|
||||||
|
const char* CHANNEL = "#ReactOS";
|
||||||
|
#endif
|
||||||
|
|
||||||
//vector<string> tech, module, dev, stru, period, status, type, func, irql, curse, cursecop;
|
//vector<string> tech, module, dev, stru, period, status, type, func, irql, curse, cursecop;
|
||||||
|
|
||||||
class List
|
class List
|
||||||
@@ -150,46 +157,14 @@ bool isop ( const string& who )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// do custom stuff with the IRCClient from your subclass via the provided callbacks...
|
// do custom stuff with the IRCClient from your subclass via the provided callbacks...
|
||||||
class MyIRCClient : public IRCClient
|
class MyIRCClient : public IRCClient
|
||||||
{
|
{
|
||||||
File flog;
|
File flog;
|
||||||
clock_t brake_silence;
|
|
||||||
|
|
||||||
// wait another 30 mins to brake the silence
|
|
||||||
#define NOIDLE brake_silence = clock () + 30 * CLK_TCK * 60
|
|
||||||
|
|
||||||
void CheckIdle ( void )
|
|
||||||
{
|
|
||||||
while (true) // _inRun
|
|
||||||
{
|
|
||||||
while (clock() < brake_silence)
|
|
||||||
Sleep(10000);
|
|
||||||
|
|
||||||
string out = TaggedReply("idle");
|
|
||||||
|
|
||||||
if ( !strnicmp ( out.c_str(), "/me ", 4 ) )
|
|
||||||
Action ( CHANNEL, &out[4] );
|
|
||||||
else
|
|
||||||
PrivMsg ( CHANNEL, out );
|
|
||||||
|
|
||||||
NOIDLE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void THREADAPI CallMe ( MyIRCClient* irc )
|
|
||||||
{
|
|
||||||
irc->CheckIdle();
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
MyIRCClient()
|
MyIRCClient()
|
||||||
{
|
{
|
||||||
NOIDLE;
|
flog.open ( "arch.log", "w+" );
|
||||||
ThreadPool::Instance().Launch ( (ThreadPoolFunc*)MyIRCClient::CallMe, this );
|
|
||||||
flog.open ( "arch.log", "r+" );
|
|
||||||
}
|
}
|
||||||
// see IRCClient.h for documentation on these callbacks...
|
// see IRCClient.h for documentation on these callbacks...
|
||||||
bool OnConnected()
|
bool OnConnected()
|
||||||
@@ -198,18 +173,17 @@ public:
|
|||||||
}
|
}
|
||||||
bool OnJoin ( const string& user, const string& channel )
|
bool OnJoin ( const string& user, const string& channel )
|
||||||
{
|
{
|
||||||
//printf ( "user '%s' joined channel '%s'\n", user.c_str(), channel.c_str() );
|
printf ( "user '%s' joined channel '%s'\n", user.c_str(), channel.c_str() );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool OnPart ( const std::string& user, const std::string& channel )
|
bool OnPart ( const std::string& user, const std::string& channel )
|
||||||
{
|
{
|
||||||
std::vector<std::string>::iterator it = ops.begin();
|
for ( int i = 0; i < ops.size(); i++ )
|
||||||
for ( ; it != ops.end(); it++ )
|
|
||||||
{
|
{
|
||||||
if ( *it == user )
|
if ( ops[i] == user )
|
||||||
{
|
{
|
||||||
printf ( "remove '%s' to ops list\n", user.c_str() );
|
printf ( "remove '%s' to ops list\n", user.c_str() );
|
||||||
ops.erase ( it );
|
ops.erase ( &ops[i] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -233,18 +207,11 @@ public:
|
|||||||
}
|
}
|
||||||
bool OnPrivMsg ( const string& from, const string& text )
|
bool OnPrivMsg ( const string& from, const string& text )
|
||||||
{
|
{
|
||||||
//flog.flush();
|
|
||||||
printf ( "<%s> %s\n", from.c_str(), text.c_str() );
|
printf ( "<%s> %s\n", from.c_str(), text.c_str() );
|
||||||
flog.printf ( "<%s> %s\n", from.c_str(), text.c_str() );
|
flog.printf ( "<%s> %s\n", from.c_str(), text.c_str() );
|
||||||
|
if ( strnicmp ( text.c_str(), "!say ", 5 ) || !isop(from) )
|
||||||
if ( !isop(from) )
|
|
||||||
return PrivMsg ( from, "hey, your tongue doesn't belong there!" );
|
return PrivMsg ( from, "hey, your tongue doesn't belong there!" );
|
||||||
|
|
||||||
else if ( strnicmp ( text.c_str(), "!say ", 5 ) )
|
|
||||||
return PrivMsg ( from, "Talk to me on normal Chanel" );
|
|
||||||
|
|
||||||
string say = trim(&text[5]);
|
string say = trim(&text[5]);
|
||||||
|
|
||||||
if ( !strnicmp ( say.c_str(), "/me ", 4 ) )
|
if ( !strnicmp ( say.c_str(), "/me ", 4 ) )
|
||||||
return Action ( CHANNEL, trim(&say[4]) );
|
return Action ( CHANNEL, trim(&say[4]) );
|
||||||
else
|
else
|
||||||
@@ -252,178 +219,140 @@ public:
|
|||||||
}
|
}
|
||||||
bool OnChannelMsg ( const string& channel, const string& from, const string& text )
|
bool OnChannelMsg ( const string& channel, const string& from, const string& text )
|
||||||
{
|
{
|
||||||
fflush ( flog );
|
|
||||||
printf ( "%s <%s> %s\n", channel.c_str(), from.c_str(), text.c_str() );
|
printf ( "%s <%s> %s\n", channel.c_str(), from.c_str(), text.c_str() );
|
||||||
flog.printf ( "%s <%s> %s\n", channel.c_str(), from.c_str(), text.c_str() );
|
flog.printf ( "%s <%s> %s\n", channel.c_str(), from.c_str(), text.c_str() );
|
||||||
NOIDLE; // add 30 mins till idle
|
|
||||||
|
|
||||||
bool found_name = false;
|
bool found_name = false;
|
||||||
string text2 ( text );
|
string text2 ( text );
|
||||||
strlwr ( &text2[0] );
|
strlwr ( &text2[0] );
|
||||||
|
|
||||||
if ( !strnicmp ( text.c_str(), BOTNAME, strlen(BOTNAME) ) )
|
if ( !strnicmp ( text.c_str(), BOTNAME, strlen(BOTNAME) ) )
|
||||||
found_name = true;
|
found_name = true;
|
||||||
|
else if ( !strnicmp ( text.c_str(), "arch ", 5 ) )
|
||||||
string s ( text );
|
found_name = true;
|
||||||
|
|
||||||
if ( found_name )
|
if ( found_name )
|
||||||
gobble ( s, " \t" ); // remove bot name
|
|
||||||
|
|
||||||
// command
|
|
||||||
if ( s[0] == '!' )
|
|
||||||
{
|
{
|
||||||
bool from_op = isop(from);
|
string s ( text );
|
||||||
string cmd = gobble ( s, " \t" );
|
gobble ( s, " \t" ); // remove bot name
|
||||||
|
found_name = true;
|
||||||
// from all
|
if ( s[0] == '!' )
|
||||||
if ( false && cmd == "!svn" && from == "TechBot" ) // || cmd == "!help" && !TechBotOnline
|
|
||||||
{
|
{
|
||||||
PrivMsg ( channel, "For my help try !what." );
|
bool from_op = isop(from);
|
||||||
}
|
string cmd = gobble ( s, " \t" );
|
||||||
|
if ( !from_op )
|
||||||
// from normel user
|
|
||||||
else if ( !from_op )
|
|
||||||
{
|
|
||||||
if ( cmd == "!grovel" )
|
|
||||||
{
|
{
|
||||||
string out = ssprintf(TaggedReply("nogrovel").c_str(),from.c_str());
|
if ( cmd == "!grovel" )
|
||||||
|
{
|
||||||
|
string out = ssprintf(TaggedReply("nogrovel").c_str(),from.c_str());
|
||||||
|
if ( !strnicmp ( out.c_str(), "/me ", 4 ) )
|
||||||
|
return Action ( channel, &out[4] );
|
||||||
|
else
|
||||||
|
return PrivMsg ( channel, out );
|
||||||
|
}
|
||||||
|
return PrivMsg ( channel, ssprintf("%s: I don't take commands from non-ops",from.c_str()) );
|
||||||
|
}
|
||||||
|
if ( cmd == "!add" )
|
||||||
|
{
|
||||||
|
string listname = gobble ( s, " \t" );
|
||||||
|
int i = GetListIndex ( listname.c_str() );
|
||||||
|
if ( i == -1 )
|
||||||
|
return PrivMsg ( channel, ssprintf("%s: I don't have a list named '%s'",from.c_str(),listname.c_str()) );
|
||||||
|
List& list = lists[i];
|
||||||
|
if ( s[0] == '\"' || s[0] == '\'' )
|
||||||
|
{
|
||||||
|
char delim = s[0];
|
||||||
|
const char* p = &s[1];
|
||||||
|
const char* p2 = strchr ( p, delim );
|
||||||
|
if ( !p2 )
|
||||||
|
return PrivMsg ( channel, ssprintf("%s: Couldn't add, unmatched quotes",from.c_str()) );
|
||||||
|
s = string ( p, p2-p );
|
||||||
|
}
|
||||||
|
for ( i = 0; i < list.list.size(); i++ )
|
||||||
|
{
|
||||||
|
if ( list.list[i] == s )
|
||||||
|
return PrivMsg ( channel, ssprintf("%s: entry already exists in list '%s'",from.c_str(),listname.c_str()) );
|
||||||
|
}
|
||||||
|
if ( !stricmp ( listname.c_str(), "curse" ) )
|
||||||
|
strlwr ( &s[0] );
|
||||||
|
list.list.push_back ( s );
|
||||||
|
{
|
||||||
|
File f ( ssprintf("%s.txt",list.name.c_str()), "w" );
|
||||||
|
for ( i = 0; i < list.list.size(); i++ )
|
||||||
|
f.printf ( "%s\n", list.list[i].c_str() );
|
||||||
|
}
|
||||||
|
return PrivMsg ( channel, ssprintf("%s: entry added to list '%s'",from.c_str(),listname.c_str()) );
|
||||||
|
}
|
||||||
|
else if ( cmd == "!remove" )
|
||||||
|
{
|
||||||
|
string listname = gobble ( s, " \t" );
|
||||||
|
int i = GetListIndex ( listname.c_str() );
|
||||||
|
if ( i == -1 )
|
||||||
|
return PrivMsg ( channel, ssprintf("%s: I don't have a list named '%s'",from.c_str(),listname.c_str()) );
|
||||||
|
List& list = lists[i];
|
||||||
|
if ( s[0] == '\"' || s[0] == '\'' )
|
||||||
|
{
|
||||||
|
char delim = s[0];
|
||||||
|
const char* p = &s[1];
|
||||||
|
const char* p2 = strchr ( p, delim );
|
||||||
|
if ( !p2 )
|
||||||
|
return PrivMsg ( channel, ssprintf("%s: Couldn't add, unmatched quotes",from.c_str()) );
|
||||||
|
s = string ( p, p2-p );
|
||||||
|
}
|
||||||
|
for ( i = 0; i < list.list.size(); i++ )
|
||||||
|
{
|
||||||
|
if ( list.list[i] == s )
|
||||||
|
{
|
||||||
|
list.list.erase ( &list.list[i] );
|
||||||
|
{
|
||||||
|
File f ( ssprintf("%s.txt",list.name.c_str()), "w" );
|
||||||
|
for ( i = 0; i < list.list.size(); i++ )
|
||||||
|
f.printf ( "%s\n", list.list[i].c_str() );
|
||||||
|
}
|
||||||
|
return PrivMsg ( channel, ssprintf("%s: entry removed from list '%s'",from.c_str(),listname.c_str()) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return PrivMsg ( channel, ssprintf("%s: entry doesn't exist in list '%s'",from.c_str(),listname.c_str()) );
|
||||||
|
}
|
||||||
|
else if ( cmd == "!grovel" )
|
||||||
|
{
|
||||||
|
string out = ssprintf(TaggedReply("grovel").c_str(),from.c_str());
|
||||||
if ( !strnicmp ( out.c_str(), "/me ", 4 ) )
|
if ( !strnicmp ( out.c_str(), "/me ", 4 ) )
|
||||||
return Action ( channel, &out[4] );
|
return Action ( channel, &out[4] );
|
||||||
else
|
else
|
||||||
return PrivMsg ( channel, out );
|
return PrivMsg ( channel, out );
|
||||||
}
|
}
|
||||||
|
else if ( cmd == "!kiss" )
|
||||||
else if ( cmd == "!what" )
|
|
||||||
{
|
{
|
||||||
return PrivMsg ( channel, ssprintf("For you, %s, I only support the \"!grovel\" command.", from.c_str()).c_str() );
|
if ( s.size() )
|
||||||
|
return Action ( channel, ssprintf("kisses %s",s.c_str()) );
|
||||||
|
else
|
||||||
|
return PrivMsg ( channel, ssprintf("%s: huh?",from.c_str()) );
|
||||||
}
|
}
|
||||||
|
else if ( cmd == "!hug" )
|
||||||
else if ( cmd == "!grovel" || cmd == "!kiss" || cmd == "!hug"
|
|
||||||
|| cmd == "!give" || cmd == "!what" || cmd == "!add" || cmd == "!remove" )
|
|
||||||
{
|
{
|
||||||
PrivMsg ( channel, ssprintf("%s: I only take commands from ops",from.c_str()) );
|
if ( s.size() )
|
||||||
|
return Action ( channel, ssprintf("hugs %s",s.c_str()) );
|
||||||
|
else
|
||||||
|
return PrivMsg ( channel, ssprintf("%s: huh?",from.c_str()) );
|
||||||
|
}
|
||||||
|
else if ( cmd == "!give" )
|
||||||
|
{
|
||||||
|
string who = gobble(s," \t");
|
||||||
|
if ( who.size() && s.size() )
|
||||||
|
return Action ( channel, ssprintf("gives %s a %s",who.c_str(),s.c_str()) );
|
||||||
|
else
|
||||||
|
return PrivMsg ( channel, ssprintf("%s: huh?",from.c_str()) );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// from op
|
|
||||||
else if ( cmd == "!grovel" )
|
|
||||||
{
|
|
||||||
string out = ssprintf(TaggedReply("grovel").c_str(),from.c_str());
|
|
||||||
if ( !strnicmp ( out.c_str(), "/me ", 4 ) )
|
|
||||||
return Action ( channel, &out[4] );
|
|
||||||
else
|
|
||||||
return PrivMsg ( channel, out );
|
|
||||||
}
|
|
||||||
else if ( cmd == "!kiss" )
|
|
||||||
{
|
|
||||||
if ( s.size() )
|
|
||||||
return Action ( channel, ssprintf("kisses %s",s.c_str()) );
|
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return PrivMsg ( channel, ssprintf("%s: huh?",from.c_str()) );
|
return PrivMsg ( channel, ssprintf("%s: huh?",from.c_str()) );
|
||||||
}
|
|
||||||
else if ( cmd == "!hug" )
|
|
||||||
{
|
|
||||||
if ( s.size() )
|
|
||||||
return Action ( channel, ssprintf("hugs %s",s.c_str()) );
|
|
||||||
else
|
|
||||||
return PrivMsg ( channel, ssprintf("%s: huh?",from.c_str()) );
|
|
||||||
}
|
|
||||||
else if ( cmd == "!give" )
|
|
||||||
{
|
|
||||||
string who = gobble(s," \t");
|
|
||||||
if ( who.size() && s.size() )
|
|
||||||
return Action ( channel, ssprintf("gives %s a %s",who.c_str(),s.c_str()) );
|
|
||||||
else
|
|
||||||
return PrivMsg ( channel, ssprintf("%s: huh?",from.c_str()) );
|
|
||||||
}
|
|
||||||
else if ( cmd == "!what" )
|
|
||||||
{
|
|
||||||
PrivMsg ( channel, "For ops I support the following commands:" );
|
|
||||||
PrivMsg ( channel, "!grovel" );
|
|
||||||
PrivMsg ( channel, "!kiss" );
|
|
||||||
PrivMsg ( channel, "!hug" );
|
|
||||||
PrivMsg ( channel, "!give" );
|
|
||||||
PrivMsg ( channel, "!say (the input is a private message)" );
|
|
||||||
PrivMsg ( channel, "!add" );
|
|
||||||
PrivMsg ( channel, "!remove" );
|
|
||||||
PrivMsg ( channel, " - for more info see wiki" );
|
|
||||||
}
|
|
||||||
else if ( cmd == "!add" )
|
|
||||||
{
|
|
||||||
string listname = gobble ( s, " \t" );
|
|
||||||
int i = GetListIndex ( listname.c_str() );
|
|
||||||
if ( i == -1 )
|
|
||||||
return PrivMsg ( channel, ssprintf("%s: I don't have a list named '%s'",from.c_str(),listname.c_str()) );
|
|
||||||
List& list = lists[i];
|
|
||||||
if ( s[0] == '\"' || s[0] == '\'' )
|
|
||||||
{
|
|
||||||
char delim = s[0];
|
|
||||||
const char* p = &s[1];
|
|
||||||
const char* p2 = strchr ( p, delim );
|
|
||||||
if ( !p2 )
|
|
||||||
return PrivMsg ( channel, ssprintf("%s: Couldn't add, unmatched quotes",from.c_str()) );
|
|
||||||
s = string ( p, p2-p );
|
|
||||||
}
|
}
|
||||||
for ( i = 0; i < list.list.size(); i++ )
|
|
||||||
{
|
|
||||||
if ( list.list[i] == s )
|
|
||||||
return PrivMsg ( channel, ssprintf("%s: entry already exists in list '%s'",from.c_str(),listname.c_str()) );
|
|
||||||
}
|
|
||||||
if ( !stricmp ( listname.c_str(), "curse" ) )
|
|
||||||
strlwr ( &s[0] );
|
|
||||||
list.list.push_back ( s );
|
|
||||||
{
|
|
||||||
File f ( ssprintf("%s.txt",list.name.c_str()), "w" );
|
|
||||||
for ( i = 0; i < list.list.size(); i++ )
|
|
||||||
f.printf ( "%s\n", list.list[i].c_str() );
|
|
||||||
}
|
|
||||||
return PrivMsg ( channel, ssprintf("%s: entry added to list '%s'",from.c_str(),listname.c_str()) );
|
|
||||||
}
|
}
|
||||||
else if ( cmd == "!remove" )
|
}
|
||||||
{
|
|
||||||
string listname = gobble ( s, " \t" );
|
|
||||||
int i = GetListIndex ( listname.c_str() );
|
|
||||||
if ( i == -1 )
|
|
||||||
return PrivMsg ( channel, ssprintf("%s: I don't have a list named '%s'",from.c_str(),listname.c_str()) );
|
|
||||||
List& list = lists[i];
|
|
||||||
if ( s[0] == '\"' || s[0] == '\'' )
|
|
||||||
{
|
|
||||||
char delim = s[0];
|
|
||||||
const char* p = &s[1];
|
|
||||||
const char* p2 = strchr ( p, delim );
|
|
||||||
if ( !p2 )
|
|
||||||
return PrivMsg ( channel, ssprintf("%s: Couldn't add, unmatched quotes",from.c_str()) );
|
|
||||||
s = string ( p, p2-p );
|
|
||||||
}
|
|
||||||
std::vector<std::string>::iterator it = list.list.begin();
|
|
||||||
for ( ; it != list.list.end(); it++ )
|
|
||||||
{
|
|
||||||
if ( *it == s )
|
|
||||||
{
|
|
||||||
list.list.erase ( it );
|
|
||||||
{
|
|
||||||
File f ( ssprintf("%s.txt",list.name.c_str()), "w" );
|
|
||||||
it = list.list.begin();
|
|
||||||
for ( ; it < list.list.end(); it++ )
|
|
||||||
f.printf ( "%s\n", it->c_str() );
|
|
||||||
}
|
|
||||||
return PrivMsg ( channel, ssprintf("%s: entry removed from list '%s'",from.c_str(),listname.c_str()) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return PrivMsg ( channel, ssprintf("%s: entry doesn't exist in list '%s'",from.c_str(),listname.c_str()) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (found_name)
|
|
||||||
return PrivMsg ( channel, ssprintf("%s: huh?",from.c_str()) );
|
|
||||||
}
|
|
||||||
|
|
||||||
} // if (command)
|
|
||||||
|
|
||||||
bool found_curse = false;
|
bool found_curse = false;
|
||||||
static vector<string>& curse = GetList("curse").list;
|
static vector<string>& curse = GetList("curse").list;
|
||||||
text2 = " " + text2 + " ";
|
text2 = ssprintf(" %s ",text2.c_str());
|
||||||
|
|
||||||
for ( int i = 0; i < curse.size() && !found_curse; i++ )
|
for ( int i = 0; i < curse.size() && !found_curse; i++ )
|
||||||
{
|
{
|
||||||
if ( strstr ( text2.c_str(), curse[i].c_str() ) )
|
if ( strstr ( text2.c_str(), curse[i].c_str() ) )
|
||||||
@@ -434,12 +363,7 @@ public:
|
|||||||
static List& cursecop = GetList("cursecop");
|
static List& cursecop = GetList("cursecop");
|
||||||
return PrivMsg ( channel, ssprintf("%s: %s", from.c_str(), ListRand(cursecop)) );
|
return PrivMsg ( channel, ssprintf("%s: %s", from.c_str(), ListRand(cursecop)) );
|
||||||
}
|
}
|
||||||
|
else if ( found_name )
|
||||||
string botname (BOTNAME);
|
|
||||||
strlwr ( &botname[0] );
|
|
||||||
//botname = " " + botname + " ";
|
|
||||||
|
|
||||||
if ( strstr(text2.c_str(), botname.c_str()) || strstr(text2.c_str(), " arch ") || found_name )
|
|
||||||
{
|
{
|
||||||
string out = ssprintf("%s: %s", from.c_str(), TaggedReply("tech").c_str());
|
string out = ssprintf("%s: %s", from.c_str(), TaggedReply("tech").c_str());
|
||||||
flog.printf ( "TECH-REPLY: %s\n", out.c_str() );
|
flog.printf ( "TECH-REPLY: %s\n", out.c_str() );
|
||||||
@@ -449,9 +373,7 @@ public:
|
|||||||
return PrivMsg ( channel, out );
|
return PrivMsg ( channel, out );
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
} // On Chanel Message
|
|
||||||
|
|
||||||
bool OnChannelMode ( const string& channel, const string& mode )
|
bool OnChannelMode ( const string& channel, const string& mode )
|
||||||
{
|
{
|
||||||
//printf ( "OnChannelMode(%s,%s)\n", channel.c_str(), mode.c_str() );
|
//printf ( "OnChannelMode(%s,%s)\n", channel.c_str(), mode.c_str() );
|
||||||
@@ -483,13 +405,12 @@ public:
|
|||||||
{
|
{
|
||||||
if ( *p == 'o' )
|
if ( *p == 'o' )
|
||||||
{
|
{
|
||||||
std::vector<std::string>::iterator it = ops.begin();
|
for ( int i = 0; i < ops.size(); i++ )
|
||||||
for ( ; it != ops.end(); it++ )
|
|
||||||
{
|
{
|
||||||
if ( *it == target )
|
if ( ops[i] == target )
|
||||||
{
|
{
|
||||||
printf ( "remove '%s' to ops list\n", target.c_str() );
|
printf ( "remove '%s' to ops list\n", target.c_str() );
|
||||||
ops.erase ( it );
|
ops.erase ( &ops[i] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -518,16 +439,6 @@ public:
|
|||||||
//printf ( "\n" );
|
//printf ( "\n" );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
bool OnKick ( void )
|
|
||||||
{
|
|
||||||
Join(CHANNEL);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
bool OnBanned ( const std::string& channel )
|
|
||||||
{
|
|
||||||
Sleep(10000);
|
|
||||||
return Join(CHANNEL);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int main ( int argc, char** argv )
|
int main ( int argc, char** argv )
|
||||||
@@ -550,59 +461,50 @@ int main ( int argc, char** argv )
|
|||||||
ImportList ( "cursecop", false );
|
ImportList ( "cursecop", false );
|
||||||
ImportList ( "grovel", false );
|
ImportList ( "grovel", false );
|
||||||
ImportList ( "nogrovel", false );
|
ImportList ( "nogrovel", false );
|
||||||
ImportList ( "idle", false );
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
printf ( "initializing IRCClient debugging\n" );
|
printf ( "initializing IRCClient debugging\n" );
|
||||||
IRCClient::SetDebug ( true );
|
IRCClient::SetDebug ( true );
|
||||||
#endif//_DEBUG
|
#endif//_DEBUG
|
||||||
|
printf ( "calling suStartup()\n" );
|
||||||
|
suStartup();
|
||||||
|
printf ( "creating IRCClient object\n" );
|
||||||
|
MyIRCClient irc;
|
||||||
|
printf ( "connecting to freenode\n" );
|
||||||
|
|
||||||
while (true)
|
//const char* server = "212.204.214.114";
|
||||||
|
const char* server = "irc.freenode.net";
|
||||||
|
|
||||||
|
if ( !irc.Connect ( server ) ) // irc.freenode.net
|
||||||
{
|
{
|
||||||
printf ( "calling suStartup()\n" );
|
printf ( "couldn't connect to server\n" );
|
||||||
suStartup();
|
return -1;
|
||||||
printf ( "creating IRCClient object\n" );
|
|
||||||
MyIRCClient irc;
|
|
||||||
printf ( "connecting to freenode\n" );
|
|
||||||
|
|
||||||
if ( !irc.Connect ( SERVER ) ) // irc.freenode.net
|
|
||||||
{
|
|
||||||
printf ( "couldn't connect to server\n" );
|
|
||||||
Sleep(10000);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
printf ( "sending user command\n" );
|
|
||||||
if ( !irc.User ( BOTNAME, "reactos.com", SERVER, "ArchBlackmann" ) )
|
|
||||||
{
|
|
||||||
printf ( "USER command failed, retying ...\n" );
|
|
||||||
Sleep(10000);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
printf ( "sending nick\n" );
|
|
||||||
if ( !irc.Nick ( BOTNAME ) )
|
|
||||||
{
|
|
||||||
printf ( "NICK command failed, retying ...\n" );
|
|
||||||
Sleep(10000);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
printf ( "setting mode\n" );
|
|
||||||
if ( !irc.Mode ( MODE ) )
|
|
||||||
{
|
|
||||||
printf ( "MODE command failed, retying ...\n" );
|
|
||||||
Sleep(10000);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
printf ( "joining channel\n" );
|
|
||||||
if ( !irc.Join ( CHANNEL ) )
|
|
||||||
{
|
|
||||||
printf ( "JOIN command failed, retying ...\n" );
|
|
||||||
Sleep(10000);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
printf ( "entering irc client processor\n" );
|
|
||||||
irc.Run ( false ); // do the processing in this thread...
|
|
||||||
}
|
}
|
||||||
|
printf ( "sending user command\n" );
|
||||||
|
if ( !irc.User ( BOTNAME, "", "irc.freenode.net", BOTNAME ) )
|
||||||
|
{
|
||||||
|
printf ( "USER command failed\n" );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
printf ( "sending nick\n" );
|
||||||
|
if ( !irc.Nick ( BOTNAME ) )
|
||||||
|
{
|
||||||
|
printf ( "NICK command failed\n" );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
printf ( "setting mode\n" );
|
||||||
|
if ( !irc.Mode ( "+i" ) )
|
||||||
|
{
|
||||||
|
printf ( "MODE command failed\n" );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
printf ( "joining channel\n" );
|
||||||
|
if ( !irc.Join ( CHANNEL ) )
|
||||||
|
{
|
||||||
|
printf ( "JOIN command failed\n" );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
printf ( "entering irc client processor\n" );
|
||||||
|
irc.Run ( false ); // do the processing in this thread...
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -110,10 +110,6 @@ SOURCE=.\chomp.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\config.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\cram_md5.cpp
|
SOURCE=.\cram_md5.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@@ -14,8 +14,8 @@
|
|||||||
#define nelem(x) ( sizeof(x) / sizeof(x[0]) )
|
#define nelem(x) ( sizeof(x) / sizeof(x[0]) )
|
||||||
#endif//nelem
|
#endif//nelem
|
||||||
|
|
||||||
typedef File::filesize_t filesize_t;
|
using File::filesize_t;
|
||||||
typedef File::fileoff_t fileoff_t;
|
using File::fileoff_t;
|
||||||
|
|
||||||
|
|
||||||
fileoff_t File::seek ( fileoff_t offset )
|
fileoff_t File::seek ( fileoff_t offset )
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
class File
|
class File
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
#ifdef WIN32
|
#ifdef _MSC_VER
|
||||||
typedef __int64 fileoff_t;
|
typedef __int64 fileoff_t;
|
||||||
typedef unsigned __int64 filesize_t;
|
typedef unsigned __int64 filesize_t;
|
||||||
#else//_MSC_VER
|
#else//_MSC_VER
|
||||||
|
@@ -10,13 +10,12 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#include "IRCClient.h"
|
#include "IRCClient.h"
|
||||||
#include "MD5.h"
|
#include "md5.h"
|
||||||
#include "cram_md5.h"
|
#include "cram_md5.h"
|
||||||
#include "trim.h"
|
#include "trim.h"
|
||||||
#include "chomp.h"
|
#include "chomp.h"
|
||||||
#include "SplitJoin.h"
|
#include "SplitJoin.h"
|
||||||
#include "base64.h"
|
#include "base64.h"
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::stringstream;
|
using std::stringstream;
|
||||||
@@ -24,8 +23,6 @@ using std::vector;
|
|||||||
|
|
||||||
bool IRCClient::_debug = true;
|
bool IRCClient::_debug = true;
|
||||||
|
|
||||||
// see rfc1459 for IRC-Protocoll Reference
|
|
||||||
|
|
||||||
IRCClient::IRCClient()
|
IRCClient::IRCClient()
|
||||||
: _timeout(10*60*1000), _inRun(false)
|
: _timeout(10*60*1000), _inRun(false)
|
||||||
{
|
{
|
||||||
@@ -54,9 +51,7 @@ bool
|
|||||||
IRCClient::Nick ( const string& nick )
|
IRCClient::Nick ( const string& nick )
|
||||||
{
|
{
|
||||||
_nick = nick;
|
_nick = nick;
|
||||||
Send ( "NICK " + _nick + "\n" );
|
return Send ( "NICK " + _nick + "\n" );
|
||||||
PrivMsg ("NickServ", "IDENTIFY " + (string)PASS);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@@ -80,7 +75,7 @@ IRCClient::Mode ( const string& channel, const string& mode, const string& targe
|
|||||||
bool
|
bool
|
||||||
IRCClient::Join ( const string& channel )
|
IRCClient::Join ( const string& channel )
|
||||||
{
|
{
|
||||||
return Send("JOIN " + channel + "\n");
|
return Send ( "JOIN " + channel + "\n" );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@@ -150,7 +145,7 @@ int IRCClient::Run ( bool launch_thread )
|
|||||||
{
|
{
|
||||||
ThreadPool::Instance().Launch ( (ThreadPoolFunc*)IRCClient::Callback, this );
|
ThreadPool::Instance().Launch ( (ThreadPoolFunc*)IRCClient::Callback, this );
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
_inRun = true;
|
_inRun = true;
|
||||||
if ( _debug ) printf ( "IRCClient::Run() - waiting for responses\n" );
|
if ( _debug ) printf ( "IRCClient::Run() - waiting for responses\n" );
|
||||||
string buf;
|
string buf;
|
||||||
@@ -301,7 +296,6 @@ int IRCClient::Run ( bool launch_thread )
|
|||||||
}
|
}
|
||||||
else if ( cmd == "join" )
|
else if ( cmd == "join" )
|
||||||
{
|
{
|
||||||
mychannel = text;
|
|
||||||
OnJoin ( src, text );
|
OnJoin ( src, text );
|
||||||
}
|
}
|
||||||
else if ( cmd == "part" )
|
else if ( cmd == "part" )
|
||||||
@@ -312,20 +306,14 @@ int IRCClient::Run ( bool launch_thread )
|
|||||||
{
|
{
|
||||||
OnNick ( src, text );
|
OnNick ( src, text );
|
||||||
}
|
}
|
||||||
else if ( cmd == "kick" )
|
|
||||||
{
|
|
||||||
OnKick ();
|
|
||||||
}
|
|
||||||
else if ( isdigit(cmd[0]) )
|
else if ( isdigit(cmd[0]) )
|
||||||
{
|
{
|
||||||
int i = atoi(cmd.c_str());
|
int i = atoi(cmd.c_str());
|
||||||
switch ( i )
|
switch ( i )
|
||||||
{
|
{
|
||||||
|
|
||||||
case 1: // "Welcome!" - i.e. it's okay to issue commands now...
|
case 1: // "Welcome!" - i.e. it's okay to issue commands now...
|
||||||
OnConnected();
|
OnConnected();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 353: // user list for channel....
|
case 353: // user list for channel....
|
||||||
{
|
{
|
||||||
p = text.c_str();
|
p = text.c_str();
|
||||||
@@ -348,7 +336,6 @@ int IRCClient::Run ( bool launch_thread )
|
|||||||
OnChannelUsers ( channel, users );
|
OnChannelUsers ( channel, users );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 366: // END of user list for channel
|
case 366: // END of user list for channel
|
||||||
{
|
{
|
||||||
p = text.c_str();
|
p = text.c_str();
|
||||||
@@ -358,38 +345,6 @@ int IRCClient::Run ( bool launch_thread )
|
|||||||
OnEndChannelUsers ( channel );
|
OnEndChannelUsers ( channel );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 474: // You are banned
|
|
||||||
{
|
|
||||||
p = text.c_str();
|
|
||||||
p2 = strpbrk ( p, " :" );
|
|
||||||
if ( !p2 ) continue;
|
|
||||||
string channel ( p, p2-p );
|
|
||||||
OnBanned ( channel );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 433: // Nick in Use
|
|
||||||
{
|
|
||||||
string nick = _nick;
|
|
||||||
Nick (nick + "_");
|
|
||||||
|
|
||||||
PrivMsg ("NickServ", "GHOST " + nick + " " + PASS);
|
|
||||||
|
|
||||||
// HACK HACK HACK
|
|
||||||
Mode ( "+i" );
|
|
||||||
Join ( CHANNEL ); // this is because IRC client does not review if his commands were sucessfull
|
|
||||||
|
|
||||||
Sleep ( 1000 );
|
|
||||||
Nick ( nick );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2: //MOTD
|
|
||||||
case 376: //MOTD
|
|
||||||
case 372:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if ( _debug ) printf ( "unknown command %i: %s", i, buf.c_str() );
|
if ( _debug ) printf ( "unknown command %i: %s", i, buf.c_str() );
|
||||||
break;
|
break;
|
||||||
|
@@ -12,11 +12,9 @@
|
|||||||
|
|
||||||
class IRCClient : public suBufferedRecvSocket
|
class IRCClient : public suBufferedRecvSocket
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
IRCClient();
|
IRCClient();
|
||||||
|
|
||||||
std::string mychannel;
|
|
||||||
static bool GetDebug() { return _debug; }
|
static bool GetDebug() { return _debug; }
|
||||||
static bool SetDebug ( bool debug ) { bool old = _debug; _debug = debug; return old; }
|
static bool SetDebug ( bool debug ) { bool old = _debug; _debug = debug; return old; }
|
||||||
|
|
||||||
@@ -101,12 +99,6 @@ public:
|
|||||||
virtual bool OnChannelUsers ( const std::string& channel, const std::vector<std::string>& users )
|
virtual bool OnChannelUsers ( const std::string& channel, const std::vector<std::string>& users )
|
||||||
{ return true; }
|
{ return true; }
|
||||||
|
|
||||||
// OnKick: if the client has been kicked
|
|
||||||
virtual bool OnKick ( void ) { return true; }
|
|
||||||
|
|
||||||
// OnKick: if the client has been kicked
|
|
||||||
virtual bool OnBanned ( const std::string& channel ) { return true; }
|
|
||||||
|
|
||||||
// notification that you have received the entire list of users for a channel
|
// notification that you have received the entire list of users for a channel
|
||||||
virtual bool OnEndChannelUsers ( const std::string& channel ) { return true; }
|
virtual bool OnEndChannelUsers ( const std::string& channel ) { return true; }
|
||||||
|
|
||||||
|
@@ -53,7 +53,7 @@ public:
|
|||||||
{
|
{
|
||||||
ASSERT ( i < _end );
|
ASSERT ( i < _end );
|
||||||
reserve ( i + 1 );
|
reserve ( i + 1 );
|
||||||
_arr[i].reset ( p );
|
_arr[i].reset ( ptr );
|
||||||
}
|
}
|
||||||
|
|
||||||
void push_back ( auto_ptr<T>& p )
|
void push_back ( auto_ptr<T>& p )
|
||||||
|
@@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
#define SERVER "irc.freenode.net"
|
|
||||||
#define BOTNAME "ArchBlackmann"
|
|
||||||
#define CHANNEL "#ReactOS"
|
|
||||||
#define MODE "+i"
|
|
||||||
#define PASS "ilovebunnies"
|
|
@@ -2,7 +2,7 @@
|
|||||||
// This file is (C) 2004 Royce Mitchell III
|
// This file is (C) 2004 Royce Mitchell III
|
||||||
// and released under the BSD & LGPL licenses
|
// and released under the BSD & LGPL licenses
|
||||||
|
|
||||||
#include "MD5.h"
|
#include "md5.h"
|
||||||
#include "cram_md5.h"
|
#include "cram_md5.h"
|
||||||
#include "base64.h"
|
#include "base64.h"
|
||||||
|
|
||||||
|
@@ -24,4 +24,3 @@ goat.cx
|
|||||||
ekush
|
ekush
|
||||||
akshor
|
akshor
|
||||||
poop
|
poop
|
||||||
guten morgen
|
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
BOOLEAN
|
||||||
CcCanIWrite
|
CcCanIWrite
|
||||||
CcCopyRead
|
CcCopyRead
|
||||||
CcCopyWrite
|
CcCopyWrite
|
||||||
|
@@ -1 +0,0 @@
|
|||||||
/me is bored
|
|
@@ -1,38 +0,0 @@
|
|||||||
TARGET := ArchBlackmann.exe
|
|
||||||
|
|
||||||
.PHONY: all
|
|
||||||
|
|
||||||
all: $(TARGET)
|
|
||||||
|
|
||||||
CPP=mingw32-g++
|
|
||||||
CFLAGS := -DWIN32 -D_DEBUG -D_CONSOLE -D_MBCS
|
|
||||||
LFLAGS :=
|
|
||||||
LIBS := -lstdc++ -lws2_32
|
|
||||||
|
|
||||||
SRCS := ArchBlackmann.cpp \
|
|
||||||
base64.cpp \
|
|
||||||
chomp.cpp \
|
|
||||||
cram_md5.cpp \
|
|
||||||
File.cpp \
|
|
||||||
IRCClient.cpp \
|
|
||||||
MD5.cpp \
|
|
||||||
panic.cpp \
|
|
||||||
ReliMT.cpp \
|
|
||||||
SockUtils.cpp \
|
|
||||||
SplitJoin.cpp \
|
|
||||||
ssprintf.cpp \
|
|
||||||
ThreadPool.cpp \
|
|
||||||
trim.cpp
|
|
||||||
|
|
||||||
OBJS := $(SRCS:.cpp=.o)
|
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
|
||||||
$(CPP) $(LFLAGS) -o $@ $(OBJS) $(LIBS)
|
|
||||||
|
|
||||||
.cpp.o: $<
|
|
||||||
$(CPP) $(CFLAGS) -c $< -o $@
|
|
||||||
|
|
||||||
.PHONY: clean
|
|
||||||
clean:
|
|
||||||
-@del $(TARGET)
|
|
||||||
-@del $(OBJS)
|
|
@@ -1,44 +0,0 @@
|
|||||||
This doc can be also found on the wiki.
|
|
||||||
|
|
||||||
ArchBlackman is a IRC-Chat bot of the #reactos irc channel. He has been coded by Royce3 and DrFred (mbosma) currently runs him.
|
|
||||||
|
|
||||||
|
|
||||||
If some one use a swear word he'll tell him not to do so and you can also ask him something technical about reactos. :)
|
|
||||||
|
|
||||||
Besides this he also knows some commands. The systax for giving him commands "ArchBlackmann: !grovel". (don't forget to address him)
|
|
||||||
|
|
||||||
- !grovel - This is the only command that non ops can do (No Parameter)
|
|
||||||
- !kiss <person>
|
|
||||||
- !hug <person>
|
|
||||||
- !give <someone> <something>
|
|
||||||
- !say <something> - You can tell him to say something on the channel via PrivateMessage
|
|
||||||
|
|
||||||
|
|
||||||
ArchBlackmann know what he should say from some text files. They can be found on the svn-dir. But can also edit them online if you are op using:
|
|
||||||
|
|
||||||
- !add <list> <item>
|
|
||||||
- !remove <list> <item>
|
|
||||||
|
|
||||||
List that are used directly to create responses are:
|
|
||||||
|
|
||||||
- tech - here are the sentences ArchBlackmann says when he finds his name
|
|
||||||
- curse - this are the curses he looks for
|
|
||||||
- cursecop - this the responces to them
|
|
||||||
- grovel - this is said when an op does the grovel command
|
|
||||||
- nogrovel - this when someone else does it
|
|
||||||
|
|
||||||
The remaining lists are not used directly, but by the other lists.
|
|
||||||
|
|
||||||
They are:
|
|
||||||
|
|
||||||
- dev
|
|
||||||
- func
|
|
||||||
- irql
|
|
||||||
- module
|
|
||||||
- period
|
|
||||||
- status
|
|
||||||
- stru
|
|
||||||
- type
|
|
||||||
|
|
||||||
And they are used like this:
|
|
||||||
/me thinks %s is smarter than %dev%
|
|
@@ -551,7 +551,7 @@ static bool numberfl(std::string& f, long double __n, char exp_sign, int size,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int stringa(std::string& f, const char* s, int len, int field_width, int precision, int flags)
|
static int string(std::string& f, const char* s, int len, int field_width, int precision, int flags)
|
||||||
{
|
{
|
||||||
int i, done = 0;
|
int i, done = 0;
|
||||||
if (s == NULL)
|
if (s == NULL)
|
||||||
@@ -654,7 +654,7 @@ std::string ssvprintf ( const char *fmt, va_list args )
|
|||||||
long double _ldouble;
|
long double _ldouble;
|
||||||
double _double;
|
double _double;
|
||||||
const char *s;
|
const char *s;
|
||||||
const wchar_t* sw;
|
const unsigned short* sw;
|
||||||
int result;
|
int result;
|
||||||
std::string f;
|
std::string f;
|
||||||
|
|
||||||
@@ -793,12 +793,12 @@ std::string ssvprintf ( const char *fmt, va_list args )
|
|||||||
case 's':
|
case 's':
|
||||||
if (qualifier == 'l' || qualifier == 'w') {
|
if (qualifier == 'l' || qualifier == 'w') {
|
||||||
/* print unicode string */
|
/* print unicode string */
|
||||||
sw = (const wchar_t*)va_arg(args, wchar_t *);
|
sw = va_arg(args, wchar_t *);
|
||||||
result = stringw(f, sw, -1, field_width, precision, flags);
|
result = stringw(f, sw, -1, field_width, precision, flags);
|
||||||
} else {
|
} else {
|
||||||
/* print ascii string */
|
/* print ascii string */
|
||||||
s = va_arg(args, char *);
|
s = va_arg(args, char *);
|
||||||
result = stringa(f, s, -1, field_width, precision, flags);
|
result = string(f, s, -1, field_width, precision, flags);
|
||||||
}
|
}
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
{
|
{
|
||||||
@@ -811,10 +811,10 @@ std::string ssvprintf ( const char *fmt, va_list args )
|
|||||||
if (qualifier == 'h') {
|
if (qualifier == 'h') {
|
||||||
/* print ascii string */
|
/* print ascii string */
|
||||||
s = va_arg(args, char *);
|
s = va_arg(args, char *);
|
||||||
result = stringa(f, s, -1, field_width, precision, flags);
|
result = string(f, s, -1, field_width, precision, flags);
|
||||||
} else {
|
} else {
|
||||||
/* print unicode string */
|
/* print unicode string */
|
||||||
sw = (const wchar_t*)va_arg(args, wchar_t *);
|
sw = va_arg(args, wchar_t *);
|
||||||
result = stringw(f, sw, -1, field_width, precision, flags);
|
result = stringw(f, sw, -1, field_width, precision, flags);
|
||||||
}
|
}
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
@@ -846,7 +846,7 @@ std::string ssvprintf ( const char *fmt, va_list args )
|
|||||||
s = pas->Buffer;
|
s = pas->Buffer;
|
||||||
len = pas->Length;
|
len = pas->Length;
|
||||||
}
|
}
|
||||||
result = stringa(f, s, -1, field_width, precision, flags);
|
result = string(f, s, -1, field_width, precision, flags);
|
||||||
}
|
}
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
3
os2/apps/bepslep/.cvsignore
Normal file
3
os2/apps/bepslep/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
*.exe
|
||||||
|
*.o
|
||||||
|
*.sym
|
@@ -1,5 +0,0 @@
|
|||||||
<group>
|
|
||||||
<directory name="bepslep">
|
|
||||||
<xi:include href="bepslep/bepslep.xml" />
|
|
||||||
</directory>
|
|
||||||
</group>
|
|
340
os2/copying
340
os2/copying
@@ -1,340 +0,0 @@
|
|||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
License is intended to guarantee your freedom to share and change free
|
|
||||||
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 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
|
|
||||||
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 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 make restrictions that forbid
|
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
|
||||||
These restrictions translate to certain responsibilities for you if you
|
|
||||||
distribute copies of the software, or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must give the recipients all the rights that
|
|
||||||
you have. 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.
|
|
||||||
|
|
||||||
We protect your rights with two steps: (1) copyright the software, and
|
|
||||||
(2) offer you this license which gives you legal permission to copy,
|
|
||||||
distribute and/or modify the software.
|
|
||||||
|
|
||||||
Also, for each author's protection and ours, we want to make certain
|
|
||||||
that everyone understands that there is no warranty for this free
|
|
||||||
software. If the software is modified by someone else and passed on, we
|
|
||||||
want its recipients to know that what they have is not the original, so
|
|
||||||
that any problems introduced by others will not reflect on the original
|
|
||||||
authors' reputations.
|
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
|
||||||
patents. We wish to avoid the danger that redistributors of a free
|
|
||||||
program will individually obtain patent licenses, in effect making the
|
|
||||||
program proprietary. To prevent this, we have made it clear that any
|
|
||||||
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
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
|
||||||
a notice placed by the copyright holder saying it may be distributed
|
|
||||||
under the terms of this General Public License. The "Program", below,
|
|
||||||
refers to any such program or work, and a "work based on the Program"
|
|
||||||
means either the Program or any derivative work under copyright law:
|
|
||||||
that is to say, a work containing the Program or a portion of it,
|
|
||||||
either verbatim or with modifications and/or translated into another
|
|
||||||
language. (Hereinafter, translation is included without limitation in
|
|
||||||
the term "modification".) Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running the Program is not restricted, and the output from the Program
|
|
||||||
is covered only if its contents constitute a work based on the
|
|
||||||
Program (independent of having been made by running the Program).
|
|
||||||
Whether that is true depends on what the Program does.
|
|
||||||
|
|
||||||
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
|
|
||||||
notices that refer to this License and to the absence of any warranty;
|
|
||||||
and give any other recipients of the Program a copy of this License
|
|
||||||
along with the Program.
|
|
||||||
|
|
||||||
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 Program or any portion
|
|
||||||
of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
b) You must cause any work that you distribute or publish, that in
|
|
||||||
whole or in part contains or is derived from the Program or any
|
|
||||||
part thereof, to be licensed as a whole at no charge to all third
|
|
||||||
parties under the terms of this License.
|
|
||||||
|
|
||||||
c) If the modified program normally reads commands interactively
|
|
||||||
when run, you must cause it, when started running for such
|
|
||||||
interactive use in the most ordinary way, to print or display an
|
|
||||||
announcement including an appropriate copyright notice and a
|
|
||||||
notice that there is no warranty (or else, saying that you provide
|
|
||||||
a warranty) and that users may redistribute the program under
|
|
||||||
these conditions, and telling the user how to view a copy of this
|
|
||||||
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
|
|
||||||
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 Program, 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 Program.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Program
|
|
||||||
with the Program (or with a work based on the Program) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may copy and distribute the Program (or a work based on it,
|
|
||||||
under Section 2) in object code or executable form under the terms of
|
|
||||||
Sections 1 and 2 above provided that you also do one of the following:
|
|
||||||
|
|
||||||
a) 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; or,
|
|
||||||
|
|
||||||
b) Accompany it with a written offer, valid for at least three
|
|
||||||
years, to give any third party, for a charge no more than your
|
|
||||||
cost of physically performing source distribution, a complete
|
|
||||||
machine-readable copy of the corresponding source code, to be
|
|
||||||
distributed under the terms of Sections 1 and 2 above on a medium
|
|
||||||
customarily used for software interchange; or,
|
|
||||||
|
|
||||||
c) Accompany it with the information you received as to the offer
|
|
||||||
to distribute corresponding source code. (This alternative is
|
|
||||||
allowed only for noncommercial distribution and only if you
|
|
||||||
received the program in object code or executable form with such
|
|
||||||
an offer, in accord with Subsection b above.)
|
|
||||||
|
|
||||||
The source code for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For an executable work, 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 executable. However, as a
|
|
||||||
special exception, the source code 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.
|
|
||||||
|
|
||||||
If distribution of executable or 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 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
|
|
||||||
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.
|
|
||||||
|
|
||||||
5. 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 Program or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Program (or any work based on the
|
|
||||||
Program), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Program or works based on it.
|
|
||||||
|
|
||||||
6. Each time you redistribute the Program (or any work based on the
|
|
||||||
Program), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute or modify the Program 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 to
|
|
||||||
this License.
|
|
||||||
|
|
||||||
7. 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 Program at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Program 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 Program.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
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.
|
|
||||||
|
|
||||||
9. The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the 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 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 Program does not specify a version number of
|
|
||||||
this License, you may choose any version ever published by the Free Software
|
|
||||||
Foundation.
|
|
||||||
|
|
||||||
10. If you wish to incorporate parts of the Program into other free
|
|
||||||
programs whose distribution conditions are different, 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
|
|
||||||
|
|
||||||
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
|
|
||||||
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.
|
|
||||||
|
|
||||||
12. 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 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.
|
|
||||||
|
|
||||||
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
|
|
||||||
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
|
|
||||||
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) 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
|
|
||||||
the Free Software Foundation; either version 2 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, 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) 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.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, the commands you use may
|
|
||||||
be called something other than `show w' and `show c'; they could even be
|
|
||||||
mouse-clicks or menu items--whatever suits your program.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
|
||||||
necessary. Here is a sample; alter the names:
|
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1989
|
|
||||||
Ty Coon, President of Vice
|
|
||||||
|
|
||||||
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 Library General
|
|
||||||
Public License instead of this License.
|
|
@@ -1,11 +0,0 @@
|
|||||||
<group>
|
|
||||||
<directory name="apps">
|
|
||||||
<xi:include href="apps/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="lib">
|
|
||||||
<xi:include href="lib/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="server">
|
|
||||||
<xi:include href="server/os2srv.xml" />
|
|
||||||
</directory>
|
|
||||||
</group>
|
|
@@ -1,5 +0,0 @@
|
|||||||
<group>
|
|
||||||
<directory name="doscalls">
|
|
||||||
<xi:include href="doscalls/doscalls.xml" />
|
|
||||||
</directory>
|
|
||||||
</group>
|
|
5
os2/lib/doscalls/.cvsignore
Normal file
5
os2/lib/doscalls/.cvsignore
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
*.exe
|
||||||
|
*.o
|
||||||
|
*.sym
|
||||||
|
*.dll
|
||||||
|
*.coff
|
1
os2/lib/doscalls/devices/.cvsignore
Normal file
1
os2/lib/doscalls/devices/.cvsignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.o
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id$
|
/* $Id: devices.cpp,v 1.5 2004/01/31 01:29:11 robertk Exp $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
@@ -1,4 +1,38 @@
|
|||||||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS-OS/2 subsystem base services\0"
|
#include <defines.h>
|
||||||
#define REACTOS_STR_INTERNAL_NAME "doscalls\0"
|
#include <reactos/resource.h>
|
||||||
#define REACTOS_STR_ORIGINAL_FILENAME "doscalls.dll\0"
|
|
||||||
#include <reactos/version.rc>
|
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||||
|
|
||||||
|
VS_VERSION_INFO VERSIONINFO
|
||||||
|
FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD
|
||||||
|
PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD
|
||||||
|
FILEFLAGSMASK 0x3fL
|
||||||
|
#ifdef _DEBUG
|
||||||
|
FILEFLAGS 0x1L
|
||||||
|
#else
|
||||||
|
FILEFLAGS 0x0L
|
||||||
|
#endif
|
||||||
|
FILEOS 0x40004L
|
||||||
|
FILETYPE 0x2L
|
||||||
|
FILESUBTYPE 0x0L
|
||||||
|
BEGIN
|
||||||
|
BLOCK "StringFileInfo"
|
||||||
|
BEGIN
|
||||||
|
BLOCK "040904b0"
|
||||||
|
BEGIN
|
||||||
|
VALUE "CompanyName", RES_STR_COMPANY_NAME
|
||||||
|
VALUE "FileDescription", "OS2 subsystem base services\0"
|
||||||
|
VALUE "FileVersion", RES_STR_FILE_VERSION
|
||||||
|
VALUE "InternalName", "doscalls\0"
|
||||||
|
VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT
|
||||||
|
VALUE "OriginalFilename", "doscalls.dll\0"
|
||||||
|
VALUE "ProductName", RES_STR_PRODUCT_NAME
|
||||||
|
VALUE "ProductVersion", RES_STR_PRODUCT_VERSION
|
||||||
|
END
|
||||||
|
END
|
||||||
|
BLOCK "VarFileInfo"
|
||||||
|
BEGIN
|
||||||
|
VALUE "Translation", 0x409, 1200
|
||||||
|
END
|
||||||
|
END
|
||||||
|
|
||||||
|
@@ -1,23 +0,0 @@
|
|||||||
<module name="doscalls" type="nativedll">
|
|
||||||
<importlibrary definition="doscalls.def" />
|
|
||||||
<include base="doscalls">../../include</include>
|
|
||||||
<linkerflag>-lgcc</linkerflag>
|
|
||||||
<directory name="devices">
|
|
||||||
<file>devices.cpp</file>
|
|
||||||
<file>ioctl_async.cpp</file>
|
|
||||||
</directory>
|
|
||||||
<directory name="file">
|
|
||||||
<file>directory.cpp</file>
|
|
||||||
<file>openclose.cpp</file>
|
|
||||||
</directory>
|
|
||||||
<directory name="memory">
|
|
||||||
<file>memory.cpp</file>
|
|
||||||
</directory>
|
|
||||||
<directory name="misc">
|
|
||||||
<file>doscalls.cpp</file>
|
|
||||||
<file>error.cpp</file>
|
|
||||||
</directory>
|
|
||||||
<directory name="run">
|
|
||||||
<file>process.cpp</file>
|
|
||||||
</directory>
|
|
||||||
</module>
|
|
1
os2/lib/doscalls/file/.cvsignore
Normal file
1
os2/lib/doscalls/file/.cvsignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.o
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id$
|
/* $Id: directory.cpp,v 1.1 2002/09/04 22:19:47 robertk Exp $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id$
|
/* $Id: openclose.cpp,v 1.5 2004/01/31 01:29:11 robertk Exp $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
1
os2/lib/doscalls/misc/.cvsignore
Normal file
1
os2/lib/doscalls/misc/.cvsignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.o
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id$
|
/* $Id: doscalls.cpp,v 1.1 2002/07/26 00:23:13 robertk Exp $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id$
|
/* $Id: error.cpp,v 1.3 2003/01/07 16:23:11 robd Exp $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
1
os2/lib/doscalls/run/.cvsignore
Normal file
1
os2/lib/doscalls/run/.cvsignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.o
|
@@ -1,4 +1,4 @@
|
|||||||
/* $Id$
|
/* $Id: process.cpp,v 1.6 2003/01/07 16:23:11 robd Exp $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@@ -31,7 +31,7 @@ APIRET STDCALL DosSleep(ULONG msec)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* $Id$ */
|
/* $Id: process.cpp,v 1.6 2003/01/07 16:23:11 robd Exp $ */
|
||||||
/* Terminates the current thread or the current Process.
|
/* Terminates the current thread or the current Process.
|
||||||
Decission is made by action
|
Decission is made by action
|
||||||
FIXME: move this code to OS2.EXE */
|
FIXME: move this code to OS2.EXE */
|
||||||
|
14
os2/makefile
14
os2/makefile
@@ -1,14 +0,0 @@
|
|||||||
all:
|
|
||||||
@echo To build "os2" there are two paths:
|
|
||||||
@echo ---
|
|
||||||
@echo 1. copy the os2 folder into the reactos\modules folder
|
|
||||||
@echo 2. link reactos/modules/os2 to os2
|
|
||||||
@echo UNIX
|
|
||||||
@echo cd $${ROS_SRC_ROOT}/reactos/modules
|
|
||||||
@echo ln -s $${ROS_SRC_ROOT}/os2 os2
|
|
||||||
@echo WINDOWS
|
|
||||||
@echo cd %%ROS_SRC_ROOT%%\reactos\modules
|
|
||||||
@echo junction os2 %%ROS_SRC_ROOT%%\os2
|
|
||||||
@echo ---
|
|
||||||
@echo Eventually you can run "make depends" in the %%ROS_SRC_ROOT%%\reactos
|
|
||||||
@echo directory to compile it.
|
|
3
os2/server/.cvsignore
Normal file
3
os2/server/.cvsignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
*.exe
|
||||||
|
*.o
|
||||||
|
*.sym
|
@@ -1,50 +0,0 @@
|
|||||||
/* $Id$
|
|
||||||
*
|
|
||||||
* dllmain.c - OS/2 Enviroment Subsystem Server
|
|
||||||
*
|
|
||||||
* ReactOS Operating System
|
|
||||||
*
|
|
||||||
* --------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* This software 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 2 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This software 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 software; see the file COPYING.LIB. If not, write
|
|
||||||
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
|
|
||||||
* MA 02139, USA.
|
|
||||||
*
|
|
||||||
* --------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#include "os2srv.h"
|
|
||||||
|
|
||||||
#define NDEBUG
|
|
||||||
#include <debug.h>
|
|
||||||
|
|
||||||
/* DLL entry point */
|
|
||||||
|
|
||||||
HANDLE Os2SrvDllHandle = 0;
|
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
|
||||||
|
|
||||||
BOOL STDCALL
|
|
||||||
DllMain(HANDLE hDll,
|
|
||||||
DWORD dwReason,
|
|
||||||
LPVOID lpReserved)
|
|
||||||
{
|
|
||||||
if (DLL_PROCESS_ATTACH == dwReason)
|
|
||||||
{
|
|
||||||
Os2SrvDllHandle = hDll;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
|
34
os2/server/makefile
Normal file
34
os2/server/makefile
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# $Id: makefile,v 1.3 2003/01/12 02:03:06 robd Exp $
|
||||||
|
|
||||||
|
PATH_TO_TOP = ../../reactos
|
||||||
|
|
||||||
|
TARGET_TYPE = program
|
||||||
|
|
||||||
|
TARGET_NORC = yes
|
||||||
|
|
||||||
|
TARGET_APPTYPE = native
|
||||||
|
|
||||||
|
TARGET_NAME = os2ss
|
||||||
|
|
||||||
|
TARGET_INSTALLDIR = system32
|
||||||
|
|
||||||
|
TARGET_CFLAGS = -D__NTAPP__
|
||||||
|
|
||||||
|
TARGET_SDKLIBS = ntdll.a kernel32.a csrss.a
|
||||||
|
|
||||||
|
TARGET_GCCLIBS = stdc++
|
||||||
|
|
||||||
|
OBJECTS_API =
|
||||||
|
|
||||||
|
OBJECTS_MISC = \
|
||||||
|
$(TARGET_NAME).o
|
||||||
|
|
||||||
|
TARGET_OBJECTS = \
|
||||||
|
$(OBJECTS_API) \
|
||||||
|
$(OBJECTS_MISC)
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
include $(TOOLS_PATH)/helper.mk
|
||||||
|
|
||||||
|
# EOF
|
@@ -1,3 +0,0 @@
|
|||||||
LIBRARY os2srv.dll
|
|
||||||
EXPORTS
|
|
||||||
ServerDllInitialization@8
|
|
@@ -1,13 +0,0 @@
|
|||||||
#ifndef _OS2SS_H_INCLUDED_
|
|
||||||
#define _OS2SS_H_INCLUDED_
|
|
||||||
|
|
||||||
/* PSDK/NDK Headers */
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#define NTOS_MODE_USER
|
|
||||||
#include <ndk/ntndk.h>
|
|
||||||
|
|
||||||
#include <csr/server.h>
|
|
||||||
|
|
||||||
#endif /* ndef _OS2SS_H_INCLUDED_ */
|
|
@@ -1,4 +0,0 @@
|
|||||||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS-OS/2 Environment Subsystem Server\0"
|
|
||||||
#define REACTOS_STR_INTERNAL_NAME "os2srv\0"
|
|
||||||
#define REACTOS_STR_ORIGINAL_FILENAME "os2srv.dll\0"
|
|
||||||
#include <reactos/version.rc>
|
|
@@ -1,11 +0,0 @@
|
|||||||
<module name="os2srv" type="nativedll">
|
|
||||||
<importlibrary definition="os2srv.def" />
|
|
||||||
<include base="os2srv">.</include>
|
|
||||||
<define name="__USE_W32API" />
|
|
||||||
<define name="_DISABLE_TIDENTS" />
|
|
||||||
<library>ntdll</library>
|
|
||||||
<library>csrsrv</library>
|
|
||||||
<file>dllmain.c</file>
|
|
||||||
<file>server.c</file>
|
|
||||||
<file>os2srv.rc</file>
|
|
||||||
</module>
|
|
157
os2/server/os2ss.cpp
Normal file
157
os2/server/os2ss.cpp
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
/* $Id: os2ss.cpp,v 1.2 2003/01/07 16:23:12 robd Exp $
|
||||||
|
*
|
||||||
|
* reactos/subsys/csrss/api/process.c
|
||||||
|
*
|
||||||
|
* "\windows\ApiPort" port process management functions
|
||||||
|
*
|
||||||
|
* ReactOS Operating System
|
||||||
|
*/
|
||||||
|
// TODO: Rewrite the whole file. This is just a copy
|
||||||
|
|
||||||
|
#include <ddk/ntddk.h>
|
||||||
|
#include <ntdll/rtl.h>
|
||||||
|
#include <ntos/synch.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
BOOL CsrServerInitialization(ULONG ArgumentCount, PWSTR *ArgumentArray);
|
||||||
|
VOID DisplayString(LPCWSTR lpwString);
|
||||||
|
//BOOL STDCALL CsrServerInitialization (ULONG ArgumentCount, PWSTR *ArgumentArray);
|
||||||
|
//VOID STDCALL DisplayString(LPCWSTR lpwString);
|
||||||
|
//VOID STDCALL PrintString (char* fmt, ...);
|
||||||
|
//NTSTATUS STDCALL NtDisplayString(IN PUNICODE_STRING DisplayString);
|
||||||
|
|
||||||
|
void
|
||||||
|
DisplayString(LPCWSTR lpwString)
|
||||||
|
{
|
||||||
|
UNICODE_STRING us;
|
||||||
|
|
||||||
|
RtlInitUnicodeString(&us, lpwString);
|
||||||
|
NtDisplayString(&us);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
void
|
||||||
|
PrintString(char* fmt,...)
|
||||||
|
{
|
||||||
|
char buffer[512];
|
||||||
|
va_list ap;
|
||||||
|
UNICODE_STRING UnicodeString;
|
||||||
|
ANSI_STRING AnsiString;
|
||||||
|
|
||||||
|
va_start(ap, fmt);
|
||||||
|
vsprintf(buffer, fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
|
RtlInitAnsiString(&AnsiString, buffer);
|
||||||
|
RtlAnsiStringToUnicodeString(&UnicodeString,
|
||||||
|
&AnsiString,
|
||||||
|
TRUE);
|
||||||
|
NtDisplayString(&UnicodeString);
|
||||||
|
RtlFreeUnicodeString(&UnicodeString);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* server variables */
|
||||||
|
|
||||||
|
int NumProcesses;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Native image's entry point */
|
||||||
|
|
||||||
|
void NtProcessStartup (PPEB Peb)
|
||||||
|
{
|
||||||
|
PRTL_USER_PROCESS_PARAMETERS ProcParams;
|
||||||
|
PWSTR ArgBuffer;
|
||||||
|
PWSTR *argv;
|
||||||
|
ULONG argc = 0;
|
||||||
|
int i = 0;
|
||||||
|
int afterlastspace = 0;
|
||||||
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
|
HANDLE CsrssInitEvent;
|
||||||
|
UNICODE_STRING UnicodeString;
|
||||||
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
ProcParams = RtlNormalizeProcessParams (Peb->ProcessParameters);
|
||||||
|
|
||||||
|
argv = (PWSTR *)RtlAllocateHeap (Peb->ProcessHeap,
|
||||||
|
0, 512 * sizeof(PWSTR));
|
||||||
|
ArgBuffer = (PWSTR)RtlAllocateHeap (Peb->ProcessHeap,
|
||||||
|
0,
|
||||||
|
ProcParams->CommandLine.Length + sizeof(WCHAR));
|
||||||
|
memcpy (ArgBuffer,
|
||||||
|
ProcParams->CommandLine.Buffer,
|
||||||
|
ProcParams->CommandLine.Length + sizeof(WCHAR));
|
||||||
|
|
||||||
|
while (ArgBuffer[i])
|
||||||
|
{
|
||||||
|
if (ArgBuffer[i] == L' ')
|
||||||
|
{
|
||||||
|
argc++;
|
||||||
|
ArgBuffer[i] = L'\0';
|
||||||
|
argv[argc-1] = &(ArgBuffer[afterlastspace]);
|
||||||
|
i++;
|
||||||
|
while (ArgBuffer[i] == L' ')
|
||||||
|
i++;
|
||||||
|
afterlastspace = i;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ArgBuffer[afterlastspace] != L'\0')
|
||||||
|
{
|
||||||
|
argc++;
|
||||||
|
ArgBuffer[i] = L'\0';
|
||||||
|
argv[argc-1] = &(ArgBuffer[afterlastspace]);
|
||||||
|
}
|
||||||
|
|
||||||
|
RtlInitUnicodeString(&UnicodeString,
|
||||||
|
L"\\CsrssInitDone");
|
||||||
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
&UnicodeString,
|
||||||
|
EVENT_ALL_ACCESS,
|
||||||
|
0,
|
||||||
|
NULL);
|
||||||
|
Status = NtOpenEvent(&CsrssInitEvent,
|
||||||
|
EVENT_ALL_ACCESS,
|
||||||
|
&ObjectAttributes);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DbgPrint("CSR: Failed to open csrss notification event\n");
|
||||||
|
}
|
||||||
|
if (CsrServerInitialization (argc, argv) == TRUE)
|
||||||
|
{
|
||||||
|
|
||||||
|
NtSetEvent(CsrssInitEvent,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
RtlFreeHeap (Peb->ProcessHeap,
|
||||||
|
0, argv);
|
||||||
|
RtlFreeHeap (Peb->ProcessHeap,
|
||||||
|
0,
|
||||||
|
ArgBuffer);
|
||||||
|
|
||||||
|
/* terminate the current thread only */
|
||||||
|
NtTerminateThread( NtCurrentThread(), 0 );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DisplayString( L"CSR: Subsystem initialization failed.\n" );
|
||||||
|
|
||||||
|
RtlFreeHeap (Peb->ProcessHeap,
|
||||||
|
0, argv);
|
||||||
|
RtlFreeHeap (Peb->ProcessHeap,
|
||||||
|
0,
|
||||||
|
ArgBuffer);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Tell SM we failed.
|
||||||
|
*/
|
||||||
|
NtTerminateProcess( NtCurrentProcess(), 0 );
|
||||||
|
}
|
||||||
|
}
|
@@ -1,84 +0,0 @@
|
|||||||
/* $Id$
|
|
||||||
*
|
|
||||||
* server.c - OS/2 Enviroment Subsystem Server - Initialization
|
|
||||||
*
|
|
||||||
* ReactOS Operating System
|
|
||||||
*
|
|
||||||
* --------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* This software 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 2 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This software 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 software; see the file COPYING.LIB. If not, write
|
|
||||||
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
|
|
||||||
* MA 02139, USA.
|
|
||||||
*
|
|
||||||
* --------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
#include "os2srv.h"
|
|
||||||
|
|
||||||
//#define NDEBUG
|
|
||||||
#include <debug.h>
|
|
||||||
|
|
||||||
HANDLE Os2ApiPort = NULL;
|
|
||||||
|
|
||||||
/**********************************************************************
|
|
||||||
* NAME PRIVATE
|
|
||||||
* Os2StaticServerThread/1
|
|
||||||
*/
|
|
||||||
VOID STDCALL Os2StaticServerThread (PVOID x)
|
|
||||||
{
|
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
|
||||||
PPORT_MESSAGE Request = (PPORT_MESSAGE) x;
|
|
||||||
PPORT_MESSAGE Reply = NULL;
|
|
||||||
ULONG MessageType = 0;
|
|
||||||
|
|
||||||
DPRINT("VMSSRV: %s called\n", __FUNCTION__);
|
|
||||||
|
|
||||||
MessageType = Request->u2.s2.Type;
|
|
||||||
DPRINT("VMSSRV: %s received a message (Type=%d)\n",
|
|
||||||
__FUNCTION__, MessageType);
|
|
||||||
switch (MessageType)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
Reply = Request;
|
|
||||||
Status = NtReplyPort (Os2ApiPort, Reply);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*=====================================================================
|
|
||||||
* PUBLIC API
|
|
||||||
*===================================================================*/
|
|
||||||
|
|
||||||
NTSTATUS STDCALL ServerDllInitialization (ULONG ArgumentCount,
|
|
||||||
LPWSTR *Argument)
|
|
||||||
{
|
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
|
||||||
|
|
||||||
DPRINT("VMSSRV: %s called\n", __FUNCTION__);
|
|
||||||
|
|
||||||
// Get the listening port from csrsrv.dll
|
|
||||||
Os2ApiPort = CsrQueryApiPort ();
|
|
||||||
if (NULL == Os2ApiPort)
|
|
||||||
{
|
|
||||||
return STATUS_UNSUCCESSFUL;
|
|
||||||
}
|
|
||||||
// Register our message dispatcher
|
|
||||||
Status = CsrAddStaticServerThread (Os2StaticServerThread);
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
//TODO: perform the real OS/2 server internal initialization here
|
|
||||||
}
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
|
168
posix/Makefile
168
posix/Makefile
@@ -1,14 +1,154 @@
|
|||||||
all:
|
# $Id: Makefile,v 1.7 2003/01/05 18:29:41 robd Exp $
|
||||||
@echo To build "posix" there are two paths:
|
#
|
||||||
@echo ---
|
# ReactOS POSIX+ Personality
|
||||||
@echo 1. copy the posix folder into the reactos\modules folder
|
#
|
||||||
@echo 2. link reactos/modules/posix to posix
|
|
||||||
@echo UNIX
|
PATH_TO_TOP = ../reactos
|
||||||
@echo cd $${ROS_SRC_ROOT}/reactos/modules
|
|
||||||
@echo ln -s $${ROS_SRC_ROOT}/posix posix
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
@echo WINDOWS
|
|
||||||
@echo cd %%ROS_SRC_ROOT%%\reactos\modules
|
|
||||||
@echo junction posix %%ROS_SRC_ROOT%%\posix
|
POSIX_OTHER = server #lib
|
||||||
@echo ---
|
|
||||||
@echo Eventually you can run "make depends" in the %%ROS_SRC_ROOT%%\reactos
|
POSIX_TOOLS = mksystab
|
||||||
@echo directory to compile it.
|
|
||||||
|
POSIX_LIBS = psxdll psxx
|
||||||
|
|
||||||
|
POSIX_APPS = baresh posixw32
|
||||||
|
|
||||||
|
POSIX_MODULES = $(POSIX_OTHER) $(POSIX_TOOLS) $(POSIX_LIBS) $(POSIX_APPS)
|
||||||
|
|
||||||
|
all: implib $(POSIX_MODULES)
|
||||||
|
|
||||||
|
implib: $(POSIX_MODULES:%=%_implib)
|
||||||
|
|
||||||
|
clean: $(POSIX_MODULES:%=%_clean)
|
||||||
|
|
||||||
|
install: $(POSIX_MODULES:%=%_install)
|
||||||
|
|
||||||
|
#dist: $(TOOLS_PATH)/rcopy$(EXE_POSTFIX) dist_clean dist_dirs \
|
||||||
|
# $(POSIX_MODULES:%=%_dist)
|
||||||
|
|
||||||
|
.PHONY: all implib clean
|
||||||
|
#.PHONY: all implib install dist
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Other POSIX+ Modules
|
||||||
|
#
|
||||||
|
$(POSIX_OTHER): %:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/$*
|
||||||
|
|
||||||
|
$(POSIX_OTHER:%=%_implib): %_implib:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/$* implib
|
||||||
|
|
||||||
|
$(POSIX_OTHER:%=%_clean): %_clean:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/$* clean
|
||||||
|
|
||||||
|
$(POSIX_OTHER:%=%_dist): %_dist:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/$* dist
|
||||||
|
|
||||||
|
$(POSIX_OTHER:%=%_install): %_install:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/$* install
|
||||||
|
|
||||||
|
.PHONY: $(POSIX_OTHER) $(POSIX_OTHER:%=%_implib) $(POSIX_OTHER:%=%_clean) $(POSIX_OTHER:%=%_install) $(POSIX_OTHER:%=%_dist)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# POSIX+ Tools
|
||||||
|
#
|
||||||
|
$(POSIX_TOOLS): %:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/tools/$*
|
||||||
|
|
||||||
|
$(POSIX_TOOLS:%=%_implib): %_implib:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/tools/$* implib
|
||||||
|
|
||||||
|
$(POSIX_TOOLS:%=%_clean): %_clean:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/tools/$* clean
|
||||||
|
|
||||||
|
$(POSIX_TOOLS:%=%_dist): %_dist:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/tools/$* dist
|
||||||
|
|
||||||
|
$(POSIX_TOOLS:%=%_install): %_install:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/tools/$* install
|
||||||
|
|
||||||
|
.PHONY: $(POSIX_LIBS) $(POSIX_LIBS:%=%_implib) $(POSIX_LIBS:%=%_clean) $(POSIX_LIBS:%=%_install) $(POSIX_LIBS:%=%_dist)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# POSIX+ DLLs
|
||||||
|
#
|
||||||
|
$(POSIX_LIBS): %:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/lib/$*
|
||||||
|
|
||||||
|
$(POSIX_LIBS:%=%_implib): %_implib:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/lib/$* implib
|
||||||
|
|
||||||
|
$(POSIX_LIBS:%=%_clean): %_clean:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/lib/$* clean
|
||||||
|
|
||||||
|
$(POSIX_LIBS:%=%_dist): %_dist:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/lib/$* dist
|
||||||
|
|
||||||
|
$(POSIX_LIBS:%=%_install): %_install:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/lib/$* install
|
||||||
|
|
||||||
|
.PHONY: $(POSIX_LIBS) $(POSIX_LIBS:%=%_implib) $(POSIX_LIBS:%=%_clean) $(POSIX_LIBS:%=%_install) $(POSIX_LIBS:%=%_dist)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# POSIX+ Programs
|
||||||
|
#
|
||||||
|
$(POSIX_APPS): %:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/apps/$*
|
||||||
|
|
||||||
|
$(POSIX_APPS:%=%_implib): %_implib:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/apps/$* implib
|
||||||
|
|
||||||
|
$(POSIX_APPS:%=%_clean): %_clean:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/apps/$* clean
|
||||||
|
|
||||||
|
$(POSIX_APPS:%=%_dist): %_dist:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/apps/$* dist
|
||||||
|
|
||||||
|
$(POSIX_APPS:%=%_install): %_install:
|
||||||
|
make -f Makefile -C $(POSIX_PATH)/apps/$* install
|
||||||
|
|
||||||
|
.PHONY: $(POSIX_APPS) $(POSIX_APPS:%=%_implib) $(POSIX_APPS:%=%_clean) $(POSIX_APPS:%=%_install) $(POSIX_APPS:%=%_dist)
|
||||||
|
|
||||||
|
|
||||||
|
etags:
|
||||||
|
find . -name "*.[ch]" -print | etags --language=c -
|
||||||
|
|
||||||
|
# EOF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#CFLAGS=-Iinclude
|
||||||
|
|
||||||
|
#all: lib/crt0w32.o
|
||||||
|
# make -C tools
|
||||||
|
# make -C lib
|
||||||
|
# make -C server
|
||||||
|
# make -C lib/psxdll
|
||||||
|
# make -C lib/psxx
|
||||||
|
# make -C apps/baresh
|
||||||
|
# make -C apps/posixw32
|
||||||
|
|
||||||
|
#lib/crt0w32.o: lib/crt0w32.c
|
||||||
|
|
||||||
|
#implib:
|
||||||
|
|
||||||
|
#clean:
|
||||||
|
# make -C lib clean
|
||||||
|
# make -C tools clean
|
||||||
|
# make -C server clean
|
||||||
|
# make -C lib/psxdll clean
|
||||||
|
# make -C lib/psxx clean
|
||||||
|
# make -C apps/baresh clean
|
||||||
|
# make -C apps/posixw32 clean
|
||||||
|
# - $(RM) lib/crt0w32.o
|
||||||
|
|
||||||
|
#include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
# EOF
|
||||||
|
340
posix/copying
340
posix/copying
@@ -1,340 +0,0 @@
|
|||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
License is intended to guarantee your freedom to share and change free
|
|
||||||
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 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
|
|
||||||
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 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 make restrictions that forbid
|
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
|
||||||
These restrictions translate to certain responsibilities for you if you
|
|
||||||
distribute copies of the software, or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must give the recipients all the rights that
|
|
||||||
you have. 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.
|
|
||||||
|
|
||||||
We protect your rights with two steps: (1) copyright the software, and
|
|
||||||
(2) offer you this license which gives you legal permission to copy,
|
|
||||||
distribute and/or modify the software.
|
|
||||||
|
|
||||||
Also, for each author's protection and ours, we want to make certain
|
|
||||||
that everyone understands that there is no warranty for this free
|
|
||||||
software. If the software is modified by someone else and passed on, we
|
|
||||||
want its recipients to know that what they have is not the original, so
|
|
||||||
that any problems introduced by others will not reflect on the original
|
|
||||||
authors' reputations.
|
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
|
||||||
patents. We wish to avoid the danger that redistributors of a free
|
|
||||||
program will individually obtain patent licenses, in effect making the
|
|
||||||
program proprietary. To prevent this, we have made it clear that any
|
|
||||||
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
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
|
||||||
a notice placed by the copyright holder saying it may be distributed
|
|
||||||
under the terms of this General Public License. The "Program", below,
|
|
||||||
refers to any such program or work, and a "work based on the Program"
|
|
||||||
means either the Program or any derivative work under copyright law:
|
|
||||||
that is to say, a work containing the Program or a portion of it,
|
|
||||||
either verbatim or with modifications and/or translated into another
|
|
||||||
language. (Hereinafter, translation is included without limitation in
|
|
||||||
the term "modification".) Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running the Program is not restricted, and the output from the Program
|
|
||||||
is covered only if its contents constitute a work based on the
|
|
||||||
Program (independent of having been made by running the Program).
|
|
||||||
Whether that is true depends on what the Program does.
|
|
||||||
|
|
||||||
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
|
|
||||||
notices that refer to this License and to the absence of any warranty;
|
|
||||||
and give any other recipients of the Program a copy of this License
|
|
||||||
along with the Program.
|
|
||||||
|
|
||||||
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 Program or any portion
|
|
||||||
of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
b) You must cause any work that you distribute or publish, that in
|
|
||||||
whole or in part contains or is derived from the Program or any
|
|
||||||
part thereof, to be licensed as a whole at no charge to all third
|
|
||||||
parties under the terms of this License.
|
|
||||||
|
|
||||||
c) If the modified program normally reads commands interactively
|
|
||||||
when run, you must cause it, when started running for such
|
|
||||||
interactive use in the most ordinary way, to print or display an
|
|
||||||
announcement including an appropriate copyright notice and a
|
|
||||||
notice that there is no warranty (or else, saying that you provide
|
|
||||||
a warranty) and that users may redistribute the program under
|
|
||||||
these conditions, and telling the user how to view a copy of this
|
|
||||||
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
|
|
||||||
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 Program, 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 Program.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Program
|
|
||||||
with the Program (or with a work based on the Program) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may copy and distribute the Program (or a work based on it,
|
|
||||||
under Section 2) in object code or executable form under the terms of
|
|
||||||
Sections 1 and 2 above provided that you also do one of the following:
|
|
||||||
|
|
||||||
a) 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; or,
|
|
||||||
|
|
||||||
b) Accompany it with a written offer, valid for at least three
|
|
||||||
years, to give any third party, for a charge no more than your
|
|
||||||
cost of physically performing source distribution, a complete
|
|
||||||
machine-readable copy of the corresponding source code, to be
|
|
||||||
distributed under the terms of Sections 1 and 2 above on a medium
|
|
||||||
customarily used for software interchange; or,
|
|
||||||
|
|
||||||
c) Accompany it with the information you received as to the offer
|
|
||||||
to distribute corresponding source code. (This alternative is
|
|
||||||
allowed only for noncommercial distribution and only if you
|
|
||||||
received the program in object code or executable form with such
|
|
||||||
an offer, in accord with Subsection b above.)
|
|
||||||
|
|
||||||
The source code for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For an executable work, 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 executable. However, as a
|
|
||||||
special exception, the source code 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.
|
|
||||||
|
|
||||||
If distribution of executable or 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 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
|
|
||||||
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.
|
|
||||||
|
|
||||||
5. 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 Program or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Program (or any work based on the
|
|
||||||
Program), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Program or works based on it.
|
|
||||||
|
|
||||||
6. Each time you redistribute the Program (or any work based on the
|
|
||||||
Program), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute or modify the Program 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 to
|
|
||||||
this License.
|
|
||||||
|
|
||||||
7. 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 Program at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Program 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 Program.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
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
|
|
||||||
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.
|
|
||||||
|
|
||||||
9. The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the 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 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 Program does not specify a version number of
|
|
||||||
this License, you may choose any version ever published by the Free Software
|
|
||||||
Foundation.
|
|
||||||
|
|
||||||
10. If you wish to incorporate parts of the Program into other free
|
|
||||||
programs whose distribution conditions are different, 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
|
|
||||||
|
|
||||||
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
|
|
||||||
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.
|
|
||||||
|
|
||||||
12. 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 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.
|
|
||||||
|
|
||||||
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
|
|
||||||
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
|
|
||||||
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) 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
|
|
||||||
the Free Software Foundation; either version 2 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, 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) 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.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, the commands you use may
|
|
||||||
be called something other than `show w' and `show c'; they could even be
|
|
||||||
mouse-clicks or menu items--whatever suits your program.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or your
|
|
||||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
|
||||||
necessary. Here is a sample; alter the names:
|
|
||||||
|
|
||||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
|
||||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
|
||||||
|
|
||||||
<signature of Ty Coon>, 1 April 1989
|
|
||||||
Ty Coon, President of Vice
|
|
||||||
|
|
||||||
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 Library General
|
|
||||||
Public License instead of this License.
|
|
@@ -1,14 +0,0 @@
|
|||||||
<group>
|
|
||||||
<directory name="tools">
|
|
||||||
<xi:include href="tools/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="apps">
|
|
||||||
<xi:include href="apps/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="lib">
|
|
||||||
<xi:include href="lib/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="server">
|
|
||||||
<xi:include href="server/psxsrv.xml" />
|
|
||||||
</directory>
|
|
||||||
</group>
|
|
@@ -3,7 +3,7 @@
|
|||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
675 Mass Ave, Cambridge, MA 02139, USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@@ -280,7 +280,7 @@ POSSIBILITY OF SUCH DAMAGES.
|
|||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
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
|
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
|
possible use to the public, the best way to achieve this is to make it
|
||||||
@@ -292,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.
|
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.>
|
<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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -306,15 +306,14 @@ the "copyright" line and a pointer to where the full notice is found.
|
|||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
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
|
If the program is interactive, make it output a short notice like this
|
||||||
when it starts in an interactive mode:
|
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'.
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it
|
This is free software, and you are welcome to redistribute it
|
||||||
under certain conditions; type `show c' for details.
|
under certain conditions; type `show c' for details.
|
||||||
|
@@ -4,7 +4,7 @@ Emanuele Aliberti <ea@iol.it>
|
|||||||
Robert Bergkvist <fragdance@hotmail.com>
|
Robert Bergkvist <fragdance@hotmail.com>
|
||||||
Hartmut Birr <hartmut.birr@gmx.de>
|
Hartmut Birr <hartmut.birr@gmx.de>
|
||||||
Aleksey Bragin <aleksey@studiocerebral.com>
|
Aleksey Bragin <aleksey@studiocerebral.com>
|
||||||
Richard Campbell <betam4x@gmail.com>
|
Richard Campbell <eek2121@comcast.net>
|
||||||
Gunnar Andre' Dalsnes <hardon@online.no>
|
Gunnar Andre' Dalsnes <hardon@online.no>
|
||||||
Arindam Das
|
Arindam Das
|
||||||
Boudewijn Dekker <ariadne@xs4all.nl>
|
Boudewijn Dekker <ariadne@xs4all.nl>
|
||||||
@@ -46,9 +46,6 @@ Jason Weiler
|
|||||||
David Welch <welch@cwcom.net>
|
David Welch <welch@cwcom.net>
|
||||||
Jonathan Wilson <jonwil@tpgi.com.au>
|
Jonathan Wilson <jonwil@tpgi.com.au>
|
||||||
Art Yerkes <ayerkes@speakeasy.net>
|
Art Yerkes <ayerkes@speakeasy.net>
|
||||||
Magnus Olsen (magnus@greatlord.com)
|
|
||||||
Brandon Turner (turnerb7@msu.edu)
|
|
||||||
Christoph von Wittich (Christoph@ApiViewer.de)
|
|
||||||
|
|
||||||
Graphic Design from
|
Graphic Design from
|
||||||
|
|
||||||
|
@@ -7,72 +7,67 @@ ReactOS from http://www.reactos.com.
|
|||||||
|
|
||||||
2. Building ReactOS
|
2. Building ReactOS
|
||||||
|
|
||||||
2.1 Building the binaries
|
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
|
||||||
To build ReactOS run 'make' (wihout the quotes) if you are building on Linux
|
correct value for your cross-compiler. Run 'export HOST=mingw32-linux' to
|
||||||
or 'mingw32-make' if you are building on Windows (or ReactOS) from the top
|
tell the ReactOS build system that it is building ReactOS on a linux machine.
|
||||||
directory.
|
Now run 'make'.
|
||||||
|
|
||||||
|
|
||||||
2.2 Building a bootable CD image
|
|
||||||
|
|
||||||
To build a bootable CD image run 'make bootcd' (wihout the quotes) if you are
|
|
||||||
building on Linux or 'mingw32-make bootcd' if you are building on Windows (or
|
|
||||||
ReactOS) from the top directory. This will create a CD image with a filename,
|
|
||||||
ReactOS.iso, in the top directory.
|
|
||||||
|
|
||||||
|
|
||||||
3. Installation
|
3. Installation
|
||||||
|
|
||||||
ReactOS can only be installed on a machine that has a FAT16 or FAT32 partition
|
The system can only be installed on the first partition on the first harddisk.
|
||||||
as the active (bootable) partition. The partition on which ReactOS is to be
|
The partition must be formatted as FAT16 or FAT32. The system can only be
|
||||||
installed (which may or may not be the bootable partition) must also be
|
started from DOS and not from a Windows DOS-prompt.
|
||||||
formatted as FAT16 or FAT32. ReactOS Setup can format the partitions if
|
|
||||||
needed.
|
|
||||||
|
|
||||||
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.
|
distribution. The two ways to install ReactOS are explained below.
|
||||||
|
|
||||||
|
|
||||||
3.1 Installation from sources
|
3.1 Installation from sources
|
||||||
|
|
||||||
If you don't have an existing ReactOS installation you want to upgrade, then
|
To install ReactOS after building it, type 'make install'. This will create
|
||||||
build a bootable CD as described above. Burn the CD image, boot from it, and
|
the directory 'reactos' in the top directory. Copy this directory to the root
|
||||||
follow the instructions to install ReactOS.
|
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
|
If you don't want to copy the files manually every time you run a 'make install',
|
||||||
install ReactOS after building it, type 'make install' or
|
you can specify the directory where the files are to be copied to during
|
||||||
'mingw32-make install'. This will create the directory 'reactos' in the top
|
installation.
|
||||||
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
|
In rules.mak find the variable INSTALL_DIR and change the assigned value to the
|
||||||
'make install' or 'mingw32-make install', then you can specify the directory
|
name of the directory where the files are to be copied to. If you are using
|
||||||
where the files are to be copied to during installation.
|
Windows this could be:
|
||||||
|
|
||||||
Set the ROS_INSTALL environment variable. If you are on Windows this could be
|
INSTALL_DIR = c:\reactos
|
||||||
done by:
|
|
||||||
|
|
||||||
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
|
Save the changes to rules.mak and run 'make install' to install the files to
|
||||||
|
the new location. If you don't want to change rules.mak, you can specify the
|
||||||
Now run 'make install' or 'mingw32-make install' to install the files to the
|
installtion directory when invoking make. Run
|
||||||
new location.
|
'make INSTALL_DIR=c:\reactos install' to install to c:\reactos.
|
||||||
|
|
||||||
|
|
||||||
3.2 Installation from bootable CD distribution
|
3.2 Installation from binany distribution
|
||||||
|
|
||||||
To install ReactOS from the bootable CD distribution, extract the archive
|
To install ReactOS from the binary distribution, extract the archive contents
|
||||||
contents. Then burn the CD image, boot from it, and follow instructions.
|
to c:\reactos. Remember to extract the files with full paths.
|
||||||
|
|
||||||
|
|
||||||
|
4. Booting ReactOS
|
||||||
|
|
||||||
|
Startup in DOS mode. 'cd' to c:\reactos and type 'boot' and press <enter>.
|
||||||
|
A simple shell is started where you can use simple commands like 'cd' and 'dir'.
|
||||||
|
|
||||||
|
|
||||||
5. Help
|
5. Help
|
||||||
|
|
||||||
If you run into problems or have suggestions for making ReactOS better, please
|
If you run into problems or have suggestions for making ReactOS better, please
|
||||||
visit the address below and subscribe to one or more of the mailing lists.
|
surf to the address below and subscribe to one or more of the mailing lists.
|
||||||
|
|
||||||
http://www.reactos.com/en/content/view/full/66
|
http://www.reactos.com/index.php?tab=discussion§ion=lists
|
||||||
|
|
||||||
ReactOS Development Team
|
ReactOS Development Team
|
||||||
|
5
reactos/Jamfile
Normal file
5
reactos/Jamfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Main jamfile for ReactOS
|
||||||
|
|
||||||
|
SubDir ROS_TOP ;
|
||||||
|
|
||||||
|
SubInclude ROS_TOP Lib ;
|
54
reactos/Jamrules
Normal file
54
reactos/Jamrules
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
# customization for ReactOS goes here
|
||||||
|
|
||||||
|
# The SharedLibrary and SharedLibraryFromObjects rules were
|
||||||
|
# borrowed from here:
|
||||||
|
# http://www.differentpla.net/~roger/devel/jam/tutorial/shared_lib/index.html
|
||||||
|
|
||||||
|
SUFSHR = .dll ;
|
||||||
|
RM = rm ; # rm comes with MinGW, and the default del doesn't work in some cases
|
||||||
|
|
||||||
|
rule SharedLibrary
|
||||||
|
{
|
||||||
|
SharedLibraryFromObjects $(<) : $(>:S=$(SUFOBJ)) ;
|
||||||
|
Objects $(>) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
rule SharedLibraryFromObjects
|
||||||
|
{
|
||||||
|
local _s _t ;
|
||||||
|
|
||||||
|
# Add grist to file names
|
||||||
|
# Add suffix to dll
|
||||||
|
|
||||||
|
_s = [ FGristFiles $(>) ] ;
|
||||||
|
_t = [ FAppendSuffix $(<) : $(SUFSHR) ] ;
|
||||||
|
|
||||||
|
if $(_t) != $(<)
|
||||||
|
{
|
||||||
|
DEPENDS $(<) : $(_t) ;
|
||||||
|
NOTFILE $(<) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
# make compiled sources a dependency of target
|
||||||
|
|
||||||
|
DEPENDS exe : $(_t) ;
|
||||||
|
DEPENDS $(_t) : $(_s) ;
|
||||||
|
MakeLocate $(_t) : $(LOCATE_TARGET) ;
|
||||||
|
|
||||||
|
Clean clean : $(_t) ;
|
||||||
|
|
||||||
|
Link $(_t) : $(_s) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
# nasm needs to know the output file first, or it doesn't
|
||||||
|
# recognize -I :(
|
||||||
|
actions As
|
||||||
|
{
|
||||||
|
$(AS) -o $(<) $(ASFLAGS) -I$(HDRS) $(>)
|
||||||
|
}
|
||||||
|
|
||||||
|
AS = nasm ;
|
||||||
|
|
||||||
|
# why isn't DEFINES working? :(
|
||||||
|
#DEFINES += _M_IX86 ;
|
||||||
|
CCFLAGS += -D_M_IX86 ;
|
@@ -2,7 +2,7 @@
|
|||||||
Version 2.1, February 1999
|
Version 2.1, February 1999
|
||||||
|
|
||||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@@ -485,7 +485,7 @@ convey the exclusion of warranty; and each file should have at least the
|
|||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public
|
You should have received a copy of the GNU Lesser General Public
|
||||||
License along with this library; if not, write to the Free Software
|
License along with this library; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
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.
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
1428
reactos/Makefile
1428
reactos/Makefile
File diff suppressed because it is too large
Load Diff
@@ -1,91 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
|
|
||||||
<project name="ReactOS" makefile="makefile.ppc" xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
||||||
<xi:include href="config-ppc.xml">
|
|
||||||
<xi:fallback>
|
|
||||||
<xi:include href="config.template.xml" />
|
|
||||||
</xi:fallback>
|
|
||||||
</xi:include>
|
|
||||||
|
|
||||||
<xi:include href="baseaddress.xml" />
|
|
||||||
|
|
||||||
<property name="BOOTPROG_PREPARE" value="ppc-le2be" />
|
|
||||||
<property name="BOOTPROG_FLATFORMAT" value="-O elf32-powerpc -B powerpc:common" />
|
|
||||||
<property name="BOOTPROG_LINKFORMAT" value="-melf32ppc --no-omagic -Ttext 0xe00000 -Tdata 0xe10000" />
|
|
||||||
<property name="BOOTPROG_COPYFORMAT" value="--only-section=.text --only-section=.data --only-section=.bss -O aixcoff-rs6000" />
|
|
||||||
|
|
||||||
<define name="_M_PPC" />
|
|
||||||
<define name="_PPC_" />
|
|
||||||
<define name="__PowerPC__" />
|
|
||||||
<define name="_REACTOS_" />
|
|
||||||
<define name="__MINGW_IMPORT" empty="true" />
|
|
||||||
<define name="__restrict__" empty="true" />
|
|
||||||
<compilerflag>-v</compilerflag>
|
|
||||||
<if property="MP" value="1">
|
|
||||||
<define name="CONFIG_SMP" value="1" />
|
|
||||||
</if>
|
|
||||||
<if property="DBG" value="1">
|
|
||||||
<define name="DBG" value="1" />
|
|
||||||
<property name="DBG_OR_KDBG" value="true" />
|
|
||||||
</if>
|
|
||||||
<if property="DBG" value="0">
|
|
||||||
<compilerflag>-Os</compilerflag>
|
|
||||||
<compilerflag>-Wno-strict-aliasing</compilerflag>
|
|
||||||
</if>
|
|
||||||
<if property="KDBG" value="1">
|
|
||||||
<define name="KDBG" value="1" />
|
|
||||||
<property name="DBG_OR_KDBG" value="true" />
|
|
||||||
</if>
|
|
||||||
<compilerflag>-Wpointer-arith</compilerflag>
|
|
||||||
|
|
||||||
<include>.</include>
|
|
||||||
<include>include</include>
|
|
||||||
<include>include/reactos</include>
|
|
||||||
<include>include/libs</include>
|
|
||||||
<include>include/drivers</include>
|
|
||||||
<include>include/subsys</include>
|
|
||||||
<include>include/ndk</include>
|
|
||||||
<include>w32api/include</include>
|
|
||||||
<include>w32api/include/crt</include>
|
|
||||||
<include>w32api/include/ddk</include>
|
|
||||||
|
|
||||||
<directory name="apps">
|
|
||||||
<xi:include href="apps/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="boot">
|
|
||||||
<xi:include href="boot/boot.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="bootdata">
|
|
||||||
<xi:include href="bootdata/bootdata.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="drivers">
|
|
||||||
<xi:include href="drivers/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="hal">
|
|
||||||
<xi:include href="hal/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="include">
|
|
||||||
<xi:include href="include/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="lib">
|
|
||||||
<xi:include href="lib/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="media">
|
|
||||||
<xi:include href="media/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="modules">
|
|
||||||
<xi:include href="modules/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="ntoskrnl">
|
|
||||||
<xi:include href="ntoskrnl/ntoskrnl.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="regtests">
|
|
||||||
<xi:include href="regtests/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="services">
|
|
||||||
<xi:include href="services/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="subsys">
|
|
||||||
<xi:include href="subsys/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
</project>
|
|
@@ -1,86 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<!DOCTYPE project SYSTEM "tools/rbuild/project.dtd">
|
|
||||||
<project name="ReactOS" makefile="makefile.auto" xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
||||||
<xi:include href="config.xml">
|
|
||||||
<xi:fallback>
|
|
||||||
<xi:include href="config.template.xml" />
|
|
||||||
</xi:fallback>
|
|
||||||
</xi:include>
|
|
||||||
|
|
||||||
<xi:include href="baseaddress.xml" />
|
|
||||||
|
|
||||||
<define name="_M_IX86" />
|
|
||||||
<define name="_X86_" />
|
|
||||||
<define name="__i386__" />
|
|
||||||
<define name="_REACTOS_" />
|
|
||||||
<if property="MP" value="1">
|
|
||||||
<define name="CONFIG_SMP" value="1" />
|
|
||||||
</if>
|
|
||||||
<if property="DBG" value="1">
|
|
||||||
<define name="DBG" value="1" />
|
|
||||||
<property name="DBG_OR_KDBG" value="true" />
|
|
||||||
</if>
|
|
||||||
<if property="DBG" value="0">
|
|
||||||
<compilerflag>-Os</compilerflag>
|
|
||||||
<compilerflag>-Wno-strict-aliasing</compilerflag>
|
|
||||||
<compilerflag>-ftracer</compilerflag>
|
|
||||||
<compilerflag>-momit-leaf-frame-pointer</compilerflag>
|
|
||||||
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
|
|
||||||
</if>
|
|
||||||
<if property="KDBG" value="1">
|
|
||||||
<define name="KDBG" value="1" />
|
|
||||||
<property name="DBG_OR_KDBG" value="true" />
|
|
||||||
</if>
|
|
||||||
<compilerflag>-Wpointer-arith</compilerflag>
|
|
||||||
|
|
||||||
<include>.</include>
|
|
||||||
<include>include</include>
|
|
||||||
<include>include/reactos</include>
|
|
||||||
<include>include/libs</include>
|
|
||||||
<include>include/drivers</include>
|
|
||||||
<include>include/subsys</include>
|
|
||||||
<include>include/ndk</include>
|
|
||||||
<include>w32api/include</include>
|
|
||||||
<include>w32api/include/crt</include>
|
|
||||||
<include>w32api/include/ddk</include>
|
|
||||||
|
|
||||||
<directory name="apps">
|
|
||||||
<xi:include href="apps/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="boot">
|
|
||||||
<xi:include href="boot/boot.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="bootdata">
|
|
||||||
<xi:include href="bootdata/bootdata.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="drivers">
|
|
||||||
<xi:include href="drivers/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="hal">
|
|
||||||
<xi:include href="hal/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="include">
|
|
||||||
<xi:include href="include/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="lib">
|
|
||||||
<xi:include href="lib/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="media">
|
|
||||||
<xi:include href="media/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="modules">
|
|
||||||
<xi:include href="modules/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="ntoskrnl">
|
|
||||||
<xi:include href="ntoskrnl/ntoskrnl.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="regtests">
|
|
||||||
<xi:include href="regtests/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="services">
|
|
||||||
<xi:include href="services/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="subsys">
|
|
||||||
<xi:include href="subsys/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
</project>
|
|
@@ -11,11 +11,15 @@ iphlpapi.dll reactos/lib/iphlpapi
|
|||||||
kernel32.dll reactos/lib/kernel32
|
kernel32.dll reactos/lib/kernel32
|
||||||
lz32.dll reactos/lib/lzexpand
|
lz32.dll reactos/lib/lzexpand
|
||||||
msvcrt.dll reactos/lib/msvcrt
|
msvcrt.dll reactos/lib/msvcrt
|
||||||
|
ole32.dll reactos/lib/ole32
|
||||||
|
oleaut32.dll reactos/lib/oleaut32
|
||||||
rpcrt4.dll reactos/lib/rpcrt4
|
rpcrt4.dll reactos/lib/rpcrt4
|
||||||
secur32.dll reactos/lib/secur32
|
secur32.dll reactos/lib/secur32
|
||||||
|
shell32.dll reactos/lib/shell32
|
||||||
snmpapi.dll reactos/lib/snmpapi
|
snmpapi.dll reactos/lib/snmpapi
|
||||||
user32.dll reactos/lib/user32
|
user32.dll reactos/lib/user32
|
||||||
version.dll reactos/lib/version
|
version.dll reactos/lib/version
|
||||||
|
winmm.dll reactos/lib/winmm
|
||||||
winspool.dll reactos/lib/winspool
|
winspool.dll reactos/lib/winspool
|
||||||
ws2_32.dll reactos/lib/ws2_32
|
ws2_32.dll reactos/lib/ws2_32
|
||||||
wsock32.dll reactos/lib/wsock32
|
wsock32.dll reactos/lib/wsock32
|
||||||
|
13
reactos/apps/Makefile
Normal file
13
reactos/apps/Makefile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
# ReactOS apps and tools makefile to generate Doxygen documentation
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
docu:
|
||||||
|
doxygen Doxyfile
|
||||||
|
|
||||||
|
.PHONY: docu
|
||||||
|
|
||||||
|
|
||||||
|
# EOF
|
@@ -1,3 +0,0 @@
|
|||||||
<directory name="utils">
|
|
||||||
<xi:include href="utils/directory.xml" />
|
|
||||||
</directory>
|
|
162
reactos/apps/testsets/Makefile
Normal file
162
reactos/apps/testsets/Makefile
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
#
|
||||||
|
# ReactOS system testsets makefile
|
||||||
|
#
|
||||||
|
|
||||||
|
PATH_TO_TOP = ../..
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
|
||||||
|
# Testset applications
|
||||||
|
TEST_SETS = loadlib
|
||||||
|
|
||||||
|
TEST_KERNEL32 =
|
||||||
|
|
||||||
|
TEST_MSVCRT =
|
||||||
|
|
||||||
|
TEST_COM =
|
||||||
|
|
||||||
|
TEST_SEH =
|
||||||
|
|
||||||
|
TEST_REGRESSIONS =
|
||||||
|
|
||||||
|
all: $(TEST_SETS) $(TEST_KERNEL32) $(TEST_MSVCRT) $(TEST_COM) $(TEST_SEH) $(TEST_REGRESSIONS)
|
||||||
|
|
||||||
|
depends:
|
||||||
|
|
||||||
|
implib: $(TEST_SETS:%=%_implib) \
|
||||||
|
$(TEST_KERNEL32:%=%_implib) \
|
||||||
|
$(TEST_MSVCRT:%=%_implib) \
|
||||||
|
$(TEST_COM:%=%_implib) \
|
||||||
|
$(TEST_SEH:%=%_implib) \
|
||||||
|
$(TEST_REGRESSIONS:%=%_implib)
|
||||||
|
|
||||||
|
clean: $(TEST_SETS:%=%_clean) \
|
||||||
|
$(TEST_KERNEL32:%=%_clean) \
|
||||||
|
$(TEST_MSVCRT:%=%_clean) \
|
||||||
|
$(TEST_COM:%=%_clean) \
|
||||||
|
$(TEST_SEH:%=%_clean) \
|
||||||
|
$(TEST_REGRESSIONS:%=%_clean)
|
||||||
|
|
||||||
|
install: $(TEST_SETS:%=%_install) \
|
||||||
|
$(TEST_KERNEL32:%=%_install) \
|
||||||
|
$(TEST_MSVCRT:%=%_install) \
|
||||||
|
$(TEST_COM:%=%_install) \
|
||||||
|
$(TEST_SEH:%=%_install) \
|
||||||
|
$(TEST_REGRESSIONS:%=%_install)
|
||||||
|
|
||||||
|
.PHONY: all depends implib clean install
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Testset Applications
|
||||||
|
#
|
||||||
|
$(TEST_SETS): %:
|
||||||
|
$(MAKE) -C $*
|
||||||
|
|
||||||
|
$(TEST_SETS:%=%_implib): %_implib:
|
||||||
|
$(MAKE) -C $* implib
|
||||||
|
|
||||||
|
$(TEST_SETS:%=%_clean): %_clean:
|
||||||
|
$(MAKE) -C $* clean
|
||||||
|
|
||||||
|
$(TEST_SETS:%=%_install): %_install:
|
||||||
|
$(MAKE) -C $* install
|
||||||
|
|
||||||
|
.PHONY: $(TEST_SETS) $(TEST_SETS:%=%_implib) $(TEST_SETS:%=%_clean) $(TEST_SETS:%=%_install)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Kernel32 Test Applications
|
||||||
|
#
|
||||||
|
$(TEST_KERNEL32): %:
|
||||||
|
$(MAKE) -C kernel32/$*
|
||||||
|
|
||||||
|
$(TEST_KERNEL32:%=%_implib): %_implib:
|
||||||
|
$(MAKE) -C kernel32/$* implib
|
||||||
|
|
||||||
|
$(TEST_KERNEL32:%=%_clean): %_clean:
|
||||||
|
$(MAKE) -C kernel32/$* clean
|
||||||
|
|
||||||
|
$(TEST_KERNEL32:%=%_install): %_install:
|
||||||
|
$(MAKE) -C kernel32/$* install
|
||||||
|
|
||||||
|
.PHONY: $(TEST_KERNEL32) $(TEST_KERNEL32:%=%_implib) $(TEST_KERNEL32:%=%_clean) $(TEST_KERNEL32:%=%_install)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# msvcrt Test Applications
|
||||||
|
#
|
||||||
|
$(TEST_MSVCRT): %:
|
||||||
|
$(MAKE) -C msvcrt/$*
|
||||||
|
|
||||||
|
$(TEST_MSVCRT:%=%_implib): %_implib:
|
||||||
|
$(MAKE) -C msvcrt/$* implib
|
||||||
|
|
||||||
|
$(TEST_MSVCRT:%=%_clean): %_clean:
|
||||||
|
$(MAKE) -C msvcrt/$* clean
|
||||||
|
|
||||||
|
$(TEST_MSVCRT:%=%_install): %_install:
|
||||||
|
$(MAKE) -C msvcrt/$* install
|
||||||
|
|
||||||
|
.PHONY: $(TEST_MSVCRT) $(TEST_MSVCRT:%=%_implib) $(TEST_MSVCRT:%=%_clean) $(TEST_MSVCRT:%=%_install)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# COM Test Applications
|
||||||
|
#
|
||||||
|
$(TEST_COM): %:
|
||||||
|
$(MAKE) -C com/$*
|
||||||
|
|
||||||
|
$(TEST_COM:%=%_implib): %_implib:
|
||||||
|
$(MAKE) -C com/$* implib
|
||||||
|
|
||||||
|
$(TEST_COM:%=%_clean): %_clean:
|
||||||
|
$(MAKE) -C com/$* clean
|
||||||
|
|
||||||
|
$(TEST_COM:%=%_install): %_install:
|
||||||
|
$(MAKE) -C com/$* install
|
||||||
|
|
||||||
|
.PHONY: $(TEST_COM) $(TEST_COM:%=%_implib) $(TEST_COM:%=%_clean) $(TEST_COM:%=%_install)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# SEH Test Applications
|
||||||
|
#
|
||||||
|
$(TEST_SEH): %:
|
||||||
|
$(MAKE) -C seh/$*
|
||||||
|
|
||||||
|
$(TEST_SEH:%=%_implib): %_implib:
|
||||||
|
$(MAKE) -C seh/$* implib
|
||||||
|
|
||||||
|
$(TEST_SEH:%=%_clean): %_clean:
|
||||||
|
$(MAKE) -C seh/$* clean
|
||||||
|
|
||||||
|
$(TEST_SEH:%=%_install): %_install:
|
||||||
|
$(MAKE) -C seh/$* install
|
||||||
|
|
||||||
|
.PHONY: $(TEST_SEH) $(TEST_SEH:%=%_implib) $(TEST_SEH:%=%_clean) $(TEST_SEH:%=%_install)
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Regression Test Applications
|
||||||
|
#
|
||||||
|
$(TEST_REGRESSIONS): %:
|
||||||
|
$(MAKE) -C regres/$*
|
||||||
|
|
||||||
|
$(TEST_REGRESSIONS:%=%_implib): %_implib:
|
||||||
|
$(MAKE) -C regres/$* implib
|
||||||
|
|
||||||
|
$(TEST_REGRESSIONS:%=%_clean): %_clean:
|
||||||
|
$(MAKE) -C regres/$* clean
|
||||||
|
|
||||||
|
$(TEST_REGRESSIONS:%=%_install): %_install:
|
||||||
|
$(MAKE) -C regres/$* install
|
||||||
|
|
||||||
|
.PHONY: $(TEST_REGRESSIONS) $(TEST_REGRESSIONS:%=%_implib) $(TEST_REGRESSIONS:%=%_clean) $(TEST_REGRESSIONS:%=%_install)
|
||||||
|
|
||||||
|
|
||||||
|
etags:
|
||||||
|
find . -name "*.[ch]" -print | etags --language=c -
|
||||||
|
|
||||||
|
# EOF
|
24
reactos/apps/testsets/loadlib/makefile
Normal file
24
reactos/apps/testsets/loadlib/makefile
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#
|
||||||
|
# $Id: makefile,v 1.0
|
||||||
|
|
||||||
|
PATH_TO_TOP = ../../..
|
||||||
|
|
||||||
|
TARGET_NORC = yes
|
||||||
|
|
||||||
|
TARGET_TYPE = program
|
||||||
|
|
||||||
|
TARGET_APPTYPE = console
|
||||||
|
|
||||||
|
TARGET_NAME = loadlib
|
||||||
|
|
||||||
|
TARGET_CFLAGS = -Wall -Werror -D__USE_W32API -DUNICODE -D_UNICODE
|
||||||
|
|
||||||
|
TARGET_SDKLIBS = kernel32.a ntdll.a
|
||||||
|
|
||||||
|
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
include $(TOOLS_PATH)/helper.mk
|
||||||
|
|
||||||
|
# EOF
|
27
reactos/apps/testsets/msvcrt/fileio/makefile
Normal file
27
reactos/apps/testsets/msvcrt/fileio/makefile
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#
|
||||||
|
# $Id: makefile,v 1.0
|
||||||
|
|
||||||
|
PATH_TO_TOP = ../../../..
|
||||||
|
|
||||||
|
TEST_ROOT = $(PATH_TO_TOP)/apps/testsets/test
|
||||||
|
|
||||||
|
TARGET_NORC = yes
|
||||||
|
|
||||||
|
TARGET_TYPE = program
|
||||||
|
|
||||||
|
TARGET_APPTYPE = console
|
||||||
|
|
||||||
|
TARGET_NAME = fileio
|
||||||
|
|
||||||
|
#TARGET_CFLAGS = -I$(TEST_ROOT) -DDBG -DUNICODE -D_UNICODE
|
||||||
|
TARGET_CFLAGS = -I$(TEST_ROOT) -DDBG
|
||||||
|
|
||||||
|
TARGET_SDKLIBS = ntdll.a kernel32.a
|
||||||
|
|
||||||
|
TARGET_OBJECTS = $(TARGET_NAME).o wfileio.o main.o
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
include $(TOOLS_PATH)/helper.mk
|
||||||
|
|
||||||
|
# EOF
|
71
reactos/apps/utils/Makefile
Normal file
71
reactos/apps/utils/Makefile
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
#
|
||||||
|
# ReactOS system utilities makefile
|
||||||
|
#
|
||||||
|
|
||||||
|
PATH_TO_TOP = ../..
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
|
||||||
|
# Console system utilities
|
||||||
|
# cabman cat net objdir partinfo pice ps sc stats
|
||||||
|
UTIL_APPS = cat objdir pnpdump sc shutdown stats tickcount ps
|
||||||
|
|
||||||
|
UTIL_NET_APPS = arp finger ftp ipconfig netstat ping route telnet whois
|
||||||
|
|
||||||
|
|
||||||
|
all: $(UTIL_APPS) $(UTIL_NET_APPS)
|
||||||
|
|
||||||
|
depends:
|
||||||
|
|
||||||
|
implib: $(UTIL_APPS:%=%_implib) \
|
||||||
|
$(UTIL_NET_APPS:%=%_implib)
|
||||||
|
|
||||||
|
clean: $(UTIL_APPS:%=%_clean) \
|
||||||
|
$(UTIL_NET_APPS:%=%_clean)
|
||||||
|
|
||||||
|
install: $(UTIL_APPS:%=%_install) \
|
||||||
|
$(UTIL_NET_APPS:%=%_install)
|
||||||
|
|
||||||
|
.PHONY: all depends implib clean install
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Utility Applications
|
||||||
|
#
|
||||||
|
$(UTIL_APPS): %:
|
||||||
|
$(MAKE) -C $*
|
||||||
|
|
||||||
|
$(UTIL_APPS:%=%_implib): %_implib:
|
||||||
|
$(MAKE) -C $* implib
|
||||||
|
|
||||||
|
$(UTIL_APPS:%=%_clean): %_clean:
|
||||||
|
$(MAKE) -C $* clean
|
||||||
|
|
||||||
|
$(UTIL_APPS:%=%_install): %_install:
|
||||||
|
$(MAKE) -C $* install
|
||||||
|
|
||||||
|
.PHONY: $(UTIL_APPS) $(UTIL_APPS:%=%_implib) $(UTIL_APPS:%=%_clean) $(UTIL_APPS:%=%_install)
|
||||||
|
|
||||||
|
#
|
||||||
|
# GUI Utility Applications
|
||||||
|
#
|
||||||
|
$(UTIL_NET_APPS): %:
|
||||||
|
$(MAKE) -C net/$*
|
||||||
|
|
||||||
|
$(UTIL_NET_APPS:%=%_implib): %_implib:
|
||||||
|
$(MAKE) -C net/$* implib
|
||||||
|
|
||||||
|
$(UTIL_NET_APPS:%=%_clean): %_clean:
|
||||||
|
$(MAKE) -C net/$* clean
|
||||||
|
|
||||||
|
$(UTIL_NET_APPS:%=%_install): %_install:
|
||||||
|
$(MAKE) -C net/$* install
|
||||||
|
|
||||||
|
.PHONY: $(UTIL_NET_APPS) $(UTIL_NET_APPS:%=%_implib) $(UTIL_NET_APPS:%=%_clean) $(UTIL_NET_APPS:%=%_install)
|
||||||
|
|
||||||
|
|
||||||
|
etags:
|
||||||
|
find . -name "*.[ch]" -print | etags --language=c -
|
||||||
|
|
||||||
|
# EOF
|
21
reactos/apps/utils/binpatch/Makefile
Normal file
21
reactos/apps/utils/binpatch/Makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
PATH_TO_TOP = ../../..
|
||||||
|
|
||||||
|
TARGET_NORC = yes
|
||||||
|
|
||||||
|
TARGET_TYPE = program
|
||||||
|
|
||||||
|
TARGET_APPTYPE = console
|
||||||
|
|
||||||
|
TARGET_NAME = binpatch
|
||||||
|
|
||||||
|
TARGET_SDKLIBS =
|
||||||
|
|
||||||
|
TARGET_OBJECTS = patch.o
|
||||||
|
|
||||||
|
TARGET_CFLAGS += -Wall -Werror
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
include $(TOOLS_PATH)/helper.mk
|
||||||
|
|
||||||
|
# EOF
|
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ int main(int argc, char* argv[])
|
|||||||
int i;
|
int i;
|
||||||
FILE* in;
|
FILE* in;
|
||||||
char ch;
|
char ch;
|
||||||
|
|
||||||
for (i=1; i<argc; i++)
|
for (i=1; i<argc; i++)
|
||||||
{
|
{
|
||||||
in = fopen(argv[i],"r");
|
in = fopen(argv[i],"r");
|
||||||
@@ -15,7 +15,7 @@ int main(int argc, char* argv[])
|
|||||||
printf("Failed to open file %s\n", argv[i]);
|
printf("Failed to open file %s\n", argv[i]);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((ch = fgetc(in)) != EOF)
|
while ((ch = fgetc(in)) != EOF)
|
||||||
{
|
{
|
||||||
putchar(ch);
|
putchar(ch);
|
||||||
|
21
reactos/apps/utils/cat/makefile
Normal file
21
reactos/apps/utils/cat/makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# $Id$
|
||||||
|
|
||||||
|
PATH_TO_TOP = ../../..
|
||||||
|
|
||||||
|
TARGET_NORC = yes
|
||||||
|
|
||||||
|
TARGET_TYPE = program
|
||||||
|
|
||||||
|
TARGET_APPTYPE = console
|
||||||
|
|
||||||
|
TARGET_NAME = cat
|
||||||
|
|
||||||
|
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||||
|
|
||||||
|
TARGET_CFLAGS = -Wall -Werror
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
include $(TOOLS_PATH)/helper.mk
|
||||||
|
|
||||||
|
# EOF
|
@@ -1,17 +0,0 @@
|
|||||||
<group>
|
|
||||||
<directory name="net">
|
|
||||||
<xi:include href="net/directory.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="getfirefox">
|
|
||||||
<xi:include href="getfirefox/getfirefox.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="shutdown">
|
|
||||||
<xi:include href="shutdown/shutdown.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="ps">
|
|
||||||
<xi:include href="ps/ps.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="rosperf">
|
|
||||||
<xi:include href="rosperf/rosperf.xml" />
|
|
||||||
</directory>
|
|
||||||
</group>
|
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Load a device driver
|
* Load a device driver
|
||||||
*/
|
*/
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <ntos/zw.h>
|
#include <ntos/zw.h>
|
||||||
|
|
||||||
|
21
reactos/apps/utils/driver/load/makefile
Normal file
21
reactos/apps/utils/driver/load/makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
PATH_TO_TOP = ../../../..
|
||||||
|
|
||||||
|
TARGET_NORC = yes
|
||||||
|
|
||||||
|
TARGET_TYPE = program
|
||||||
|
|
||||||
|
TARGET_APPTYPE = console
|
||||||
|
|
||||||
|
TARGET_NAME = load
|
||||||
|
|
||||||
|
TARGET_CFLAGS = -DUNICODE -D_UNICODE
|
||||||
|
|
||||||
|
TARGET_SDKLIBS = ntdll.a
|
||||||
|
|
||||||
|
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
include $(TOOLS_PATH)/helper.mk
|
||||||
|
|
||||||
|
# EOF
|
21
reactos/apps/utils/driver/unload/makefile
Normal file
21
reactos/apps/utils/driver/unload/makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
PATH_TO_TOP = ../../../..
|
||||||
|
|
||||||
|
TARGET_NORC = yes
|
||||||
|
|
||||||
|
TARGET_TYPE = program
|
||||||
|
|
||||||
|
TARGET_APPTYPE = console
|
||||||
|
|
||||||
|
TARGET_NAME = unload
|
||||||
|
|
||||||
|
TARGET_CFLAGS = -DUNICODE -D_UNICODE
|
||||||
|
|
||||||
|
TARGET_SDKLIBS = ntdll.a
|
||||||
|
|
||||||
|
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
include $(TOOLS_PATH)/helper.mk
|
||||||
|
|
||||||
|
# EOF
|
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Unload a device driver
|
* Unload a device driver
|
||||||
*/
|
*/
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <ntos/zw.h>
|
#include <ntos/zw.h>
|
||||||
|
|
||||||
|
@@ -1,733 +0,0 @@
|
|||||||
/*
|
|
||||||
*
|
|
||||||
* dumprecbin - dumps a recycle bin database
|
|
||||||
*
|
|
||||||
* Copyright (c) 2005 by Thomas Weidenmueller <w3seek@reactos.com>
|
|
||||||
*
|
|
||||||
* 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 2 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*
|
|
||||||
* TODO: - Support for Vista recycle bins (read the DeleteInfo NTFS streams, also NT 5.x)
|
|
||||||
* - Support for INFO databases (win95)
|
|
||||||
*/
|
|
||||||
#include <windows.h>
|
|
||||||
#include <winternl.h>
|
|
||||||
#include <sddl.h>
|
|
||||||
#include <ntsecapi.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <tchar.h>
|
|
||||||
|
|
||||||
#ifndef NT_SUCCESS
|
|
||||||
#define NT_SUCCESS(status) ((LONG)(status) >= 0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct _RECYCLE_BIN
|
|
||||||
{
|
|
||||||
struct _RECYCLE_BIN *Next;
|
|
||||||
PSID Sid;
|
|
||||||
WCHAR User[255];
|
|
||||||
WCHAR Path[MAX_PATH + 1];
|
|
||||||
} RECYCLE_BIN, *PRECYCLE_BIN;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
ivUnknown = 0,
|
|
||||||
ivINFO2
|
|
||||||
} INFO_VERSION, *PINFO_VERSION;
|
|
||||||
|
|
||||||
typedef struct _INFO2_HEADER
|
|
||||||
{
|
|
||||||
DWORD Version;
|
|
||||||
DWORD Zero1;
|
|
||||||
DWORD Zero2;
|
|
||||||
DWORD RecordSize;
|
|
||||||
} INFO2_HEADER, *PINFO2_HEADER;
|
|
||||||
|
|
||||||
typedef struct _INFO2_RECORD
|
|
||||||
{
|
|
||||||
DWORD Unknown;
|
|
||||||
CHAR AnsiFileName[MAX_PATH];
|
|
||||||
DWORD RecordNumber;
|
|
||||||
DWORD DriveLetter;
|
|
||||||
FILETIME DeletionTime;
|
|
||||||
DWORD DeletedPhysicalSize;
|
|
||||||
WCHAR FileName[MAX_PATH - 2];
|
|
||||||
} INFO2_RECORD, *PINFO2_RECORD;
|
|
||||||
|
|
||||||
static HANDLE
|
|
||||||
OpenAndMapInfoDatabase(IN LPTSTR szFileName,
|
|
||||||
OUT PVOID *MappingBasePtr,
|
|
||||||
OUT PLARGE_INTEGER FileSize)
|
|
||||||
{
|
|
||||||
HANDLE hFile, hMapping = INVALID_HANDLE_VALUE;
|
|
||||||
|
|
||||||
hFile = CreateFile(szFileName,
|
|
||||||
FILE_READ_DATA,
|
|
||||||
FILE_SHARE_READ,
|
|
||||||
NULL,
|
|
||||||
OPEN_EXISTING,
|
|
||||||
FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM,
|
|
||||||
NULL);
|
|
||||||
if (hFile != INVALID_HANDLE_VALUE)
|
|
||||||
{
|
|
||||||
if (GetFileSizeEx(hFile,
|
|
||||||
FileSize) &&
|
|
||||||
FileSize->QuadPart >= 0xF)
|
|
||||||
{
|
|
||||||
hMapping = CreateFileMapping(hFile,
|
|
||||||
NULL,
|
|
||||||
PAGE_READONLY,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
NULL);
|
|
||||||
if (hMapping == NULL ||
|
|
||||||
!(*MappingBasePtr = MapViewOfFile(hMapping,
|
|
||||||
FILE_MAP_READ,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0)))
|
|
||||||
{
|
|
||||||
if (hMapping != NULL)
|
|
||||||
{
|
|
||||||
CloseHandle(hMapping);
|
|
||||||
}
|
|
||||||
hMapping = INVALID_HANDLE_VALUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
CloseHandle(hFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
return hMapping;
|
|
||||||
}
|
|
||||||
|
|
||||||
static VOID
|
|
||||||
UnmapAndCloseDatabase(IN HANDLE hMapping,
|
|
||||||
IN PVOID MappingBasePtr)
|
|
||||||
{
|
|
||||||
UnmapViewOfFile(MappingBasePtr);
|
|
||||||
CloseHandle(hMapping);
|
|
||||||
}
|
|
||||||
|
|
||||||
static INFO_VERSION
|
|
||||||
DetectDatabaseVersion(PVOID Header)
|
|
||||||
{
|
|
||||||
PINFO2_HEADER Info2 = (PINFO2_HEADER)Header;
|
|
||||||
INFO_VERSION Version = ivUnknown;
|
|
||||||
|
|
||||||
if (Info2->Version == 5 &&
|
|
||||||
Info2->Zero1 == 0 &&
|
|
||||||
Info2->Zero2 == 0 &&
|
|
||||||
Info2->RecordSize == 0x320)
|
|
||||||
{
|
|
||||||
Version = ivINFO2;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Version;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL
|
|
||||||
IsValidRecycleBin(IN LPTSTR szPath)
|
|
||||||
{
|
|
||||||
TCHAR szFile[MAX_PATH + 1];
|
|
||||||
TCHAR szClsId[48];
|
|
||||||
INFO_VERSION DbVersion = ivUnknown;
|
|
||||||
|
|
||||||
_stprintf(szFile,
|
|
||||||
_T("%s\\desktop.ini"),
|
|
||||||
szPath);
|
|
||||||
|
|
||||||
/* check if directory contains a valid desktop.ini for the recycle bin */
|
|
||||||
if (GetPrivateProfileString(TEXT(".ShellClassInfo"),
|
|
||||||
TEXT("CLSID"),
|
|
||||||
NULL,
|
|
||||||
szClsId,
|
|
||||||
sizeof(szClsId) / sizeof(szClsId[0]),
|
|
||||||
szFile) &&
|
|
||||||
!_tcsicmp(_T("{645FF040-5081-101B-9F08-00AA002F954E}"),
|
|
||||||
szClsId))
|
|
||||||
{
|
|
||||||
HANDLE hDb;
|
|
||||||
LARGE_INTEGER FileSize;
|
|
||||||
PVOID pDbBase = NULL;
|
|
||||||
|
|
||||||
/* open the database and check the signature */
|
|
||||||
_stprintf(szFile,
|
|
||||||
_T("%s\\INFO2"),
|
|
||||||
szPath);
|
|
||||||
hDb = OpenAndMapInfoDatabase(szFile,
|
|
||||||
&pDbBase,
|
|
||||||
&FileSize);
|
|
||||||
if (hDb != INVALID_HANDLE_VALUE)
|
|
||||||
{
|
|
||||||
DbVersion = DetectDatabaseVersion(pDbBase);
|
|
||||||
UnmapAndCloseDatabase(hDb,
|
|
||||||
pDbBase);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return DbVersion != ivUnknown;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL
|
|
||||||
OpenLocalLSAPolicyHandle(IN ACCESS_MASK DesiredAccess,
|
|
||||||
OUT PLSA_HANDLE PolicyHandle)
|
|
||||||
{
|
|
||||||
LSA_OBJECT_ATTRIBUTES LsaObjectAttributes = {0};
|
|
||||||
NTSTATUS Status;
|
|
||||||
|
|
||||||
Status = LsaOpenPolicy(NULL,
|
|
||||||
&LsaObjectAttributes,
|
|
||||||
DesiredAccess,
|
|
||||||
PolicyHandle);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
SetLastError(LsaNtStatusToWinError(Status));
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL
|
|
||||||
ConvertSIDToAccountName(IN PSID Sid,
|
|
||||||
OUT LPWSTR User)
|
|
||||||
{
|
|
||||||
DWORD AccountNameLen = 0;
|
|
||||||
DWORD DomainNameLen = 0;
|
|
||||||
SID_NAME_USE NameUse;
|
|
||||||
DWORD Error = ERROR_SUCCESS;
|
|
||||||
LPWSTR AccountName, DomainName;
|
|
||||||
BOOL Ret = FALSE;
|
|
||||||
|
|
||||||
if (!LookupAccountSidW(NULL,
|
|
||||||
Sid,
|
|
||||||
NULL,
|
|
||||||
&AccountNameLen,
|
|
||||||
NULL,
|
|
||||||
&DomainNameLen,
|
|
||||||
&NameUse))
|
|
||||||
{
|
|
||||||
Error = GetLastError();
|
|
||||||
if (Error == ERROR_NONE_MAPPED ||
|
|
||||||
Error != ERROR_INSUFFICIENT_BUFFER)
|
|
||||||
{
|
|
||||||
/* some unexpected error occured! */
|
|
||||||
goto ConvertSID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AccountName = (LPWSTR)HeapAlloc(GetProcessHeap(),
|
|
||||||
0,
|
|
||||||
(AccountNameLen + DomainNameLen) * sizeof(WCHAR));
|
|
||||||
if (AccountName != NULL)
|
|
||||||
{
|
|
||||||
LSA_HANDLE PolicyHandle;
|
|
||||||
DomainName = AccountName + AccountNameLen;
|
|
||||||
|
|
||||||
if (!LookupAccountSidW(NULL,
|
|
||||||
Sid,
|
|
||||||
AccountName,
|
|
||||||
&AccountNameLen,
|
|
||||||
DomainName,
|
|
||||||
&DomainNameLen,
|
|
||||||
&NameUse))
|
|
||||||
{
|
|
||||||
goto BailFreeAccountName;
|
|
||||||
}
|
|
||||||
|
|
||||||
wcscpy(User,
|
|
||||||
AccountName);
|
|
||||||
Ret = TRUE;
|
|
||||||
|
|
||||||
if (OpenLocalLSAPolicyHandle(POLICY_LOOKUP_NAMES | POLICY_VIEW_LOCAL_INFORMATION,
|
|
||||||
&PolicyHandle))
|
|
||||||
{
|
|
||||||
PLSA_REFERENCED_DOMAIN_LIST ReferencedDomain;
|
|
||||||
PLSA_TRANSLATED_NAME Names;
|
|
||||||
PLSA_TRUST_INFORMATION Domain;
|
|
||||||
PLSA_UNICODE_STRING DomainName;
|
|
||||||
PPOLICY_ACCOUNT_DOMAIN_INFO PolicyAccountDomainInfo = NULL;
|
|
||||||
NTSTATUS Status;
|
|
||||||
|
|
||||||
Status = LsaLookupSids(PolicyHandle,
|
|
||||||
1,
|
|
||||||
&Sid,
|
|
||||||
&ReferencedDomain,
|
|
||||||
&Names);
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
if (ReferencedDomain != NULL &&
|
|
||||||
Names->DomainIndex >= 0)
|
|
||||||
{
|
|
||||||
Domain = &ReferencedDomain->Domains[Names->DomainIndex];
|
|
||||||
DomainName = &Domain->Name;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Domain = NULL;
|
|
||||||
DomainName = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (Names->Use)
|
|
||||||
{
|
|
||||||
case SidTypeAlias:
|
|
||||||
if (Domain != NULL)
|
|
||||||
{
|
|
||||||
/* query the domain name for BUILTIN accounts */
|
|
||||||
Status = LsaQueryInformationPolicy(PolicyHandle,
|
|
||||||
PolicyAccountDomainInformation,
|
|
||||||
(PVOID*)&PolicyAccountDomainInfo);
|
|
||||||
if (NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
DomainName = &PolicyAccountDomainInfo->DomainName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* fall through */
|
|
||||||
|
|
||||||
case SidTypeUser:
|
|
||||||
{
|
|
||||||
if (Domain != NULL)
|
|
||||||
{
|
|
||||||
WCHAR *s;
|
|
||||||
|
|
||||||
/* NOTE: LSA_UNICODE_STRINGs are not always NULL-terminated! */
|
|
||||||
|
|
||||||
wcscpy(User,
|
|
||||||
AccountName);
|
|
||||||
wcscat(User,
|
|
||||||
L" (");
|
|
||||||
s = User + wcslen(User);
|
|
||||||
CopyMemory(s,
|
|
||||||
DomainName->Buffer,
|
|
||||||
DomainName->Length);
|
|
||||||
s += DomainName->Length / sizeof(WCHAR);
|
|
||||||
*(s++) = L'\\';
|
|
||||||
CopyMemory(s,
|
|
||||||
Names->Name.Buffer,
|
|
||||||
Names->Name.Length);
|
|
||||||
s += Names->Name.Length / sizeof(WCHAR);
|
|
||||||
*(s++) = L')';
|
|
||||||
*s = L'\0';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case SidTypeWellKnownGroup:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
_ftprintf(stderr,
|
|
||||||
_T("Unhandled SID type: 0x%x\n"),
|
|
||||||
Names->Use);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PolicyAccountDomainInfo != NULL)
|
|
||||||
{
|
|
||||||
LsaFreeMemory(PolicyAccountDomainInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
LsaFreeMemory(ReferencedDomain);
|
|
||||||
LsaFreeMemory(Names);
|
|
||||||
}
|
|
||||||
|
|
||||||
LsaClose(PolicyHandle);
|
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
Ret = FALSE;
|
|
||||||
goto BailFreeAccountName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
BailFreeAccountName:
|
|
||||||
HeapFree(GetProcessHeap(),
|
|
||||||
0,
|
|
||||||
AccountName);
|
|
||||||
goto ConvertSID;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ConvertSID:
|
|
||||||
if (!Ret)
|
|
||||||
{
|
|
||||||
LPWSTR StrSid;
|
|
||||||
Ret = ConvertSidToStringSidW(Sid,
|
|
||||||
&StrSid);
|
|
||||||
if (Ret)
|
|
||||||
{
|
|
||||||
wcscpy(User,
|
|
||||||
StrSid);
|
|
||||||
LocalFree((HLOCAL)StrSid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static VOID
|
|
||||||
FreeRecycleBinsList(IN OUT PRECYCLE_BIN *RecycleBinsListHead)
|
|
||||||
{
|
|
||||||
PRECYCLE_BIN CurrentBin, NextBin;
|
|
||||||
|
|
||||||
CurrentBin = *RecycleBinsListHead;
|
|
||||||
while (CurrentBin != NULL)
|
|
||||||
{
|
|
||||||
NextBin = CurrentBin->Next;
|
|
||||||
LocalFree((HLOCAL)CurrentBin->Sid);
|
|
||||||
HeapFree(GetProcessHeap(),
|
|
||||||
0,
|
|
||||||
CurrentBin);
|
|
||||||
CurrentBin = NextBin;
|
|
||||||
}
|
|
||||||
|
|
||||||
*RecycleBinsListHead = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL
|
|
||||||
LocateRecycleBins(IN LPWSTR szDrive,
|
|
||||||
OUT PRECYCLE_BIN *RecycleBinsListHead)
|
|
||||||
{
|
|
||||||
TCHAR szRecBinPath[MAX_PATH + 1];
|
|
||||||
HANDLE FindResult;
|
|
||||||
WIN32_FIND_DATA FindData;
|
|
||||||
PRECYCLE_BIN NewBin;
|
|
||||||
BOOL Ret = FALSE;
|
|
||||||
|
|
||||||
FreeRecycleBinsList(RecycleBinsListHead);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* search for recycle bins on volumes that support file security (NTFS)
|
|
||||||
*/
|
|
||||||
_stprintf(szRecBinPath,
|
|
||||||
_T("%lS\\RECYCLER\\*"),
|
|
||||||
szDrive);
|
|
||||||
FindResult = FindFirstFile(szRecBinPath,
|
|
||||||
&FindData);
|
|
||||||
if (FindResult != INVALID_HANDLE_VALUE)
|
|
||||||
{
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (FindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY &&
|
|
||||||
_tcscmp(FindData.cFileName,
|
|
||||||
_T("..")) &&
|
|
||||||
_tcscmp(FindData.cFileName,
|
|
||||||
_T(".")))
|
|
||||||
{
|
|
||||||
PSID Sid;
|
|
||||||
|
|
||||||
if (ConvertStringSidToSid(FindData.cFileName,
|
|
||||||
&Sid))
|
|
||||||
{
|
|
||||||
_stprintf(szRecBinPath,
|
|
||||||
_T("%s\\RECYCLER\\%s"),
|
|
||||||
szDrive,
|
|
||||||
FindData.cFileName);
|
|
||||||
if (IsValidRecycleBin(szRecBinPath))
|
|
||||||
{
|
|
||||||
NewBin = (PRECYCLE_BIN)HeapAlloc(GetProcessHeap(),
|
|
||||||
HEAP_ZERO_MEMORY,
|
|
||||||
sizeof(RECYCLE_BIN));
|
|
||||||
if (NewBin != NULL)
|
|
||||||
{
|
|
||||||
_tcscpy(NewBin->Path,
|
|
||||||
szRecBinPath);
|
|
||||||
|
|
||||||
/* convert the SID to an account name */
|
|
||||||
ConvertSIDToAccountName(Sid,
|
|
||||||
NewBin->User);
|
|
||||||
|
|
||||||
/* append the recycle bin */
|
|
||||||
*RecycleBinsListHead = NewBin;
|
|
||||||
RecycleBinsListHead = &NewBin->Next;
|
|
||||||
|
|
||||||
Ret = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
goto ContinueFreeSid;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ContinueFreeSid:
|
|
||||||
LocalFree((HLOCAL)Sid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while (FindNextFile(FindResult,
|
|
||||||
&FindData));
|
|
||||||
|
|
||||||
FindClose(FindResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* search for recycle bins on volumes that don't support file security (FAT)
|
|
||||||
*/
|
|
||||||
_stprintf(szRecBinPath,
|
|
||||||
_T("%s\\Recycled"),
|
|
||||||
szDrive);
|
|
||||||
FindResult = FindFirstFile(szRecBinPath,
|
|
||||||
&FindData);
|
|
||||||
if (FindResult != INVALID_HANDLE_VALUE)
|
|
||||||
{
|
|
||||||
if (IsValidRecycleBin(szRecBinPath))
|
|
||||||
{
|
|
||||||
SID_IDENTIFIER_AUTHORITY WorldSia = {SECURITY_WORLD_SID_AUTHORITY};
|
|
||||||
PSID EveryoneSid;
|
|
||||||
|
|
||||||
/* create an Everyone SID */
|
|
||||||
if (AllocateAndInitializeSid(&WorldSia,
|
|
||||||
1,
|
|
||||||
SECURITY_WORLD_RID,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
&EveryoneSid))
|
|
||||||
{
|
|
||||||
NewBin = (PRECYCLE_BIN)HeapAlloc(GetProcessHeap(),
|
|
||||||
HEAP_ZERO_MEMORY,
|
|
||||||
sizeof(RECYCLE_BIN));
|
|
||||||
if (NewBin != NULL)
|
|
||||||
{
|
|
||||||
_tcscpy(NewBin->Path,
|
|
||||||
szRecBinPath);
|
|
||||||
|
|
||||||
/* convert the SID to an account name */
|
|
||||||
ConvertSIDToAccountName(EveryoneSid,
|
|
||||||
NewBin->User);
|
|
||||||
|
|
||||||
/* append the recycle bin */
|
|
||||||
*RecycleBinsListHead = NewBin;
|
|
||||||
RecycleBinsListHead = &NewBin->Next;
|
|
||||||
|
|
||||||
Ret = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
FreeSid(EveryoneSid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
FindClose(FindResult);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static VOID
|
|
||||||
DiskFileNameFromRecord(OUT LPTSTR szShortFileName,
|
|
||||||
IN DWORD RecordNumber,
|
|
||||||
IN WCHAR cDriveLetter,
|
|
||||||
IN LPWSTR szFileName)
|
|
||||||
{
|
|
||||||
LPWSTR FileExt;
|
|
||||||
|
|
||||||
FileExt = wcsrchr(szFileName,
|
|
||||||
L'.');
|
|
||||||
if (FileExt != NULL)
|
|
||||||
{
|
|
||||||
_stprintf(szShortFileName,
|
|
||||||
_T("D%lC%d%lS"),
|
|
||||||
cDriveLetter,
|
|
||||||
RecordNumber,
|
|
||||||
FileExt);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_stprintf(szShortFileName,
|
|
||||||
_T("D%lC%d"),
|
|
||||||
cDriveLetter,
|
|
||||||
RecordNumber);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL
|
|
||||||
DumpRecycleBin(IN PRECYCLE_BIN RecycleBin)
|
|
||||||
{
|
|
||||||
WCHAR szFile[MAX_PATH + 1];
|
|
||||||
HANDLE hDb;
|
|
||||||
LARGE_INTEGER FileSize;
|
|
||||||
PVOID pDbBase = NULL;
|
|
||||||
INFO_VERSION Version = ivUnknown;
|
|
||||||
|
|
||||||
_tprintf(_T("Dumping recycle bin of \"%lS\":\n"),
|
|
||||||
RecycleBin->User);
|
|
||||||
_tprintf(_T("Directory: %lS\n\n"),
|
|
||||||
RecycleBin->Path);
|
|
||||||
|
|
||||||
_stprintf(szFile,
|
|
||||||
_T("%s\\INFO2"),
|
|
||||||
RecycleBin->Path);
|
|
||||||
hDb = OpenAndMapInfoDatabase(szFile,
|
|
||||||
&pDbBase,
|
|
||||||
&FileSize);
|
|
||||||
if (hDb != INVALID_HANDLE_VALUE)
|
|
||||||
{
|
|
||||||
Version = DetectDatabaseVersion(pDbBase);
|
|
||||||
|
|
||||||
/* dump the INFO2 database */
|
|
||||||
switch (Version)
|
|
||||||
{
|
|
||||||
case ivINFO2:
|
|
||||||
{
|
|
||||||
DWORD nRecords;
|
|
||||||
PINFO2_HEADER Info2Header = (PINFO2_HEADER)pDbBase;
|
|
||||||
PINFO2_RECORD Info2 = (PINFO2_RECORD)(Info2Header + 1);
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
nRecords = (FileSize.QuadPart - sizeof(INFO2_HEADER)) / Info2Header->RecordSize;
|
|
||||||
|
|
||||||
while (nRecords != 0)
|
|
||||||
{
|
|
||||||
/* if the first character of the AnsiFileName is zero, the record
|
|
||||||
is considered deleted */
|
|
||||||
if (Info2->AnsiFileName[0] != '\0')
|
|
||||||
{
|
|
||||||
_tprintf(_T(" [%d] Record: #%d \"%lS\"\n"),
|
|
||||||
++i,
|
|
||||||
Info2->RecordNumber,
|
|
||||||
Info2->FileName);
|
|
||||||
|
|
||||||
DiskFileNameFromRecord(szFile,
|
|
||||||
Info2->RecordNumber,
|
|
||||||
(WCHAR)Info2->DriveLetter + L'a',
|
|
||||||
Info2->FileName);
|
|
||||||
_tprintf(_T(" Name on disk: \"%s\"\n"),
|
|
||||||
szFile);
|
|
||||||
_tprintf(_T(" Deleted size on disk: %d KB\n"),
|
|
||||||
Info2->DeletedPhysicalSize / 1024);
|
|
||||||
}
|
|
||||||
nRecords--;
|
|
||||||
Info2++;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
UnmapAndCloseDatabase(hDb,
|
|
||||||
pDbBase);
|
|
||||||
}
|
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL
|
|
||||||
SelectRecycleBin(IN LPWSTR szDrive)
|
|
||||||
{
|
|
||||||
BOOL Ret;
|
|
||||||
PRECYCLE_BIN RecycleBinsList = NULL;
|
|
||||||
|
|
||||||
Ret = LocateRecycleBins(szDrive,
|
|
||||||
&RecycleBinsList);
|
|
||||||
if (Ret)
|
|
||||||
{
|
|
||||||
if (RecycleBinsList->Next != NULL)
|
|
||||||
{
|
|
||||||
PRECYCLE_BIN CurrentBin = RecycleBinsList;
|
|
||||||
int n = 0, i = 0;
|
|
||||||
|
|
||||||
/* if there are multiple recycle bins ask the user which one to dump */
|
|
||||||
_tprintf(_T("There are several recycle bins on this drive. Select one:\n"));
|
|
||||||
|
|
||||||
while (CurrentBin != NULL)
|
|
||||||
{
|
|
||||||
_tprintf(_T(" [%d] %lS\n"),
|
|
||||||
++i,
|
|
||||||
CurrentBin->User);
|
|
||||||
CurrentBin = CurrentBin->Next;
|
|
||||||
n++;
|
|
||||||
}
|
|
||||||
|
|
||||||
_tprintf(_T("Enter the number: "));
|
|
||||||
DisplayPrompt:
|
|
||||||
_tscanf(_T("%d"),
|
|
||||||
&i);
|
|
||||||
if (i > n || i < 1)
|
|
||||||
{
|
|
||||||
_tprintf(_T("Please enter a number between 1 and %d: "),
|
|
||||||
n);
|
|
||||||
goto DisplayPrompt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* walk to the selected recycle bin */
|
|
||||||
CurrentBin = RecycleBinsList;
|
|
||||||
while (CurrentBin != NULL && i != 1)
|
|
||||||
{
|
|
||||||
CurrentBin = CurrentBin->Next;
|
|
||||||
i--;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* dump it */
|
|
||||||
Ret = DumpRecycleBin(CurrentBin);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* dump the first (and only) recycle bin */
|
|
||||||
Ret = DumpRecycleBin(RecycleBinsList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_ftprintf(stderr,
|
|
||||||
_T("No recycle bins on this volume!\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
FreeRecycleBinsList(&RecycleBinsList);
|
|
||||||
|
|
||||||
return Ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static VOID
|
|
||||||
PrintHelp(VOID)
|
|
||||||
{
|
|
||||||
_ftprintf(stderr,
|
|
||||||
_T("Usage: dumprecbin C:\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
main(int argc,
|
|
||||||
char *argv[])
|
|
||||||
{
|
|
||||||
if (argc != 2 ||
|
|
||||||
strlen(argv[1]) != 2 || argv[1][1] != ':' ||
|
|
||||||
toupper(argv[1][0]) < 'A' || toupper(argv[1][0]) > 'Z')
|
|
||||||
{
|
|
||||||
PrintHelp();
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
WCHAR szDrive[3];
|
|
||||||
_stprintf(szDrive,
|
|
||||||
_T("%lC:"),
|
|
||||||
argv[1][0]);
|
|
||||||
|
|
||||||
if (!SelectRecycleBin(szDrive))
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@@ -1,13 +0,0 @@
|
|||||||
<module name="dumprecbin" type="win32cui" installbase="bin" installname="dumprecbin.exe">
|
|
||||||
<include base="dumprecbin">.</include>
|
|
||||||
<define name="__USE_W32API" />
|
|
||||||
<define name="UNICODE" />
|
|
||||||
<define name="_UNICODE" />
|
|
||||||
<define name="_WIN32_IE">0x0500</define>
|
|
||||||
<define name="_WIN32_WINNT">0x0600</define>
|
|
||||||
<define name="WINVER">0x0600</define>
|
|
||||||
<library>advapi32</library>
|
|
||||||
<library>kernel32</library>
|
|
||||||
<library>ntdll</library>
|
|
||||||
<file>dumprecbin.c</file>
|
|
||||||
</module>
|
|
@@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* PROJECT: ReactOS utilities
|
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
|
||||||
* FILE: apps/utils/getfirefox/En.rc
|
|
||||||
* PURPOSE: English resources
|
|
||||||
* COPYRIGHT: Copyright 2004 Mike McCormack for CodeWeavers
|
|
||||||
* Copyright 2005 Ge van Geldorp (gvg@reactos.org)
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Based on Wine dlls/shdocvw/En.rc
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT
|
|
||||||
|
|
||||||
IDD_GETFIREFOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
|
||||||
STYLE DS_MODALFRAME | DS_CENTER | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
|
||||||
CAPTION "Lade Firefox herunter"
|
|
||||||
FONT 8, "MS Shell Dlg"
|
|
||||||
{
|
|
||||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
|
||||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
|
||||||
CHECKBOX "Entferne ""Get Firefox"" nach Fertigstellung aus dem Startmen<65>", IDC_REMOVE,
|
|
||||||
10, 44, 200, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
|
|
||||||
PUSHBUTTON "Cancel", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
|
||||||
}
|
|
||||||
|
|
||||||
STRINGTABLE
|
|
||||||
BEGIN
|
|
||||||
IDS_START_MENU_NAME "Get Firefox"
|
|
||||||
END
|
|
@@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* PROJECT: ReactOS utilities
|
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
|
||||||
* FILE: apps/utils/getfirefox/En.rc
|
|
||||||
* PURPOSE: English resources
|
|
||||||
* COPYRIGHT: Copyright 2004 Mike McCormack for CodeWeavers
|
|
||||||
* Copyright 2005 Ge van Geldorp (gvg@reactos.org)
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Based on Wine dlls/shdocvw/En.rc
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
|
||||||
|
|
||||||
IDD_GETFIREFOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
|
||||||
STYLE DS_MODALFRAME | DS_CENTER | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
|
||||||
CAPTION "Downloading Firefox"
|
|
||||||
FONT 8, "MS Shell Dlg"
|
|
||||||
{
|
|
||||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
|
||||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
|
||||||
CHECKBOX "Remove ""Get Firefox"" from Start Menu when done", IDC_REMOVE,
|
|
||||||
10, 44, 200, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
|
|
||||||
PUSHBUTTON "Cancel", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
|
||||||
}
|
|
||||||
|
|
||||||
STRINGTABLE
|
|
||||||
BEGIN
|
|
||||||
IDS_START_MENU_NAME "Get Firefox"
|
|
||||||
END
|
|
@@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* PROJECT: ReactOS utilities
|
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
|
||||||
* FILE: apps/utils/getfirefox/En.rc
|
|
||||||
* PURPOSE: French resources
|
|
||||||
* COPYRIGHT: Copyright 2004 Mike McCormack for CodeWeavers
|
|
||||||
* Copyright 2005 Ge van Geldorp (gvg@reactos.org)
|
|
||||||
* Copyright 2005 G. Maton (mustang9@gmail.com) - French translation
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Based on Wine dlls/shdocvw/En.rc
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
|
|
||||||
|
|
||||||
IDD_GETFIREFOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
|
||||||
STYLE DS_MODALFRAME | DS_CENTER | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
|
||||||
CAPTION "T<>l<EFBFBD>chargement de Firefox"
|
|
||||||
FONT 8, "MS Shell Dlg"
|
|
||||||
{
|
|
||||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
|
||||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
|
||||||
CHECKBOX "Supprimer ""Obtenir Firefox"" du Menu d<>marrer une fois termin<69>", IDC_REMOVE,
|
|
||||||
10, 44, 200, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
|
|
||||||
PUSHBUTTON "Annuler", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
|
||||||
}
|
|
||||||
|
|
||||||
STRINGTABLE
|
|
||||||
BEGIN
|
|
||||||
IDS_START_MENU_NAME "Obtenir Firefox"
|
|
||||||
END
|
|
@@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* PROJECT: ReactOS utilities
|
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
|
||||||
* FILE: apps/utils/getfirefox/En.rc
|
|
||||||
* PURPOSE: English resources
|
|
||||||
* COPYRIGHT: Copyright 2004 Mike McCormack for CodeWeavers
|
|
||||||
* Copyright 2005 Ge van Geldorp (gvg@reactos.org)
|
|
||||||
* Copyright 2005 Robert Horvath (talley@cubeclub.hu) - Hungarian translation
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Based on Wine dlls/shdocvw/En.rc
|
|
||||||
*
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
|
|
||||||
LANGUAGE LANG_HUNGARIAN, SUBLANG_NEUTRAL
|
|
||||||
|
|
||||||
IDD_GETFIREFOX DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 76
|
|
||||||
STYLE DS_MODALFRAME | DS_CENTER | WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
|
||||||
CAPTION "A Firefox let<65>lt<6C>se"
|
|
||||||
FONT 8, "MS Shell Dlg"
|
|
||||||
{
|
|
||||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
|
||||||
LTEXT "", IDC_STATUS, 10, 30, 200, 10, SS_CENTER
|
|
||||||
CHECKBOX "A ""Szerezd meg a Firefoxot"" elv<6C>tol<6F>t<EFBFBD>sa a Start Men<65>b<EFBFBD>l befejez<65>s ut<75>n", IDC_REMOVE,
|
|
||||||
10, 44, 200, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP
|
|
||||||
PUSHBUTTON "M<>gse", IDCANCEL, 85, 58, 50, 15, WS_GROUP | WS_TABSTOP
|
|
||||||
}
|
|
||||||
|
|
||||||
STRINGTABLE
|
|
||||||
BEGIN
|
|
||||||
IDS_START_MENU_NAME "Szerezd meg Firefoxot"
|
|
||||||
END
|
|
Binary file not shown.
Before Width: | Height: | Size: 22 KiB |
@@ -1,383 +0,0 @@
|
|||||||
/*
|
|
||||||
* PROJECT: ReactOS utilities
|
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
|
||||||
* FILE: apps/utils/getfirefox/getfirefox.c
|
|
||||||
* PURPOSE: Main program
|
|
||||||
* COPYRIGHT: Copyright 2001 John R. Sheets (for CodeWeavers)
|
|
||||||
* Copyright 2004 Mike McCormack (for CodeWeavers)
|
|
||||||
* Copyright 2005 Ge van Geldorp (gvg@reactos.org)
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Based on Wine dlls/shdocvw/shdocvw_main.c
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include <precomp.h>
|
|
||||||
|
|
||||||
#define NDEBUG
|
|
||||||
#include <debug.h>
|
|
||||||
|
|
||||||
#define DOWNLOAD_URL L"http://links.reactos.org/getfirefox"
|
|
||||||
|
|
||||||
typedef struct _IBindStatusCallbackImpl
|
|
||||||
{
|
|
||||||
const IBindStatusCallbackVtbl *vtbl;
|
|
||||||
LONG ref;
|
|
||||||
HWND hDialog;
|
|
||||||
BOOL *pbCancelled;
|
|
||||||
} IBindStatusCallbackImpl;
|
|
||||||
|
|
||||||
static HRESULT WINAPI
|
|
||||||
dlQueryInterface(IBindStatusCallback* This, REFIID riid, void** ppvObject)
|
|
||||||
{
|
|
||||||
if (NULL == ppvObject)
|
|
||||||
{
|
|
||||||
return E_POINTER;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsEqualIID(riid, &IID_IUnknown) ||
|
|
||||||
IsEqualIID(riid, &IID_IBindStatusCallback))
|
|
||||||
{
|
|
||||||
IBindStatusCallback_AddRef( This );
|
|
||||||
*ppvObject = This;
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
return E_NOINTERFACE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ULONG WINAPI
|
|
||||||
dlAddRef(IBindStatusCallback* iface)
|
|
||||||
{
|
|
||||||
IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface;
|
|
||||||
|
|
||||||
return InterlockedIncrement(&This->ref);
|
|
||||||
}
|
|
||||||
|
|
||||||
static ULONG WINAPI
|
|
||||||
dlRelease(IBindStatusCallback* iface)
|
|
||||||
{
|
|
||||||
IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface;
|
|
||||||
DWORD ref = InterlockedDecrement(&This->ref);
|
|
||||||
|
|
||||||
if( !ref )
|
|
||||||
{
|
|
||||||
DestroyWindow( This->hDialog );
|
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ref;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI
|
|
||||||
dlOnStartBinding(IBindStatusCallback* iface, DWORD dwReserved, IBinding* pib)
|
|
||||||
{
|
|
||||||
DPRINT1("OnStartBinding not implemented\n");
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI
|
|
||||||
dlGetPriority(IBindStatusCallback* iface, LONG* pnPriority)
|
|
||||||
{
|
|
||||||
DPRINT1("GetPriority not implemented\n");
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI
|
|
||||||
dlOnLowResource( IBindStatusCallback* iface, DWORD reserved)
|
|
||||||
{
|
|
||||||
DPRINT1("OnLowResource not implemented\n");
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI
|
|
||||||
dlOnProgress(IBindStatusCallback* iface, ULONG ulProgress,
|
|
||||||
ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
|
|
||||||
{
|
|
||||||
IBindStatusCallbackImpl *This = (IBindStatusCallbackImpl *) iface;
|
|
||||||
HWND Item;
|
|
||||||
LONG r;
|
|
||||||
WCHAR OldText[100];
|
|
||||||
|
|
||||||
Item = GetDlgItem(This->hDialog, IDC_PROGRESS);
|
|
||||||
if (NULL != Item && 0 != ulProgressMax)
|
|
||||||
{
|
|
||||||
SendMessageW(Item, PBM_SETPOS, (ulProgress * 100) / ulProgressMax, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
Item = GetDlgItem(This->hDialog, IDC_STATUS);
|
|
||||||
if (NULL != Item)
|
|
||||||
{
|
|
||||||
SendMessageW(Item, WM_GETTEXT, sizeof(OldText) / sizeof(OldText[0]),
|
|
||||||
(LPARAM) OldText);
|
|
||||||
if (sizeof(OldText) / sizeof(OldText[0]) - 1 <= wcslen(OldText) ||
|
|
||||||
0 != wcscmp(OldText, szStatusText))
|
|
||||||
{
|
|
||||||
SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) szStatusText);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SetLastError(0);
|
|
||||||
r = GetWindowLongPtrW(This->hDialog, GWLP_USERDATA);
|
|
||||||
if (0 != r || 0 != GetLastError())
|
|
||||||
{
|
|
||||||
*This->pbCancelled = TRUE;
|
|
||||||
DPRINT("Cancelled\n");
|
|
||||||
return E_ABORT;
|
|
||||||
}
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI
|
|
||||||
dlOnStopBinding(IBindStatusCallback* iface, HRESULT hresult, LPCWSTR szError)
|
|
||||||
{
|
|
||||||
DPRINT1("OnStopBinding not implemented\n");
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI
|
|
||||||
dlGetBindInfo(IBindStatusCallback* iface, DWORD* grfBINDF, BINDINFO* pbindinfo)
|
|
||||||
{
|
|
||||||
DPRINT1("GetBindInfo not implemented\n");
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI
|
|
||||||
dlOnDataAvailable(IBindStatusCallback* iface, DWORD grfBSCF,
|
|
||||||
DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed)
|
|
||||||
{
|
|
||||||
DPRINT1("OnDataAvailable implemented\n");
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI
|
|
||||||
dlOnObjectAvailable(IBindStatusCallback* iface, REFIID riid, IUnknown* punk)
|
|
||||||
{
|
|
||||||
DPRINT1("OnObjectAvailable implemented\n");
|
|
||||||
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static const IBindStatusCallbackVtbl dlVtbl =
|
|
||||||
{
|
|
||||||
dlQueryInterface,
|
|
||||||
dlAddRef,
|
|
||||||
dlRelease,
|
|
||||||
dlOnStartBinding,
|
|
||||||
dlGetPriority,
|
|
||||||
dlOnLowResource,
|
|
||||||
dlOnProgress,
|
|
||||||
dlOnStopBinding,
|
|
||||||
dlGetBindInfo,
|
|
||||||
dlOnDataAvailable,
|
|
||||||
dlOnObjectAvailable
|
|
||||||
};
|
|
||||||
|
|
||||||
static IBindStatusCallback*
|
|
||||||
CreateDl(HWND Dlg, BOOL *pbCancelled)
|
|
||||||
{
|
|
||||||
IBindStatusCallbackImpl *This;
|
|
||||||
|
|
||||||
This = HeapAlloc(GetProcessHeap(), 0, sizeof(IBindStatusCallbackImpl));
|
|
||||||
This->vtbl = &dlVtbl;
|
|
||||||
This->ref = 1;
|
|
||||||
This->hDialog = Dlg;
|
|
||||||
This->pbCancelled = pbCancelled;
|
|
||||||
|
|
||||||
return (IBindStatusCallback*) This;
|
|
||||||
}
|
|
||||||
|
|
||||||
static BOOL
|
|
||||||
GetShortcutName(LPWSTR ShortcutName)
|
|
||||||
{
|
|
||||||
if (! SHGetSpecialFolderPathW(0, ShortcutName, CSIDL_PROGRAMS, FALSE))
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (NULL == PathAddBackslashW(ShortcutName))
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (0 == LoadStringW(GetModuleHandle(NULL), IDS_START_MENU_NAME,
|
|
||||||
ShortcutName + wcslen(ShortcutName),
|
|
||||||
MAX_PATH - wcslen(ShortcutName)))
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
if (MAX_PATH - 5 < wcslen(ShortcutName))
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
wcscat(ShortcutName, L".lnk");
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static DWORD WINAPI
|
|
||||||
ThreadFunc(LPVOID Context)
|
|
||||||
{
|
|
||||||
static const WCHAR szUrl[] = DOWNLOAD_URL;
|
|
||||||
IBindStatusCallback *dl;
|
|
||||||
WCHAR path[MAX_PATH], ShortcutName[MAX_PATH];
|
|
||||||
LPWSTR p;
|
|
||||||
STARTUPINFOW si;
|
|
||||||
PROCESS_INFORMATION pi;
|
|
||||||
HWND Dlg = (HWND) Context;
|
|
||||||
DWORD r;
|
|
||||||
BOOL bCancelled = FALSE;
|
|
||||||
BOOL bTempfile = FALSE;
|
|
||||||
|
|
||||||
/* built the path for the download */
|
|
||||||
p = wcsrchr(szUrl, L'/');
|
|
||||||
if (NULL == p)
|
|
||||||
{
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
if (! GetTempPathW(MAX_PATH, path))
|
|
||||||
{
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
wcscat(path, p + 1);
|
|
||||||
|
|
||||||
/* download it */
|
|
||||||
bTempfile = TRUE;
|
|
||||||
dl = CreateDl(Context, &bCancelled);
|
|
||||||
r = URLDownloadToFileW(NULL, szUrl, path, 0, dl);
|
|
||||||
if (NULL != dl)
|
|
||||||
{
|
|
||||||
IBindStatusCallback_Release(dl);
|
|
||||||
}
|
|
||||||
if (S_OK != r || bCancelled )
|
|
||||||
{
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
ShowWindow(Dlg, SW_HIDE);
|
|
||||||
|
|
||||||
/* run it */
|
|
||||||
memset(&si, 0, sizeof(si));
|
|
||||||
si.cb = sizeof(si);
|
|
||||||
r = CreateProcessW(path, NULL, NULL, NULL, 0, 0, NULL, NULL, &si, &pi);
|
|
||||||
if (0 == r)
|
|
||||||
{
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
CloseHandle(pi.hThread);
|
|
||||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
|
||||||
CloseHandle(pi.hProcess);
|
|
||||||
|
|
||||||
if (BST_CHECKED == SendMessageW(GetDlgItem(Dlg, IDC_REMOVE), BM_GETCHECK,
|
|
||||||
0, 0) &&
|
|
||||||
GetShortcutName(ShortcutName))
|
|
||||||
{
|
|
||||||
DeleteFileW(ShortcutName);
|
|
||||||
}
|
|
||||||
|
|
||||||
end:
|
|
||||||
if (bTempfile)
|
|
||||||
{
|
|
||||||
DeleteFileW(path);
|
|
||||||
}
|
|
||||||
EndDialog(Dlg, 0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static INT_PTR CALLBACK
|
|
||||||
dlProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam)
|
|
||||||
{
|
|
||||||
HANDLE Thread;
|
|
||||||
DWORD ThreadId;
|
|
||||||
HWND Item;
|
|
||||||
HICON Icon;
|
|
||||||
WCHAR ShortcutName[MAX_PATH];
|
|
||||||
|
|
||||||
switch (Msg)
|
|
||||||
{
|
|
||||||
case WM_INITDIALOG:
|
|
||||||
Icon = LoadIconW((HINSTANCE) GetWindowLongPtr(Dlg, GWLP_HINSTANCE),
|
|
||||||
MAKEINTRESOURCEW(IDI_ICON_MAIN));
|
|
||||||
if (NULL != Icon)
|
|
||||||
{
|
|
||||||
SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) Icon);
|
|
||||||
SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) Icon);
|
|
||||||
}
|
|
||||||
SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0);
|
|
||||||
Item = GetDlgItem(Dlg, IDC_PROGRESS);
|
|
||||||
if (NULL != Item)
|
|
||||||
{
|
|
||||||
SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0,100));
|
|
||||||
SendMessageW(Item, PBM_SETPOS, 0, 0);
|
|
||||||
}
|
|
||||||
Item = GetDlgItem(Dlg, IDC_REMOVE);
|
|
||||||
if (NULL != Item)
|
|
||||||
{
|
|
||||||
if (GetShortcutName(ShortcutName) &&
|
|
||||||
INVALID_FILE_ATTRIBUTES != GetFileAttributesW(ShortcutName))
|
|
||||||
{
|
|
||||||
SendMessageW(Item, BM_SETCHECK, BST_CHECKED, 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SendMessageW(Item, BM_SETCHECK, BST_UNCHECKED, 0);
|
|
||||||
ShowWindow(Item, SW_HIDE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Thread = CreateThread(NULL, 0, ThreadFunc, Dlg, 0, &ThreadId);
|
|
||||||
if (NULL == Thread)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
CloseHandle(Thread);
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
case WM_COMMAND:
|
|
||||||
if (wParam == IDCANCEL)
|
|
||||||
{
|
|
||||||
SetWindowLongPtrW(Dlg, GWLP_USERDATA, 1);
|
|
||||||
PostMessage(Dlg, WM_CLOSE, 0, 0);
|
|
||||||
}
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
case WM_CLOSE:
|
|
||||||
EndDialog(Dlg, 0);
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* Main program
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
InitCommonControls();
|
|
||||||
|
|
||||||
DialogBoxW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_GETFIREFOX), 0,
|
|
||||||
dlProc);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
@@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* PROJECT: ReactOS utilities
|
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
|
||||||
* FILE: apps/utils/getfirefox/getfirefox.rc
|
|
||||||
* PURPOSE: Language-independent resources
|
|
||||||
* COPYRIGHT: Copyright 2005 Ge van Geldorp (gvg@reactos.org)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
#include "resource.h"
|
|
||||||
|
|
||||||
#define REACTOS_STR_FILE_DESCRIPTION "Firefox downloader\0"
|
|
||||||
#define REACTOS_STR_INTERNAL_NAME "getfirefox\0"
|
|
||||||
#define REACTOS_STR_ORIGINAL_FILENAME "getfirefox.exe\0"
|
|
||||||
#include <reactos/version.rc>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Note: this icon is the "default logo" referenced here:
|
|
||||||
* http://www.mozilla.org/foundation/trademarks/faq.html (under "What are the
|
|
||||||
* Mozilla Trademarks and Logos?"). Don't use the official Firefox logo as it
|
|
||||||
* is trademarked.
|
|
||||||
*/
|
|
||||||
1 ICON "firefox.ico"
|
|
||||||
|
|
||||||
#include "De.rc"
|
|
||||||
#include "En.rc"
|
|
||||||
#include "Fr.rc"
|
|
||||||
#include "Hu.rc"
|
|
@@ -1,17 +0,0 @@
|
|||||||
<module name="getfirefox" type="win32gui" installbase="system32" installname="getfirefox.exe">
|
|
||||||
<include base="getfirefox">.</include>
|
|
||||||
<define name="UNICODE" />
|
|
||||||
<define name="_UNICODE" />
|
|
||||||
<define name="__USE_W32API" />
|
|
||||||
<define name="WINVER">0x0501</define>
|
|
||||||
<define name="_WIN32_IE>0x0600</define>
|
|
||||||
<library>comctl32</library>
|
|
||||||
<library>ntdll</library>
|
|
||||||
<library>shell32</library>
|
|
||||||
<library>shlwapi</library>
|
|
||||||
<library>urlmon</library>
|
|
||||||
<library>uuid</library>
|
|
||||||
<pch>precomp.h</pch>
|
|
||||||
<file>getfirefox.c</file>
|
|
||||||
<file>getfirefox.rc</file>
|
|
||||||
</module>
|
|
@@ -1,19 +0,0 @@
|
|||||||
/*
|
|
||||||
* PROJECT: ReactOS utilities
|
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
|
||||||
* FILE: apps/utils/getfirefox/precomp.h
|
|
||||||
* PURPOSE: Precompiled header file
|
|
||||||
* COPYRIGHT: Copyright 2005 Ge van Geldorp (gvg@reactos.org)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define COBJMACROS
|
|
||||||
#define NTOS_MODE_USER
|
|
||||||
#define WIN32_NO_STATUS
|
|
||||||
#include <windows.h>
|
|
||||||
#include <ndk/ntndk.h>
|
|
||||||
#include <commctrl.h>
|
|
||||||
#include <shlobj.h>
|
|
||||||
#include <shlwapi.h>
|
|
||||||
#include <urlmon.h>
|
|
||||||
|
|
||||||
#include "resource.h"
|
|
@@ -1,17 +0,0 @@
|
|||||||
/*
|
|
||||||
* PROJECT: ReactOS utilities
|
|
||||||
* LICENSE: GPL - See COPYING in the top level directory
|
|
||||||
* FILE: apps/utils/getfirefox/resource.h
|
|
||||||
* PURPOSE: Resource constants
|
|
||||||
* COPYRIGHT: Copyright 2005 Ge van Geldorp (gvg@reactos.org)
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define IDI_ICON_MAIN 1
|
|
||||||
|
|
||||||
#define IDD_GETFIREFOX 100
|
|
||||||
|
|
||||||
#define IDC_PROGRESS 1000
|
|
||||||
#define IDC_STATUS 1001
|
|
||||||
#define IDC_REMOVE 1002
|
|
||||||
|
|
||||||
#define IDS_START_MENU_NAME 1100
|
|
21
reactos/apps/utils/infinst/makefile
Normal file
21
reactos/apps/utils/infinst/makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
PATH_TO_TOP = ../../..
|
||||||
|
|
||||||
|
TARGET_NORC = yes
|
||||||
|
|
||||||
|
TARGET_TYPE = program
|
||||||
|
|
||||||
|
TARGET_APPTYPE = windows
|
||||||
|
|
||||||
|
TARGET_NAME = infinst
|
||||||
|
|
||||||
|
TARGET_SDKLIBS = comdlg32.a setupapi.a
|
||||||
|
|
||||||
|
TARGET_OBJECTS = infinst.o
|
||||||
|
|
||||||
|
TARGET_CFLAGS = -Wall -Werror
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
include $(TOOLS_PATH)/helper.mk
|
||||||
|
|
||||||
|
# EOF
|
@@ -1,602 +1,99 @@
|
|||||||
/*
|
/*
|
||||||
* ReactOS Win32 Applications
|
* arp - display ARP cache from the IP stack parameters.
|
||||||
* Copyright (C) 2005 ReactOS Team
|
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This source code is in the PUBLIC DOMAIN and has NO WARRANTY.
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* Robert Dickenson <robd@reactos.org>, August 15, 2002.
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS arp utility
|
|
||||||
* FILE: apps/utils/net/arp/arp.c
|
|
||||||
* PURPOSE: view and manipulate the ARP cache
|
|
||||||
* PROGRAMMERS: Ged Murphy (gedmurphy@gmail.com)
|
|
||||||
* REVISIONS:
|
|
||||||
* GM 27/06/05 Created
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#include <windows.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <windows.h>
|
||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
#include <string.h>
|
#include <time.h>
|
||||||
#include <ctype.h>
|
|
||||||
#include <winsock2.h>
|
#include <iptypes.h>
|
||||||
|
#include <ipexport.h>
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
|
#include <snmp.h>
|
||||||
|
|
||||||
#define UNICODE
|
#include "trace.h"
|
||||||
#define _UNICODE
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Globals
|
|
||||||
*/
|
|
||||||
const char SEPERATOR = '-';
|
|
||||||
int _CRT_glob = 0; // stop * from listing dir files in arp -d *
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
VOID SNMP_FUNC_TYPE SnmpSvcInitUptime();
|
||||||
* function declerations
|
DWORD SNMP_FUNC_TYPE SnmpSvcGetUptime();
|
||||||
*/
|
|
||||||
DWORD DoFormatMessage(DWORD ErrorCode);
|
|
||||||
INT PrintEntries(PMIB_IPNETROW pIpAddRow);
|
|
||||||
INT DisplayArpEntries(PTCHAR pszInetAddr, PTCHAR pszIfAddr);
|
|
||||||
INT Addhost(PTCHAR pszInetAddr, PTCHAR pszEthAddr, PTCHAR pszIfAddr);
|
|
||||||
INT Deletehost(PTCHAR pszInetAddr, PTCHAR pszIfAddr);
|
|
||||||
VOID Usage(VOID);
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/*
|
const char szUsage[] = { "\n" \
|
||||||
* convert error code into meaningful message
|
"Displays and modifies the IP Protocol to physical address translation tables\n" \
|
||||||
*/
|
"used by address resolution protocol (ARP).\n" \
|
||||||
DWORD DoFormatMessage(DWORD ErrorCode)
|
"\n" \
|
||||||
|
"ARP -s inet_addr eth_addr [if_addr]\n" \
|
||||||
|
"ARP -d inet_addr [if_addr]\n" \
|
||||||
|
"ARP -a [inet_addr] [-N if_addr]\n" \
|
||||||
|
"\n" \
|
||||||
|
" -a Displays the active ARP table by querying the current protocol\n" \
|
||||||
|
" data. If inet_addr is specified, the IP and physical addresses\n" \
|
||||||
|
" for the specified address are displayed. If more than one\n" \
|
||||||
|
" network interface is using ARP, each interfaces ARP table is\n" \
|
||||||
|
" displayed.\n" \
|
||||||
|
" -g Indentical to -a.\n" \
|
||||||
|
" inet_addr Specifies the IP address.\n" \
|
||||||
|
" -N if_addr Displays the ARP table for the specified interface only\n" \
|
||||||
|
" -d Deletes the host entry specified by inet_addr. inet_addr may be\n" \
|
||||||
|
" wildcarded with * to delete all host entries in the ARP table.\n" \
|
||||||
|
" -s Adds the host and associates the IP address inet_addr with the\n" \
|
||||||
|
" physical address eth_addr. The physical address must be specified\n" \
|
||||||
|
" as 6 hexadecimal characters delimited by hyphens. The new entry\n" \
|
||||||
|
" will become permanent in the ARP table.\n" \
|
||||||
|
" eth_addr Specifies the interface physical address.\n" \
|
||||||
|
" if_addr If present, this specifies the IP address of the interface whose\n" \
|
||||||
|
" address translation table should be modified. If not present, the\n" \
|
||||||
|
" first applicable interface will be used.\n" \
|
||||||
|
"Example:\n" \
|
||||||
|
" > arp -s 192.168.0.12 55-AA-55-01-02-03 .... Static entry creation.\n" \
|
||||||
|
" > arp -a .... ARP table display.\n" \
|
||||||
|
" > arp -d * .... Delete all ARP table entries.\n"
|
||||||
|
};
|
||||||
|
|
||||||
|
void usage(void)
|
||||||
{
|
{
|
||||||
LPVOID lpMsgBuf;
|
// fprintf(stderr,"USAGE:\n");
|
||||||
DWORD RetVal;
|
fputs(szUsage, stderr);
|
||||||
/* double brackets to silence the assignment warning message */
|
|
||||||
if ((RetVal = FormatMessage(
|
|
||||||
FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
|
||||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
|
||||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
|
||||||
NULL,
|
|
||||||
ErrorCode,
|
|
||||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
|
|
||||||
(LPTSTR) &lpMsgBuf,
|
|
||||||
0,
|
|
||||||
NULL ))) {
|
|
||||||
_tprintf(_T("%s"), (LPTSTR)lpMsgBuf);
|
|
||||||
|
|
||||||
LocalFree(lpMsgBuf);
|
|
||||||
/* return number of TCHAR's stored in output buffer
|
|
||||||
* excluding '\0' - as FormatMessage does*/
|
|
||||||
return RetVal;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Takes an ARP entry and prints the IP address,
|
|
||||||
* the MAC address and the entry type to screen
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
INT PrintEntries(PMIB_IPNETROW pIpAddRow)
|
|
||||||
{
|
{
|
||||||
IN_ADDR inaddr;
|
TCHAR szComputerName[50];
|
||||||
TCHAR cMacAddr[20];
|
DWORD dwSize = 50;
|
||||||
|
|
||||||
/* print IP addresses */
|
int nBytes = 500;
|
||||||
inaddr.S_un.S_addr = pIpAddRow->dwAddr;
|
BYTE* pCache;
|
||||||
_tprintf(_T(" %-22s"), inet_ntoa(inaddr));
|
|
||||||
|
|
||||||
/* print MAC address */
|
if (argc > 1) {
|
||||||
_stprintf(cMacAddr, _T("%02x-%02x-%02x-%02x-%02x-%02x"),
|
usage();
|
||||||
pIpAddRow->bPhysAddr[0],
|
return 1;
|
||||||
pIpAddRow->bPhysAddr[1],
|
|
||||||
pIpAddRow->bPhysAddr[2],
|
|
||||||
pIpAddRow->bPhysAddr[3],
|
|
||||||
pIpAddRow->bPhysAddr[4],
|
|
||||||
pIpAddRow->bPhysAddr[5]);
|
|
||||||
_tprintf(_T("%-22s"), cMacAddr);
|
|
||||||
|
|
||||||
/* print cache type */
|
|
||||||
switch (pIpAddRow->dwType)
|
|
||||||
{
|
|
||||||
case MIB_IPNET_TYPE_DYNAMIC : _tprintf(_T("dynamic\n"));
|
|
||||||
break;
|
|
||||||
case MIB_IPNET_TYPE_STATIC : _tprintf(_T("static\n"));
|
|
||||||
break;
|
|
||||||
case MIB_IPNET_TYPE_INVALID : _tprintf(_T("invalid\n"));
|
|
||||||
break;
|
|
||||||
case MIB_IPNET_TYPE_OTHER : _tprintf(_T("other\n"));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return EXIT_SUCCESS;
|
|
||||||
|
SnmpSvcInitUptime();
|
||||||
|
|
||||||
|
GetComputerName(szComputerName, &dwSize);
|
||||||
|
_tprintf(_T("ReactOS ARP cache on Computer Name: %s\n"), szComputerName);
|
||||||
|
|
||||||
|
pCache = (BYTE*)SnmpUtilMemAlloc(nBytes);
|
||||||
|
|
||||||
|
Sleep(2500);
|
||||||
|
|
||||||
|
if (pCache != NULL) {
|
||||||
|
|
||||||
|
DWORD dwUptime = SnmpSvcGetUptime();
|
||||||
|
|
||||||
|
_tprintf(_T("SNMP uptime: %d\n"), dwUptime);
|
||||||
|
|
||||||
|
SnmpUtilMemFree(pCache);
|
||||||
|
} else {
|
||||||
|
_tprintf(_T("ERROR: call to SnmpUtilMemAlloc() failed\n"));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Takes optional parameters of an internet address and interface address.
|
|
||||||
* Retrieve all entries in the ARP cache. If an internet address is
|
|
||||||
* specified, display the ARP entry relating to that address. If an
|
|
||||||
* interface address is specified, display all entries relating to
|
|
||||||
* that interface.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
/* FIXME: allow user to specify an interface address, via pszIfAddr */
|
|
||||||
INT DisplayArpEntries(PTCHAR pszInetAddr, PTCHAR pszIfAddr)
|
|
||||||
{
|
|
||||||
INT iRet;
|
|
||||||
UINT i, k;
|
|
||||||
PMIB_IPNETTABLE pIpNetTable;
|
|
||||||
PMIB_IPADDRTABLE pIpAddrTable;
|
|
||||||
ULONG ulSize = 0;
|
|
||||||
struct in_addr inaddr, inaddr2;
|
|
||||||
DWORD dwSize = 0;
|
|
||||||
PTCHAR pszIpAddr;
|
|
||||||
TCHAR szIntIpAddr[20];
|
|
||||||
|
|
||||||
/* Return required buffer size */
|
|
||||||
GetIpNetTable(NULL, &ulSize, 0);
|
|
||||||
|
|
||||||
/* allocate memory for ARP address table */
|
|
||||||
pIpNetTable = (PMIB_IPNETTABLE) malloc(ulSize * sizeof(BYTE));
|
|
||||||
ZeroMemory(pIpNetTable, sizeof(*pIpNetTable));
|
|
||||||
|
|
||||||
/* get Arp address table */
|
|
||||||
if (pIpNetTable != NULL)
|
|
||||||
GetIpNetTable(pIpNetTable, &ulSize, TRUE);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_tprintf(_T("failed to allocate memory for GetIpNetTable\n"));
|
|
||||||
free(pIpNetTable);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check there are entries in the table */
|
|
||||||
if (pIpNetTable->dwNumEntries == 0)
|
|
||||||
{
|
|
||||||
_tprintf(_T("No ARP entires found\n"));
|
|
||||||
free(pIpNetTable);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* try doing this in the way it's done above, it's clearer */
|
|
||||||
/* Retrieve the interface-to-ip address mapping
|
|
||||||
* table to get the IP address for adapter */
|
|
||||||
pIpAddrTable = (MIB_IPADDRTABLE *) malloc(dwSize);
|
|
||||||
GetIpAddrTable(pIpAddrTable, &dwSize, 0); // NULL ?
|
|
||||||
|
|
||||||
|
|
||||||
pIpAddrTable = (MIB_IPADDRTABLE *) malloc(dwSize);
|
|
||||||
//ZeroMemory(pIpAddrTable, sizeof(*pIpAddrTable));
|
|
||||||
|
|
||||||
if ((iRet = GetIpAddrTable(pIpAddrTable, &dwSize, TRUE)) != NO_ERROR)
|
|
||||||
{
|
|
||||||
_tprintf(_T("GetIpAddrTable failed: %d\n"), iRet);
|
|
||||||
_tprintf(_T("error: %d\n"), WSAGetLastError());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for (k=0; k < pIpAddrTable->dwNumEntries; k++)
|
|
||||||
{
|
|
||||||
if (pIpNetTable->table[0].dwIndex == pIpAddrTable->table[k].dwIndex)
|
|
||||||
{
|
|
||||||
//printf("debug print: pIpAddrTable->table[?].dwIndex = %lx\n", pIpNetTable->table[k].dwIndex);
|
|
||||||
inaddr2.s_addr = pIpAddrTable->table[k].dwAddr;
|
|
||||||
pszIpAddr = inet_ntoa(inaddr2);
|
|
||||||
strcpy(szIntIpAddr, pszIpAddr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* print header, including interface IP address and index number */
|
|
||||||
_tprintf(_T("\nInterface: %s --- 0x%lx \n"), szIntIpAddr, pIpNetTable->table[0].dwIndex);
|
|
||||||
_tprintf(_T(" Internet Address Physical Address Type\n"));
|
|
||||||
|
|
||||||
/* go through all ARP entries */
|
|
||||||
for (i=0; i < pIpNetTable->dwNumEntries; i++)
|
|
||||||
{
|
|
||||||
|
|
||||||
/* if the user has supplied their own internet addesss *
|
|
||||||
* only print the arp entry which matches that */
|
|
||||||
if (pszInetAddr)
|
|
||||||
{
|
|
||||||
inaddr.S_un.S_addr = pIpNetTable->table[i].dwAddr;
|
|
||||||
pszIpAddr = inet_ntoa(inaddr);
|
|
||||||
|
|
||||||
/* check if it matches, print it */
|
|
||||||
if (strcmp(pszIpAddr, pszInetAddr) == 0)
|
|
||||||
PrintEntries(&pIpNetTable->table[i]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
/* if an address is not supplied, print all entries */
|
|
||||||
PrintEntries(&pIpNetTable->table[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(pIpNetTable);
|
|
||||||
free(pIpAddrTable);
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Takes an internet address, a MAC address and an optional interface
|
|
||||||
* address as arguments and checks their validity.
|
|
||||||
* Fill out an MIB_IPNETROW structure and insert the data into the
|
|
||||||
* ARP cache as a static entry.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
INT Addhost(PTCHAR pszInetAddr, PTCHAR pszEthAddr, PTCHAR pszIfAddr)
|
|
||||||
{
|
|
||||||
PMIB_IPNETROW pAddHost;
|
|
||||||
PMIB_IPADDRTABLE pIpAddrTable;
|
|
||||||
PMIB_IPNETTABLE pIpNetTable;
|
|
||||||
DWORD dwIpAddr = 0;
|
|
||||||
DWORD dwSize = 0;
|
|
||||||
ULONG ulSize = 0;
|
|
||||||
INT iRet, i, val;
|
|
||||||
TCHAR c;
|
|
||||||
|
|
||||||
/* error checking */
|
|
||||||
|
|
||||||
/* check IP address */
|
|
||||||
if (pszInetAddr != NULL)
|
|
||||||
{
|
|
||||||
if ((dwIpAddr = inet_addr(pszInetAddr)) == INADDR_NONE)
|
|
||||||
{
|
|
||||||
_tprintf(_T("ARP: bad IP address: %s\n"), pszInetAddr);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Usage();
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* check MAC address */
|
|
||||||
if (strlen(pszEthAddr) != 17)
|
|
||||||
{
|
|
||||||
_tprintf(_T("ARP: bad argument: %s\n"), pszEthAddr);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
for (i=0; i<17; i++)
|
|
||||||
{
|
|
||||||
if (pszEthAddr[i] == SEPERATOR)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!isxdigit(pszEthAddr[i]))
|
|
||||||
{
|
|
||||||
_tprintf(_T("ARP: bad argument: %s\n"), pszEthAddr);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We need the IpNetTable to get the adapter index */
|
|
||||||
/* Return required buffer size */
|
|
||||||
GetIpNetTable(NULL, &ulSize, 0);
|
|
||||||
/* allocate memory for ARP address table */
|
|
||||||
pIpNetTable = (PMIB_IPNETTABLE) malloc(ulSize * sizeof(BYTE));
|
|
||||||
ZeroMemory(pIpNetTable, sizeof(*pIpNetTable));
|
|
||||||
/* get Arp address table */
|
|
||||||
if (pIpNetTable != NULL)
|
|
||||||
GetIpNetTable(pIpNetTable, &ulSize, TRUE);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_tprintf(_T("failed to allocate memory for GetIpNetTable\n"));
|
|
||||||
free(pIpNetTable);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* reserve memory on heap and zero */
|
|
||||||
pAddHost = (MIB_IPNETROW *) malloc(sizeof(MIB_IPNETROW));
|
|
||||||
ZeroMemory(pAddHost, sizeof(MIB_IPNETROW));
|
|
||||||
|
|
||||||
/* set dwIndex field to the index of a local IP address to
|
|
||||||
* indicate the network on which the ARP entry applies */
|
|
||||||
if (pszIfAddr)
|
|
||||||
sscanf(pszIfAddr, "%lx", &pAddHost->dwIndex);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* map the IP to the index */
|
|
||||||
pIpAddrTable = (MIB_IPADDRTABLE *) malloc(dwSize);
|
|
||||||
GetIpAddrTable(pIpAddrTable, &dwSize, 0);
|
|
||||||
|
|
||||||
pIpAddrTable = (MIB_IPADDRTABLE *) malloc(dwSize);
|
|
||||||
|
|
||||||
if ((iRet = GetIpAddrTable(pIpAddrTable, &dwSize, TRUE)) != NO_ERROR)
|
|
||||||
{
|
|
||||||
_tprintf(_T("GetIpAddrTable failed: %d\n"), iRet);
|
|
||||||
_tprintf(_T("error: %d\n"), WSAGetLastError());
|
|
||||||
}
|
|
||||||
//printf("debug print: pIpNetTable->table[0].dwIndex = %lx\n", pIpNetTable->table[0].dwIndex);
|
|
||||||
/* needs testing. I get the correct index on my machine, but need others
|
|
||||||
* to test their card index. Any problems and we can use GetAdaptersInfo instead */
|
|
||||||
pAddHost->dwIndex = pIpNetTable->table[0].dwIndex;
|
|
||||||
|
|
||||||
free(pIpAddrTable);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set MAC address to 6 bytes (typical) */
|
|
||||||
pAddHost->dwPhysAddrLen = 6;
|
|
||||||
|
|
||||||
|
|
||||||
/* Encode bPhysAddr into correct byte array */
|
|
||||||
for (i=0; i<6; i++)
|
|
||||||
{
|
|
||||||
val =0;
|
|
||||||
c = toupper(pszEthAddr[i*3]);
|
|
||||||
c = c - (isdigit(c) ? '0' : ('A' - 10));
|
|
||||||
val += c;
|
|
||||||
val = (val << 4);
|
|
||||||
c = toupper(pszEthAddr[i*3 + 1]);
|
|
||||||
c = c - (isdigit(c) ? '0' : ('A' - 10));
|
|
||||||
val += c;
|
|
||||||
pAddHost->bPhysAddr[i] = val;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* copy converted IP address */
|
|
||||||
pAddHost->dwAddr = dwIpAddr;
|
|
||||||
|
|
||||||
|
|
||||||
/* set type to static */
|
|
||||||
pAddHost->dwType = MIB_IPNET_TYPE_STATIC;
|
|
||||||
|
|
||||||
|
|
||||||
/* Add the ARP entry */
|
|
||||||
if ((iRet = SetIpNetEntry(pAddHost)) != NO_ERROR)
|
|
||||||
{
|
|
||||||
DoFormatMessage(iRet);
|
|
||||||
free(pAddHost);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(pAddHost);
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Takes an internet address and an optional interface address as
|
|
||||||
* arguments and checks their validity.
|
|
||||||
* Add the interface number and IP to an MIB_IPNETROW structure
|
|
||||||
* and remove the entry from the ARP cache.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
INT Deletehost(PTCHAR pszInetAddr, PTCHAR pszIfAddr)
|
|
||||||
{
|
|
||||||
PMIB_IPNETROW pDelHost;
|
|
||||||
PMIB_IPADDRTABLE pIpAddrTable;
|
|
||||||
PMIB_IPNETTABLE pIpNetTable;
|
|
||||||
ULONG ulSize = 0;
|
|
||||||
DWORD dwIpAddr = 0;
|
|
||||||
DWORD dwSize = 0;
|
|
||||||
INT iRet;
|
|
||||||
BOOL bFlushTable = FALSE;
|
|
||||||
|
|
||||||
/* error checking */
|
|
||||||
|
|
||||||
/* check IP address */
|
|
||||||
if (pszInetAddr != NULL)
|
|
||||||
{
|
|
||||||
/* if wildcard is given, set flag to delete all hosts */
|
|
||||||
if (strncmp(pszInetAddr, "*", 1) == 0)
|
|
||||||
bFlushTable = TRUE;
|
|
||||||
else if ((dwIpAddr = inet_addr(pszInetAddr)) == INADDR_NONE)
|
|
||||||
{
|
|
||||||
_tprintf(_T("ARP: bad IP address: %s\n"), pszInetAddr);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Usage();
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* We need the IpNetTable to get the adapter index */
|
|
||||||
/* Return required buffer size */
|
|
||||||
GetIpNetTable(NULL, &ulSize, 0);
|
|
||||||
/* allocate memory for ARP address table */
|
|
||||||
pIpNetTable = (PMIB_IPNETTABLE) malloc(ulSize * sizeof(BYTE));
|
|
||||||
ZeroMemory(pIpNetTable, sizeof(*pIpNetTable));
|
|
||||||
/* get Arp address table */
|
|
||||||
if (pIpNetTable != NULL)
|
|
||||||
GetIpNetTable(pIpNetTable, &ulSize, TRUE);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_tprintf(_T("failed to allocate memory for GetIpNetTable\n"));
|
|
||||||
free(pIpNetTable);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
pIpAddrTable = (MIB_IPADDRTABLE*) malloc(sizeof(MIB_IPADDRTABLE));
|
|
||||||
pDelHost = (MIB_IPNETROW *) malloc(sizeof(MIB_IPNETROW));
|
|
||||||
ZeroMemory(pIpAddrTable, sizeof(MIB_IPADDRTABLE));
|
|
||||||
ZeroMemory(pDelHost, sizeof(MIB_IPNETROW));
|
|
||||||
/* set dwIndex field to the index of a local IP address to
|
|
||||||
* indicate the network on which the ARP entry applies */
|
|
||||||
if (pszIfAddr)
|
|
||||||
sscanf(pszIfAddr, "%lx", &pDelHost->dwIndex);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* map the IP to the index */
|
|
||||||
if (GetIpAddrTable(pIpAddrTable, &dwSize, 0) == ERROR_INSUFFICIENT_BUFFER)
|
|
||||||
pIpAddrTable = (MIB_IPADDRTABLE *) malloc(dwSize);
|
|
||||||
|
|
||||||
if ((iRet = GetIpAddrTable(pIpAddrTable, &dwSize, TRUE)) != NO_ERROR)
|
|
||||||
{
|
|
||||||
_tprintf(_T("GetIpAddrTable failed: %d\n"), iRet);
|
|
||||||
_tprintf(_T("error: %d\n"), WSAGetLastError());
|
|
||||||
}
|
|
||||||
/* needs testing. I get the correct index on my machine, but need others
|
|
||||||
* to test their card index. Any problems and we can use GetAdaptersInfo instead */
|
|
||||||
pDelHost->dwIndex = pIpNetTable->table[0].dwIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bFlushTable == TRUE)
|
|
||||||
{
|
|
||||||
/* delete arp cache */
|
|
||||||
if ((iRet = FlushIpNetTable(pDelHost->dwIndex)) != NO_ERROR)
|
|
||||||
{
|
|
||||||
DoFormatMessage(iRet);
|
|
||||||
free(pIpAddrTable);
|
|
||||||
free(pDelHost);
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
free(pIpAddrTable);
|
|
||||||
free(pDelHost);
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
/* copy converted IP address */
|
|
||||||
pDelHost->dwAddr = dwIpAddr;
|
|
||||||
|
|
||||||
/* Add the ARP entry */
|
|
||||||
if ((iRet = DeleteIpNetEntry(pDelHost)) != NO_ERROR)
|
|
||||||
{
|
|
||||||
|
|
||||||
DoFormatMessage(iRet);
|
|
||||||
free(pIpAddrTable);
|
|
||||||
free(pDelHost);
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
|
|
||||||
free(pIpAddrTable);
|
|
||||||
free(pDelHost);
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* print program usage to screen
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
VOID Usage(VOID)
|
|
||||||
{
|
|
||||||
_tprintf(_T("\nDisplays and modifies the IP-to-Physical address translation tables used by\n"
|
|
||||||
"address resolution protocol (ARP).\n"
|
|
||||||
"\n"
|
|
||||||
"ARP -s inet_addr eth_addr [if_addr]\n"
|
|
||||||
"ARP -d inet_addr [if_addr]\n"
|
|
||||||
"ARP -a [inet_addr] [-N if_addr]\n"
|
|
||||||
"\n"
|
|
||||||
" -a Displays current ARP entries by interrogating the current\n"
|
|
||||||
" protocol data. If inet_addr is specified, the IP and Physical\n"
|
|
||||||
" addresses for only the specified computer are displayed. If\n"
|
|
||||||
" more than one network interface uses ARP, entries for each ARP\n"
|
|
||||||
" table are displayed.\n"
|
|
||||||
" -g Same as -a.\n"
|
|
||||||
" inet_addr Specifies an internet address.\n"
|
|
||||||
" -N if_addr Displays the ARP entries for the network interface specified\n"
|
|
||||||
" by if_addr.\n"
|
|
||||||
" -d Deletes the host specified by inet_addr. inet_addr may be\n"
|
|
||||||
" wildcarded with * to delete all hosts.\n"
|
|
||||||
" -s Adds the host and associates the Internet address inet_addr\n"
|
|
||||||
" with the Physical address eth_addr. The Physical address is\n"
|
|
||||||
" given as 6 hexadecimal bytes separated by hyphens. The entry\n"
|
|
||||||
" is permanent.\n"
|
|
||||||
" eth_addr Specifies a physical address.\n"
|
|
||||||
" if_addr If present, this specifies the Internet address of the\n"
|
|
||||||
" interface whose address translation table should be modified.\n"
|
|
||||||
" If not present, the first applicable interface will be used.\n"
|
|
||||||
"Example:\n"
|
|
||||||
" > arp -s 157.55.85.212 00-aa-00-62-c6-09 .... Adds a static entry.\n"
|
|
||||||
" > arp -a .... Displays the arp table.\n\n"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Program entry.
|
|
||||||
* Parse command line and call the required function
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
INT main(int argc, char* argv[])
|
|
||||||
{
|
|
||||||
if ((argc < 2) || (argc > 5))
|
|
||||||
{
|
|
||||||
Usage();
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (argv[1][0] == '-')
|
|
||||||
{
|
|
||||||
switch (argv[1][1])
|
|
||||||
{
|
|
||||||
case 'a': /* fall through */
|
|
||||||
case 'g':
|
|
||||||
if (argc == 2)
|
|
||||||
DisplayArpEntries(NULL, NULL);
|
|
||||||
else if (argc == 3)
|
|
||||||
DisplayArpEntries(argv[2], NULL);
|
|
||||||
else if ((argc == 4) && ((strcmp(argv[2], "-N")) == 0))
|
|
||||||
DisplayArpEntries(NULL, argv[3]);
|
|
||||||
else if ((argc == 5) && ((strcmp(argv[3], "-N")) == 0))
|
|
||||||
DisplayArpEntries(argv[2], argv[4]);
|
|
||||||
else
|
|
||||||
Usage();
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
break;
|
|
||||||
case 'd': if (argc == 3)
|
|
||||||
Deletehost(argv[2], NULL);
|
|
||||||
else if (argc == 4)
|
|
||||||
Deletehost(argv[2], argv[3]);
|
|
||||||
else
|
|
||||||
Usage();
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
break;
|
|
||||||
case 's': if (argc == 4)
|
|
||||||
Addhost(argv[2], argv[3], NULL);
|
|
||||||
else if (argc == 5)
|
|
||||||
Addhost(argv[2], argv[3], argv[4]);
|
|
||||||
else
|
|
||||||
Usage();
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Usage();
|
|
||||||
return EXIT_FAILURE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Usage();
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
} /*
|
|
||||||
warning: suggest parentheses around assignment used as truth value
|
|
||||||
warning: char format, void arg (arg 2)*/
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS TCP/IPv4 Win32 arp\0"
|
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS TCP/IPv4 Win32 arp\0"
|
||||||
#define REACTOS_STR_INTERNAL_NAME "arp\0"
|
#define REACTOS_STR_INTERNAL_NAME "arp\0"
|
||||||
#define REACTOS_STR_ORIGINAL_FILENAME "arp.exe\0"
|
#define REACTOS_STR_ORIGINAL_FILENAME "arp.exe\0"
|
||||||
#define REACTOS_STR_ORIGINAL_COPYRIGHT "Ged Murphy (gedmurphy@gmail.com)\0"
|
|
||||||
#include <reactos/version.rc>
|
#include <reactos/version.rc>
|
||||||
|
@@ -1,11 +0,0 @@
|
|||||||
<module name="arp" type="win32cui" installbase="system32" installname="arp.exe">
|
|
||||||
<include base="arp">.</include>
|
|
||||||
<define name="__USE_W32API" />
|
|
||||||
<library>kernel32</library>
|
|
||||||
<library>iphlpapi</library>
|
|
||||||
<library>ws2_32</library>
|
|
||||||
<library>shlwapi</library>
|
|
||||||
<file>arp.c</file>
|
|
||||||
<file>arp.rc</file>
|
|
||||||
</module>
|
|
||||||
|
|
19
reactos/apps/utils/net/arp/makefile
Normal file
19
reactos/apps/utils/net/arp/makefile
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
PATH_TO_TOP = ../../../..
|
||||||
|
|
||||||
|
TARGET_TYPE = program
|
||||||
|
|
||||||
|
TARGET_APPTYPE = console
|
||||||
|
|
||||||
|
TARGET_NAME = arp
|
||||||
|
|
||||||
|
TARGET_INSTALLDIR = system32
|
||||||
|
|
||||||
|
TARGET_CFLAGS = -D__USE_W32API
|
||||||
|
|
||||||
|
TARGET_SDKLIBS = user32.a snmpapi.a
|
||||||
|
|
||||||
|
TARGET_OBJECTS = $(TARGET_NAME).o
|
||||||
|
|
||||||
|
include $(PATH_TO_TOP)/rules.mak
|
||||||
|
|
||||||
|
include $(TOOLS_PATH)/helper.mk
|
53
reactos/apps/utils/net/arp/trace.c
Normal file
53
reactos/apps/utils/net/arp/trace.c
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Diagnostic Trace
|
||||||
|
//
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <windows.h>
|
||||||
|
#include <tchar.h>
|
||||||
|
#include "trace.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
|
||||||
|
#undef THIS_FILE
|
||||||
|
static char THIS_FILE[] = __FILE__;
|
||||||
|
|
||||||
|
void _DebugBreak(void)
|
||||||
|
{
|
||||||
|
DebugBreak();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Trace(TCHAR* lpszFormat, ...)
|
||||||
|
{
|
||||||
|
va_list args;
|
||||||
|
int nBuf;
|
||||||
|
TCHAR szBuffer[512];
|
||||||
|
|
||||||
|
va_start(args, lpszFormat);
|
||||||
|
nBuf = _vsntprintf(szBuffer, sizeof(szBuffer)/sizeof(TCHAR), lpszFormat, args);
|
||||||
|
OutputDebugString(szBuffer);
|
||||||
|
// was there an error? was the expanded string too long?
|
||||||
|
//ASSERT(nBuf >= 0);
|
||||||
|
va_end(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Assert(void* assert, TCHAR* file, int line, void* msg)
|
||||||
|
{
|
||||||
|
if (msg == NULL) {
|
||||||
|
printf("ASSERT -- %s occured on line %u of file %s.\n",
|
||||||
|
assert, line, file);
|
||||||
|
} else {
|
||||||
|
printf("ASSERT -- %s occured on line %u of file %s: Message = %s.\n",
|
||||||
|
assert, line, file, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
void Trace(TCHAR* lpszFormat, ...) { };
|
||||||
|
void Assert(void* assert, TCHAR* file, int line, void* msg) { };
|
||||||
|
|
||||||
|
#endif //_DEBUG
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
61
reactos/apps/utils/net/arp/trace.h
Normal file
61
reactos/apps/utils/net/arp/trace.h
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Diagnostic Trace
|
||||||
|
//
|
||||||
|
#ifndef __TRACE_H__
|
||||||
|
#define __TRACE_H__
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
|
||||||
|
#ifdef _X86_
|
||||||
|
#define BreakPoint() _asm { int 3h }
|
||||||
|
#else
|
||||||
|
#define BreakPoint() _DebugBreak()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ASSERT
|
||||||
|
#define ASSERT(exp) \
|
||||||
|
{ \
|
||||||
|
if (!(exp)) { \
|
||||||
|
Assert(#exp, __FILE__, __LINE__, NULL); \
|
||||||
|
BreakPoint(); \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
|
|
||||||
|
#define ASSERTMSG(exp, msg) \
|
||||||
|
{ \
|
||||||
|
if (!(exp)) { \
|
||||||
|
Assert(#exp, __FILE__, __LINE__, msg); \
|
||||||
|
BreakPoint(); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
// MACRO: TRACE()
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
#define TRACE Trace
|
||||||
|
|
||||||
|
|
||||||
|
#else // _DEBUG
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
// Define away MACRO's ASSERT() and TRACE() in non debug builds
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
#ifndef ASSERT
|
||||||
|
#define ASSERT(exp)
|
||||||
|
#define ASSERTMSG(exp, msg)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define TRACE 0 ? (void)0 : Trace
|
||||||
|
|
||||||
|
#endif // !_DEBUG
|
||||||
|
|
||||||
|
|
||||||
|
void Assert(void* assert, TCHAR* file, int line, void* msg);
|
||||||
|
void Trace(TCHAR* lpszFormat, ...);
|
||||||
|
|
||||||
|
|
||||||
|
#endif // __TRACE_H__
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
@@ -1,30 +0,0 @@
|
|||||||
<directory name="arp">
|
|
||||||
<xi:include href="arp/arp.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="finger">
|
|
||||||
<xi:include href="finger/finger.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="ftp">
|
|
||||||
<xi:include href="ftp/ftp.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="ipconfig">
|
|
||||||
<xi:include href="ipconfig/ipconfig.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="netstat">
|
|
||||||
<xi:include href="netstat/netstat.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="ping">
|
|
||||||
<xi:include href="ping/ping.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="route">
|
|
||||||
<xi:include href="route/route.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="telnet">
|
|
||||||
<xi:include href="telnet/telnet.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="tracert">
|
|
||||||
<xi:include href="tracert/tracert.xml" />
|
|
||||||
</directory>
|
|
||||||
<directory name="whois">
|
|
||||||
<xi:include href="whois/whois.xml" />
|
|
||||||
</directory>
|
|
@@ -50,10 +50,21 @@ static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 6/4/93";
|
|||||||
extern char *__progname; /* Program name, from crt0. */
|
extern char *__progname; /* Program name, from crt0. */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
#ifdef __STDC__
|
||||||
err(int eval, const char *fmt, ...)
|
err(int eval, const char *fmt, ...)
|
||||||
|
#else
|
||||||
|
err(eval, fmt, va_alist)
|
||||||
|
int eval;
|
||||||
|
const char *fmt;
|
||||||
|
va_dcl
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
#if __STDC__
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
#else
|
||||||
|
va_start(ap);
|
||||||
|
#endif
|
||||||
verr(eval, fmt, ap);
|
verr(eval, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
@@ -74,10 +85,21 @@ verr(int eval, const char *fmt, va_list ap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
#if __STDC__
|
||||||
errx(int eval, const char *fmt, ...)
|
errx(int eval, const char *fmt, ...)
|
||||||
|
#else
|
||||||
|
errx(eval, fmt, va_alist)
|
||||||
|
int eval;
|
||||||
|
const char *fmt;
|
||||||
|
va_dcl
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
#if __STDC__
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
#else
|
||||||
|
va_start(ap);
|
||||||
|
#endif
|
||||||
verrx(eval, fmt, ap);
|
verrx(eval, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
@@ -93,10 +115,20 @@ verrx(int eval, const char *fmt, va_list ap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
#if __STDC__
|
||||||
warn(const char *fmt, ...)
|
warn(const char *fmt, ...)
|
||||||
|
#else
|
||||||
|
warn(fmt, va_alist)
|
||||||
|
const char *fmt;
|
||||||
|
va_dcl
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
#if __STDC__
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
#else
|
||||||
|
va_start(ap);
|
||||||
|
#endif
|
||||||
vwarn(fmt, ap);
|
vwarn(fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
@@ -118,10 +150,20 @@ vwarn(fmt, ap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
#ifdef __STDC__
|
||||||
warnx(const char *fmt, ...)
|
warnx(const char *fmt, ...)
|
||||||
|
#else
|
||||||
|
warnx(fmt, va_alist)
|
||||||
|
const char *fmt;
|
||||||
|
va_dcl
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
#ifdef __STDC__
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
#else
|
||||||
|
va_start(ap);
|
||||||
|
#endif
|
||||||
vwarnx(fmt, ap);
|
vwarnx(fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
@@ -41,6 +41,16 @@
|
|||||||
* Had to remove local handling. Otherwise, same as whois.
|
* Had to remove local handling. Otherwise, same as whois.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef lint
|
||||||
|
static char copyright[] =
|
||||||
|
"@(#) Copyright (c) 1989, 1993\n\
|
||||||
|
The Regents of the University of California. All rights reserved.\n";
|
||||||
|
#endif /* not lint */
|
||||||
|
|
||||||
|
#ifndef lint
|
||||||
|
static char sccsid[] = "@(#)finger.c 8.5 (Berkeley) 5/4/95";
|
||||||
|
#endif /* not lint */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Finger prints out information about users. It is not portable since
|
* Finger prints out information about users. It is not portable since
|
||||||
* certain fields (e.g. the full user name, office, and phone numbers) are
|
* certain fields (e.g. the full user name, office, and phone numbers) are
|
||||||
@@ -62,6 +72,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include "unistd.h"
|
||||||
|
|
||||||
#include "various.h"
|
#include "various.h"
|
||||||
#include "getopt.h"
|
#include "getopt.h"
|
||||||
@@ -73,6 +84,7 @@ int lflag, mflag, pplan, sflag;
|
|||||||
|
|
||||||
static void userlist(int, char **);
|
static void userlist(int, char **);
|
||||||
void usage();
|
void usage();
|
||||||
|
void netfinger(char *);
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
@@ -149,10 +161,10 @@ userlist(int argc, char **argv)
|
|||||||
fprintf(stderr, "Warning: Can't do local finger\n");
|
fprintf(stderr, "Warning: Can't do local finger\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Start winsock */
|
/* Start winsock */
|
||||||
wVersionRequested = MAKEWORD( 1, 1 );
|
wVersionRequested = MAKEWORD( 1, 1 );
|
||||||
iErr = WSAStartup( wVersionRequested, &wsaData );
|
iErr = WSAStartup( wVersionRequested, &wsaData );
|
||||||
if ( iErr != 0 )
|
if ( iErr != 0 )
|
||||||
{
|
{
|
||||||
/* Tell the user that we couldn't find a usable */
|
/* Tell the user that we couldn't find a usable */
|
||||||
/* WinSock DLL. */
|
/* WinSock DLL. */
|
||||||
|
@@ -1,12 +0,0 @@
|
|||||||
<module name="finger" type="win32cui" installbase="system32" installname="finger.exe">
|
|
||||||
<include base="finger">.</include>
|
|
||||||
<define name="__USE_W32API" />
|
|
||||||
<define name="__USE_W32_SOCKETS" />
|
|
||||||
<library>kernel32</library>
|
|
||||||
<library>ws2_32</library>
|
|
||||||
<file>finger.c</file>
|
|
||||||
<file>err.c</file>
|
|
||||||
<file>getopt.c</file>
|
|
||||||
<file>net.c</file>
|
|
||||||
<file>finger.rc</file>
|
|
||||||
</module>
|
|
@@ -42,15 +42,13 @@ static char sccsid[] = "@(#)getopt.c 4.13 (Berkeley) 2/23/91";
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "getopt.h"
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get option letter from argument vector
|
* get option letter from argument vector
|
||||||
*/
|
*/
|
||||||
int opterr = 1, /* if error message should be printed */
|
int opterr = 1, /* if error message should be printed */
|
||||||
optind = 1, /* index into parent argv vector */
|
optind = 1, /* index into parent argv vector */
|
||||||
optopt; /* character checked for validity */
|
optopt; /* character checked for validity */
|
||||||
const char *optarg; /* argument associated with option */
|
char *optarg; /* argument associated with option */
|
||||||
|
|
||||||
#define BADCH (int)'?'
|
#define BADCH (int)'?'
|
||||||
#define EMSG ""
|
#define EMSG ""
|
||||||
@@ -58,7 +56,7 @@ const char *optarg; /* argument associated with option */
|
|||||||
int
|
int
|
||||||
getopt(int nargc, char * const *nargv, const char *ostr)
|
getopt(int nargc, char * const *nargv, const char *ostr)
|
||||||
{
|
{
|
||||||
static const char *place = EMSG; /* option letter processing */
|
static char *place = EMSG; /* option letter processing */
|
||||||
register char *oli; /* option letter list index */
|
register char *oli; /* option letter list index */
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/* getopt.h */
|
/* getopt.h */
|
||||||
|
|
||||||
extern const char *optarg;
|
extern char *optarg;
|
||||||
extern int optind;
|
extern int optind;
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user