Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
April 2021
- 70 participants
- 697 discussions
[tools 1/2] winetest/build-patterns: Use color gradients for the failures.
by Francois Gouget 28 Apr '21
by Francois Gouget 28 Apr '21
28 Apr '21
This makes it possible to identify when the failure count changes, such
as when a patch adds two new failures to a test that already had five,
or when the failure count depending on the test configuration.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
The pattern page will automatically be updated when the next report
arrives.
Maybe there's a way to tweak the gradients to get more contrasting
colors. In particular the blue / green yellow are sometimes hard to
distinguish. But I'm not much of a color guy so I'll leave that to
someone else. Of course another approach is to have fewer failure modes
;-)
---
winetest/build-patterns | 116 +++++++++++++++++++++++++++++++---------
winetest/report.css | 4 +-
2 files changed, 93 insertions(+), 27 deletions(-)
diff --git a/winetest/build-patterns b/winetest/build-patterns
index f470c266f..9dc25816f 100755
--- a/winetest/build-patterns
+++ b/winetest/build-patterns
@@ -247,6 +247,9 @@ my %reports;
# - name
# The uniquely identifying test name in the form 'module:unit'.
#
+# - colors
+# A hashtable of colors indexed by failure count.
+#
# - testreports
# A hashtable mapping report directory names to objects storing the results
# for that test and report combination. Each testreport object has the
@@ -421,44 +424,101 @@ foreach my $testname (keys %tests)
}
+#
+# Compute color gradients
+#
+
+sub color2html($)
+{
+ my ($c) = @_;
+ return sprintf "#%02x%02x%02x", $c->[0], $c->[1], $c->[2];
+}
+
+sub blend($$$)
+{
+ my ($p, $start, $end) = @_;
+ my $r = [int($start->[0] * (1 - $p) + $end->[0] * $p + 0.5),
+ int($start->[1] * (1 - $p) + $end->[1] * $p + 0.5),
+ int($start->[2] * (1 - $p) + $end->[2] * $p + 0.5)];
+ return $r;
+}
+
+my @keycolors = ([0, 255, 255], # cyan
+ [0, 255, 0], # green
+ [255, 255, 0], # yellow
+ [255, 0, 0], # red
+);
+
+# Use colors to differentiate the set values. Each unique value is assigned
+# a color (in HTML format) picked along a series of gradients passing by the
+# colors defined in @keycolors.
+sub compute_set_colors($)
+{
+ my ($set) = @_;
+ my @values = sort { $a <=> $b } keys %$set;
+ my $count = @values;
+ if ($count == 1)
+ {
+ $set->{$values[0]} = color2html($keycolors[0]);
+ }
+ else
+ {
+ my $k = 0;
+ my ($start, $end) = (-1, 0);
+ for (0..$count-1)
+ {
+ while (!$end or $_ > $end)
+ {
+ $k++;
+ $start = $end;
+ $end = ($count-1) * $k / (@keycolors-1);
+ }
+ $set->{$values[$_]} = color2html(blend(($_-$start)/($end-$start),
+ $keycolors[$k-1],
+ $keycolors[$k]));
+ }
+ }
+}
+
+
#
# Write the failure patterns page for the given set of reports
#
my %status2html = (
# Dll information status values
- # <status> => [ <symbol>, <class-char>, <title>, <link> ]
- "missing" => ["n", "n", "not run for an unknown reason", "report"],
- "missingdll" => ["m", "m", "missing dll", "version"],
- "missingentrypoint" => ["e", "e", "missing entry point", "version"],
- "missingordinal" => ["o", "o", "missing ordinal", "version"],
- "missingsxs" => ["v", "v", "missing side-by-side dll version", "version"],
- "stub" => ["u", "u", "stub Windows dll", "version"],
- "native" => ["N", "N", "native Windows dll", "version"],
- "loaderror258" => ["I", "I", "timed out while getting the test list", "version"],
+ # <status> => [ <symbol>, <class-char>, <title>, <link>, <attrs> ]
+ "missing" => ["n", "n", "not run for an unknown reason", "report", ""],
+ "missingdll" => ["m", "m", "missing dll", "version", ""],
+ "missingentrypoint" => ["e", "e", "missing entry point", "version", ""],
+ "missingordinal" => ["o", "o", "missing ordinal", "version", ""],
+ "missingsxs" => ["v", "v", "missing side-by-side dll version", "version", ""],
+ "stub" => ["u", "u", "stub Windows dll", "version", ""],
+ "native" => ["N", "N", "native Windows dll", "version", ""],
+ "loaderror258" => ["I", "I", "timed out while getting the test list", "version", ""],
# Other status values
- "skipped" => ["-", "s", "skipped by user request", ""],
- "crash" => ["C", "C", "crash", "t"],
- "258" => ["T", "T", "timeout", "t"],
+ "skipped" => ["-", "s", "skipped by user request", "", ""],
+ "crash" => ["C", "C", "crash", "t", ""],
+ "258" => ["T", "T", "timeout", "t", ""],
);
-# Returns a tuple containing the symbol, CSS class, title and link type
-# for the specified status.
-sub get_status_html($)
+# Returns a tuple containing the symbol, CSS class, title, link type and
+# HTML attributes for the specified status.
+sub get_status_html($$)
{
- my ($status) = @_;
+ my ($status, $failcolors) = @_;
return @{$status2html{$status}} if ($status2html{$status});
if ($status =~ /^[0-9]+$/)
{
- return ("F", "F", "$status failures", "t");
+ return ("F", "F", "$status failures", "t", " style='background-color: $failcolors->{$status}'");
}
if ($status =~ /^loaderror(.*)$/)
{
- return ("L", "L", "got error $1 while getting the test list", "version");
+ return ("L", "L", "got error $1 while getting the test list", "version", "");
}
- return ("?", "", "unknown status $status", "report");
+ return ("?", "", "unknown status $status", "report", "");
}
sub write_patterns_list($$)
@@ -481,6 +541,8 @@ sub write_patterns_list($$)
print $html "</div></div>\n";
+ compute_set_colors($test->{colors});
+
print $html "<div class='test'>\n";
foreach my $reportdir (@sortedreports)
{
@@ -519,7 +581,7 @@ sub write_patterns_list($$)
}
else
{
- ($symbol, $class, $title, my $link) = get_status_html($status);
+ ($symbol, $class, $title, my $link, $attrs) = get_status_html($status, $test->{colors});
if ($link eq "t")
{
$tag = "a";
@@ -606,17 +668,23 @@ EOF
# Build a list of test units that will appear on this page so we can
# link them to each other.
my $testnames = [];
- unit: foreach my $testname (sort keys %tests)
+ foreach my $testname (sort keys %tests)
{
my $test = $tests{$testname};
+ my $addtest;
foreach my $testreport (values %{$test->{testreports}})
{
- if ($testreport->{failed})
+ next if (!$testreport->{failed});
+ $addtest = 1;
+
+ foreach my $status (values %{$testreport->{status}})
{
- push @$testnames, $testname;
- next unit;
+ next if ($status !~ /^[0-9]+$/);
+ next if ($status eq "258"); # timeouts have their own color
+ $test->{colors}->{$status} = undef;
}
}
+ push @$testnames, $testname if ($addtest);
}
print $html "<h2>$title</h2>\n";
diff --git a/winetest/report.css b/winetest/report.css
index cca1ba986..2cc466304 100644
--- a/winetest/report.css
+++ b/winetest/report.css
@@ -89,9 +89,7 @@ div.pattern :hover { color: black; text-decoration: underline; }
.patC { /* crash */
background-color: #ff5555;
}
-.patF { /* failure(s) */
- background-color: #ff0000;
-}
+/* .patF failure(s) */
/* .patn not run for an unknown reason */
/* .patm missing dll */
.pate { /* missing entrypoint */
--
2.20.1
1
1
28 Apr '21
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
---
programs/reg/tests/copy.c | 32 +++++++++++++++-----------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/programs/reg/tests/copy.c b/programs/reg/tests/copy.c
index a8956d7e9a0..31223a3d314 100644
--- a/programs/reg/tests/copy.c
+++ b/programs/reg/tests/copy.c
@@ -18,15 +18,12 @@
#include "reg_test.h"
-#define COPY_DEST KEY_WINE "\\reg_copy"
+#define COPY_SRC KEY_WINE "\\reg_copy"
-static void test_copy(void)
+static void test_command_syntax(void)
{
DWORD r;
- delete_tree(HKEY_CURRENT_USER, KEY_BASE);
- verify_key_nonexist(HKEY_CURRENT_USER, KEY_BASE);
-
run_reg_exe("reg copy", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
@@ -63,37 +60,38 @@ static void test_copy(void)
run_reg_exe("reg copy /f /s", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " /f", &r);
+ run_reg_exe("reg copy HKCU\\" COPY_SRC " /f", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " foo /f", &r);
+ run_reg_exe("reg copy HKCU\\" COPY_SRC " foo /f", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg copy /f HKEY_CURRENT_USER\\" KEY_BASE " HKEY_CURRENT_USER\\" KEY_BASE, &r);
+ run_reg_exe("reg copy /f HKCU\\" COPY_SRC " HKCU\\" KEY_BASE, &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg copy /f HKEY_CURRENT_USER\\" KEY_BASE " HKEY_CURRENT_USER\\" COPY_DEST, &r);
+ run_reg_exe("reg copy HKCU\\" COPY_SRC " /f HKCU\\" KEY_BASE, &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " /f HKEY_CURRENT_USER\\" COPY_DEST, &r);
+ run_reg_exe("reg copy HKCU\\" COPY_SRC " /s HKCU\\" KEY_BASE, &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " /s HKEY_CURRENT_USER\\" COPY_DEST, &r);
+ run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /a", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " HKEY_CURRENT_USER\\" COPY_DEST " /a", &r);
+ run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" KEY_BASE " /f /a", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " HKEY_CURRENT_USER\\" COPY_DEST " /f /a", &r);
+ run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " HKEY_CURRENT_USER\\" KEY_BASE, &r);
+ /* Source and destination keys are the same */
+ run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" COPY_SRC, &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " HKEY_CURRENT_USER\\" KEY_BASE " /f", &r);
+ run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" COPY_SRC " /f", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
- run_reg_exe("reg copy HKEY_CURRENT_USER\\" KEY_BASE " HKEY_CURRENT_USER\\" KEY_BASE " /s /f", &r);
+ run_reg_exe("reg copy HKCU\\" COPY_SRC " HKCU\\" COPY_SRC " /s /f", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
}
@@ -106,5 +104,5 @@ START_TEST(copy)
return;
}
- test_copy();
+ test_command_syntax();
}
--
2.31.1
1
0
[tools] winetest/build-index: Link the test unit pages to the failure patterns.
by Francois Gouget 28 Apr '21
by Francois Gouget 28 Apr '21
28 Apr '21
Only for the test units that have failures in any of the buids /
platforms since there is no pattern in case of success.
Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com>
---
The test pages will automatically be updated when the next report
arrives.
---
winetest/build-index | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/winetest/build-index b/winetest/build-index
index 7eacb87f9..6a3356a25 100755
--- a/winetest/build-index
+++ b/winetest/build-index
@@ -259,6 +259,7 @@ foreach my $build (@too_old)
#
my %alltests = ();
+my %haspattern = ();
foreach my $build (@builds)
{
@@ -268,6 +269,10 @@ foreach my $build (@builds)
chomp;
my ($test, $group, $cell) = split / +/, $_, 3;
$alltests{$test}->{$build->{name}}->{$group} = $cell;
+ if (!$haspattern{$test} and $cell =~ /result (?:fail|mixed)/)
+ {
+ $haspattern{$test} = 1;
+ }
}
close SUM;
}
@@ -294,6 +299,8 @@ foreach my $test (keys %alltests)
{
my $filename = "data/tests/$test.html";
open OUT, ">", "$filename.new" or die "could not open '$filename.new' for writing: $!";
+
+ my $title_link = $haspattern{$test} ? " | <a href=\"/data/patterns.html#$test\">failure patterns</a>" : "";
print OUT <<EOF;
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
@@ -312,7 +319,7 @@ EOF
| <a href="..">index</a>
</div>
<div class="main">
-<h2>$test test runs</h2>
+<h2>$test test runs$title_link</h2>
<table class="report">
<thead>
<tr><th class="test">Build</th><th class="test">Date</th>
--
2.20.1
1
0
Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com>
---
programs/reg/add.c | 18 +++++++++---------
programs/reg/delete.c | 16 ++++++++--------
programs/reg/export.c | 8 ++++----
programs/reg/query.c | 26 +++++++++++++-------------
4 files changed, 34 insertions(+), 34 deletions(-)
diff --git a/programs/reg/add.c b/programs/reg/add.c
index de22874b901..ff209bfc0ff 100644
--- a/programs/reg/add.c
+++ b/programs/reg/add.c
@@ -152,10 +152,10 @@ static LPBYTE get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator, DW
static int run_add(HKEY root, WCHAR *path, WCHAR *value_name, BOOL value_empty,
WCHAR *type, WCHAR separator, WCHAR *data, BOOL force)
{
- HKEY key;
+ HKEY hkey;
if (RegCreateKeyExW(root, path, 0, NULL, REG_OPTION_NON_VOLATILE,
- KEY_READ|KEY_WRITE, NULL, &key, NULL))
+ KEY_READ|KEY_WRITE, NULL, &hkey, NULL))
{
output_message(STRING_INVALID_KEY);
return 1;
@@ -169,11 +169,11 @@ static int run_add(HKEY root, WCHAR *path, WCHAR *value_name, BOOL value_empty,
if (!force)
{
- if (RegQueryValueExW(key, value_name, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
+ if (RegQueryValueExW(hkey, value_name, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
{
if (!ask_confirm(STRING_OVERWRITE_VALUE, value_name))
{
- RegCloseKey(key);
+ RegCloseKey(hkey);
output_message(STRING_CANCELLED);
return 0;
}
@@ -183,28 +183,28 @@ static int run_add(HKEY root, WCHAR *path, WCHAR *value_name, BOOL value_empty,
reg_type = wchar_get_type(type);
if (reg_type == ~0u)
{
- RegCloseKey(key);
+ RegCloseKey(hkey);
output_message(STRING_UNSUPPORTED_TYPE, type);
return 1;
}
if ((reg_type == REG_DWORD || reg_type == REG_DWORD_BIG_ENDIAN) && !data)
{
- RegCloseKey(key);
+ RegCloseKey(hkey);
output_message(STRING_INVALID_CMDLINE);
return 1;
}
if (!(reg_data = get_regdata(data, reg_type, separator, ®_count)))
{
- RegCloseKey(key);
+ RegCloseKey(hkey);
return 1;
}
- RegSetValueExW(key, value_name, 0, reg_type, reg_data, reg_count);
+ RegSetValueExW(hkey, value_name, 0, reg_type, reg_data, reg_count);
free(reg_data);
}
- RegCloseKey(key);
+ RegCloseKey(hkey);
output_message(STRING_SUCCESS);
return 0;
diff --git a/programs/reg/delete.c b/programs/reg/delete.c
index db1ed0f5337..f8e62e490b9 100644
--- a/programs/reg/delete.c
+++ b/programs/reg/delete.c
@@ -21,7 +21,7 @@
static int run_delete(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name,
BOOL value_empty, BOOL value_all, BOOL force)
{
- HKEY key;
+ HKEY hkey;
if (!force)
{
@@ -53,7 +53,7 @@ static int run_delete(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name
return 0;
}
- if (RegOpenKeyExW(root, path, 0, KEY_READ|KEY_SET_VALUE, &key))
+ if (RegOpenKeyExW(root, path, 0, KEY_READ|KEY_SET_VALUE, &hkey))
{
output_message(STRING_KEY_NONEXIST);
return 1;
@@ -70,14 +70,14 @@ static int run_delete(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name
while (1)
{
value_len = max_value_len;
- rc = RegEnumValueW(key, 0, value_name, &value_len, NULL, NULL, NULL, NULL);
+ rc = RegEnumValueW(hkey, 0, value_name, &value_len, NULL, NULL, NULL, NULL);
if (rc == ERROR_SUCCESS)
{
- rc = RegDeleteValueW(key, value_name);
+ rc = RegDeleteValueW(hkey, value_name);
if (rc != ERROR_SUCCESS)
{
free(value_name);
- RegCloseKey(key);
+ RegCloseKey(hkey);
output_message(STRING_VALUEALL_FAILED, key_name);
return 1;
}
@@ -93,15 +93,15 @@ static int run_delete(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name
}
else if (value_name || value_empty)
{
- if (RegDeleteValueW(key, value_name))
+ if (RegDeleteValueW(hkey, value_name))
{
- RegCloseKey(key);
+ RegCloseKey(hkey);
output_message(STRING_VALUE_NONEXIST);
return 1;
}
}
- RegCloseKey(key);
+ RegCloseKey(hkey);
output_message(STRING_SUCCESS);
return 0;
}
diff --git a/programs/reg/export.c b/programs/reg/export.c
index 78331498406..79f6997ce35 100644
--- a/programs/reg/export.c
+++ b/programs/reg/export.c
@@ -225,7 +225,7 @@ static void export_key_name(HANDLE hFile, WCHAR *name)
free(buf);
}
-static int export_registry_data(HANDLE hFile, HKEY key, WCHAR *path)
+static int export_registry_data(HANDLE hFile, HKEY hkey, WCHAR *path)
{
LONG rc;
DWORD max_value_len = 256, value_len;
@@ -246,7 +246,7 @@ static int export_registry_data(HANDLE hFile, HKEY key, WCHAR *path)
{
value_len = max_value_len;
data_size = max_data_bytes;
- rc = RegEnumValueW(key, i, value_name, &value_len, NULL, &type, data, &data_size);
+ rc = RegEnumValueW(hkey, i, value_name, &value_len, NULL, &type, data, &data_size);
if (rc == ERROR_SUCCESS)
{
@@ -280,11 +280,11 @@ static int export_registry_data(HANDLE hFile, HKEY key, WCHAR *path)
for (;;)
{
subkey_len = MAX_SUBKEY_LEN;
- rc = RegEnumKeyExW(key, i, subkey_name, &subkey_len, NULL, NULL, NULL, NULL);
+ rc = RegEnumKeyExW(hkey, i, subkey_name, &subkey_len, NULL, NULL, NULL, NULL);
if (rc == ERROR_SUCCESS)
{
subkey_path = build_subkey_path(path, path_len, subkey_name, subkey_len);
- if (!RegOpenKeyExW(key, subkey_name, 0, KEY_READ, &subkey))
+ if (!RegOpenKeyExW(hkey, subkey_name, 0, KEY_READ, &subkey))
{
export_registry_data(hFile, subkey, subkey_path);
RegCloseKey(subkey);
diff --git a/programs/reg/query.c b/programs/reg/query.c
index 9d840c8947d..6485d36db6f 100644
--- a/programs/reg/query.c
+++ b/programs/reg/query.c
@@ -133,7 +133,7 @@ static void output_value(const WCHAR *value_name, DWORD type, BYTE *data, DWORD
static unsigned int num_values_found = 0;
-static int query_value(HKEY key, WCHAR *value_name, WCHAR *path, BOOL recurse)
+static int query_value(HKEY hkey, WCHAR *value_name, WCHAR *path, BOOL recurse)
{
LONG rc;
DWORD max_data_bytes = 2048, data_size;
@@ -149,7 +149,7 @@ static int query_value(HKEY key, WCHAR *value_name, WCHAR *path, BOOL recurse)
for (;;)
{
data_size = max_data_bytes;
- rc = RegQueryValueExW(key, value_name, NULL, &type, data, &data_size);
+ rc = RegQueryValueExW(hkey, value_name, NULL, &type, data, &data_size);
if (rc == ERROR_MORE_DATA)
{
max_data_bytes = data_size;
@@ -191,11 +191,11 @@ static int query_value(HKEY key, WCHAR *value_name, WCHAR *path, BOOL recurse)
for (;;)
{
subkey_len = MAX_SUBKEY_LEN;
- rc = RegEnumKeyExW(key, i, subkey_name, &subkey_len, NULL, NULL, NULL, NULL);
+ rc = RegEnumKeyExW(hkey, i, subkey_name, &subkey_len, NULL, NULL, NULL, NULL);
if (rc == ERROR_SUCCESS)
{
subkey_path = build_subkey_path(path, path_len, subkey_name, subkey_len);
- if (!RegOpenKeyExW(key, subkey_name, 0, KEY_READ, &subkey))
+ if (!RegOpenKeyExW(hkey, subkey_name, 0, KEY_READ, &subkey))
{
query_value(subkey, value_name, subkey_path, recurse);
RegCloseKey(subkey);
@@ -210,7 +210,7 @@ static int query_value(HKEY key, WCHAR *value_name, WCHAR *path, BOOL recurse)
return 0;
}
-static int query_all(HKEY key, WCHAR *path, BOOL recurse)
+static int query_all(HKEY hkey, WCHAR *path, BOOL recurse)
{
LONG rc;
DWORD max_value_len = 256, value_len;
@@ -231,7 +231,7 @@ static int query_all(HKEY key, WCHAR *path, BOOL recurse)
{
value_len = max_value_len;
data_size = max_data_bytes;
- rc = RegEnumValueW(key, i, value_name, &value_len, NULL, &type, data, &data_size);
+ rc = RegEnumValueW(hkey, i, value_name, &value_len, NULL, &type, data, &data_size);
if (rc == ERROR_SUCCESS)
{
output_value(value_name, type, data, data_size);
@@ -267,13 +267,13 @@ static int query_all(HKEY key, WCHAR *path, BOOL recurse)
for (;;)
{
subkey_len = MAX_SUBKEY_LEN;
- rc = RegEnumKeyExW(key, i, subkey_name, &subkey_len, NULL, NULL, NULL, NULL);
+ rc = RegEnumKeyExW(hkey, i, subkey_name, &subkey_len, NULL, NULL, NULL, NULL);
if (rc == ERROR_SUCCESS)
{
if (recurse)
{
subkey_path = build_subkey_path(path, path_len, subkey_name, subkey_len);
- if (!RegOpenKeyExW(key, subkey_name, 0, KEY_READ, &subkey))
+ if (!RegOpenKeyExW(hkey, subkey_name, 0, KEY_READ, &subkey))
{
query_all(subkey, subkey_path, recurse);
RegCloseKey(subkey);
@@ -297,10 +297,10 @@ static int query_all(HKEY key, WCHAR *path, BOOL recurse)
static int run_query(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name,
BOOL value_empty, BOOL recurse)
{
- HKEY key;
+ HKEY hkey;
int ret;
- if (RegOpenKeyExW(root, path, 0, KEY_READ, &key) != ERROR_SUCCESS)
+ if (RegOpenKeyExW(root, path, 0, KEY_READ, &hkey) != ERROR_SUCCESS)
{
output_message(STRING_KEY_NONEXIST);
return 1;
@@ -310,14 +310,14 @@ static int run_query(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name,
if (value_name || value_empty)
{
- ret = query_value(key, value_name, key_name, recurse);
+ ret = query_value(hkey, value_name, key_name, recurse);
if (recurse)
output_message(STRING_MATCHES_FOUND, num_values_found);
}
else
- ret = query_all(key, key_name, recurse);
+ ret = query_all(hkey, key_name, recurse);
- RegCloseKey(key);
+ RegCloseKey(hkey);
return ret;
}
--
2.31.1
1
4
1
0
27 Apr '21
From: Jan Sikorski <jsikorski(a)codeweavers.com>
Signed-off-by: Jan Sikorski <jsikorski(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d3d10core/tests/d3d10core.c | 86 ++++++++++++++++++++++++++++++++
1 file changed, 86 insertions(+)
diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c
index 927d79d90e9..ccddb401aed 100644
--- a/dlls/d3d10core/tests/d3d10core.c
+++ b/dlls/d3d10core/tests/d3d10core.c
@@ -18822,6 +18822,91 @@ static void test_dual_source_blend(void)
release_test_context(&test_context);
}
+static void test_unbound_streams(void)
+{
+ struct d3d10core_test_context test_context;
+ ID3D10PixelShader *ps;
+ ID3D10Device *device;
+ HRESULT hr;
+
+ static const DWORD vs_code[] =
+ {
+#if 0
+ struct vs_ps
+ {
+ float4 position : SV_POSITION;
+ float4 color : COLOR0;
+ };
+
+ vs_ps vs_main(float4 position : POSITION, float4 color : COLOR0)
+ {
+ vs_ps result;
+ result.position = position;
+ result.color = color;
+ result.color.w = 1.0;
+ return result;
+ }
+#endif
+ 0x43425844, 0x4a9efaec, 0xe2c6cdf5, 0x15dd28a7, 0xae68e320, 0x00000001, 0x00000154, 0x00000003,
+ 0x0000002c, 0x0000007c, 0x000000d0, 0x4e475349, 0x00000048, 0x00000002, 0x00000008, 0x00000038,
+ 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000041, 0x00000000, 0x00000000,
+ 0x00000003, 0x00000001, 0x0000070f, 0x49534f50, 0x4e4f4954, 0x4c4f4300, 0xab00524f, 0x4e47534f,
+ 0x0000004c, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000,
+ 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, 0x505f5653,
+ 0x5449534f, 0x004e4f49, 0x4f4c4f43, 0xabab0052, 0x52444853, 0x0000007c, 0x00010040, 0x0000001f,
+ 0x0300005f, 0x001010f2, 0x00000000, 0x0300005f, 0x00101072, 0x00000001, 0x04000067, 0x001020f2,
+ 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000001, 0x05000036, 0x001020f2, 0x00000000,
+ 0x00101e46, 0x00000000, 0x05000036, 0x00102072, 0x00000001, 0x00101246, 0x00000001, 0x05000036,
+ 0x00102082, 0x00000001, 0x00004001, 0x3f800000, 0x0100003e,
+ };
+
+ static const DWORD ps_code[] =
+ {
+#if 0
+ float4 ps_main(vs_ps input) : SV_TARGET
+ {
+ return input.color;
+ }
+#endif
+ 0x43425844, 0xe2087fa6, 0xa35fbd95, 0x8e585b3f, 0x67890f54, 0x00000001, 0x000000f4, 0x00000003,
+ 0x0000002c, 0x00000080, 0x000000b4, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038,
+ 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000,
+ 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4f4c4f43, 0xabab0052,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x00000038, 0x00000040,
+ 0x0000000e, 0x03001062, 0x001010f2, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x05000036,
+ 0x001020f2, 0x00000000, 0x00101e46, 0x00000001, 0x0100003e,
+ };
+
+ static const float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
+
+ static const D3D10_INPUT_ELEMENT_DESC layout_desc[] =
+ {
+ {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0},
+ {"COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 16, D3D10_INPUT_PER_VERTEX_DATA, 0},
+ };
+
+ if (!init_test_context(&test_context))
+ return;
+
+ device = test_context.device;
+
+ hr = ID3D10Device_CreatePixelShader(device, ps_code, sizeof(ps_code), &ps);
+ ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr);
+
+ hr = ID3D10Device_CreateInputLayout(device, layout_desc, ARRAY_SIZE(layout_desc),
+ vs_code, sizeof(vs_code), &test_context.input_layout);
+ ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr);
+
+ ID3D10Device_PSSetShader(device, ps);
+ ID3D10Device_ClearRenderTargetView(device, test_context.backbuffer_rtv, white);
+ draw_quad_vs(&test_context, vs_code, sizeof(vs_code));
+ check_texture_color(test_context.backbuffer, 0xff000000, 1);
+
+ ID3D10PixelShader_Release(ps);
+ release_test_context(&test_context);
+}
+
START_TEST(d3d10core)
{
unsigned int argc, i;
@@ -18946,6 +19031,7 @@ START_TEST(d3d10core)
queue_test(test_color_mask);
queue_test(test_independent_blend);
queue_test(test_dual_source_blend);
+ queue_test(test_unbound_streams);
run_queued_tests();
--
2.20.1
2
1
27 Apr '21
From: Jan Sikorski <jsikorski(a)codeweavers.com>
Signed-off-by: Jan Sikorski <jsikorski(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d3d11/tests/d3d11.c | 88 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 88 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index bf8837ab52c..ca60170d080 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -17157,6 +17157,93 @@ static void test_shader_stage_input_output_matching(void)
release_test_context(&test_context);
}
+static void test_unbound_streams(void)
+{
+ struct d3d11_test_context test_context;
+ ID3D11DeviceContext *context;
+ ID3D11PixelShader *ps;
+ ID3D11Device *device;
+ HRESULT hr;
+
+ static const DWORD vs_code[] =
+ {
+#if 0
+ struct vs_ps
+ {
+ float4 position : SV_POSITION;
+ float4 color : COLOR0;
+ };
+
+ vs_ps vs_main(float4 position : POSITION, float4 color : COLOR0)
+ {
+ vs_ps result;
+ result.position = position;
+ result.color = color;
+ result.color.w = 1.0;
+ return result;
+ }
+#endif
+ 0x43425844, 0x4a9efaec, 0xe2c6cdf5, 0x15dd28a7, 0xae68e320, 0x00000001, 0x00000154, 0x00000003,
+ 0x0000002c, 0x0000007c, 0x000000d0, 0x4e475349, 0x00000048, 0x00000002, 0x00000008, 0x00000038,
+ 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000041, 0x00000000, 0x00000000,
+ 0x00000003, 0x00000001, 0x0000070f, 0x49534f50, 0x4e4f4954, 0x4c4f4300, 0xab00524f, 0x4e47534f,
+ 0x0000004c, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, 0x00000003, 0x00000000,
+ 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, 0x0000000f, 0x505f5653,
+ 0x5449534f, 0x004e4f49, 0x4f4c4f43, 0xabab0052, 0x52444853, 0x0000007c, 0x00010040, 0x0000001f,
+ 0x0300005f, 0x001010f2, 0x00000000, 0x0300005f, 0x00101072, 0x00000001, 0x04000067, 0x001020f2,
+ 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000001, 0x05000036, 0x001020f2, 0x00000000,
+ 0x00101e46, 0x00000000, 0x05000036, 0x00102072, 0x00000001, 0x00101246, 0x00000001, 0x05000036,
+ 0x00102082, 0x00000001, 0x00004001, 0x3f800000, 0x0100003e,
+ };
+
+ static const DWORD ps_code[] =
+ {
+#if 0
+ float4 ps_main(vs_ps input) : SV_TARGET
+ {
+ return input.color;
+ }
+#endif
+ 0x43425844, 0xe2087fa6, 0xa35fbd95, 0x8e585b3f, 0x67890f54, 0x00000001, 0x000000f4, 0x00000003,
+ 0x0000002c, 0x00000080, 0x000000b4, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038,
+ 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000,
+ 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4f4c4f43, 0xabab0052,
+ 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003,
+ 0x00000000, 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x00000038, 0x00000040,
+ 0x0000000e, 0x03001062, 0x001010f2, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x05000036,
+ 0x001020f2, 0x00000000, 0x00101e46, 0x00000001, 0x0100003e,
+ };
+
+ static const float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
+
+ static const D3D11_INPUT_ELEMENT_DESC layout_desc[] =
+ {
+ {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0},
+ {"COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 16, D3D11_INPUT_PER_VERTEX_DATA, 0},
+ };
+
+ if (!init_test_context(&test_context, NULL))
+ return;
+
+ device = test_context.device;
+ context = test_context.immediate_context;
+
+ hr = ID3D11Device_CreatePixelShader(device, ps_code, sizeof(ps_code), NULL, &ps);
+ ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr);
+
+ hr = ID3D11Device_CreateInputLayout(device, layout_desc, ARRAY_SIZE(layout_desc),
+ vs_code, sizeof(vs_code), &test_context.input_layout);
+ ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr);
+
+ ID3D11DeviceContext_PSSetShader(context, ps, NULL, 0);
+ ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, white);
+ draw_quad_vs(&test_context, vs_code, sizeof(vs_code));
+ check_texture_color(test_context.backbuffer, 0xff000000, 1);
+
+ ID3D11PixelShader_Release(ps);
+ release_test_context(&test_context);
+}
+
static void test_shader_interstage_interface(void)
{
struct d3d11_test_context test_context;
@@ -32520,6 +32607,7 @@ START_TEST(d3d11)
queue_test(test_deferred_context_state);
queue_test(test_deferred_context_swap_state);
queue_test(test_deferred_context_rendering);
+ queue_test(test_unbound_streams);
run_queued_tests();
}
--
2.20.1
2
1
[PATCH 1/3] wined3d: Create null vertex bindings and attributes for unbound shader inputs.
by Henri Verbeet 27 Apr '21
by Henri Verbeet 27 Apr '21
27 Apr '21
From: Jan Sikorski <jsikorski(a)codeweavers.com>
Signed-off-by: Jan Sikorski <jsikorski(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
Changes:
- Use unsigned bit-masks.
- Squash the first two patches in the series into this one.
- Minor style changes.
dlls/wined3d/context_vk.c | 84 ++++++++++++++++++++++++++++++++++++---
dlls/wined3d/device.c | 2 +-
2 files changed, 80 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c
index 8719d54644b..fbc1e294fcd 100644
--- a/dlls/wined3d/context_vk.c
+++ b/dlls/wined3d/context_vk.c
@@ -2004,19 +2004,36 @@ static void wined3d_context_vk_update_blend_state(const struct wined3d_context_v
}
}
+static VkFormat vk_format_from_component_type(enum wined3d_component_type component_type)
+{
+ switch (component_type)
+ {
+ case WINED3D_TYPE_UINT:
+ return VK_FORMAT_R32G32B32A32_UINT;
+ case WINED3D_TYPE_INT:
+ return VK_FORMAT_R32G32B32A32_SINT;
+ case WINED3D_TYPE_UNKNOWN:
+ case WINED3D_TYPE_FLOAT:
+ return VK_FORMAT_R32G32B32A32_SFLOAT;
+ }
+ return VK_FORMAT_UNDEFINED;
+}
+
static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_context_vk *context_vk,
- const struct wined3d_state *state, VkPipelineLayout vk_pipeline_layout)
+ const struct wined3d_state *state, VkPipelineLayout vk_pipeline_layout, uint32_t *null_buffer_binding)
{
unsigned int i, attribute_count, binding_count, divisor_count, stage_count;
const struct wined3d_d3d_info *d3d_info = context_vk->c.d3d_info;
struct wined3d_graphics_pipeline_key_vk *key;
VkPipelineShaderStageCreateInfo *stage;
struct wined3d_stream_info stream_info;
+ struct wined3d_shader *vertex_shader;
VkPrimitiveTopology vk_topology;
VkShaderModule module;
bool update = false;
uint32_t mask;
+ *null_buffer_binding = ~0u;
key = &context_vk->graphics.pipeline_key_vk;
if (context_vk->c.shader_update_mask & ~(1u << WINED3D_SHADER_TYPE_COMPUTE))
@@ -2041,14 +2058,15 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
|| wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_STREAMSRC)
|| wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_SHADER(WINED3D_SHADER_TYPE_VERTEX)))
{
+ VkVertexInputAttributeDescription *a;
+ VkVertexInputBindingDescription *b;
+
wined3d_stream_info_from_declaration(&stream_info, state, d3d_info);
divisor_count = 0;
for (i = 0, mask = 0, attribute_count = 0, binding_count = 0; i < ARRAY_SIZE(stream_info.elements); ++i)
{
VkVertexInputBindingDivisorDescriptionEXT *d;
struct wined3d_stream_info_element *e;
- VkVertexInputAttributeDescription *a;
- VkVertexInputBindingDescription *b;
uint32_t binding;
if (!(stream_info.use_map & (1u << i)))
@@ -2080,6 +2098,55 @@ static bool wined3d_context_vk_update_graphics_pipeline_key(struct wined3d_conte
}
}
+ vertex_shader = state->shader[WINED3D_SHADER_TYPE_VERTEX];
+ if (vertex_shader && (mask = ~stream_info.use_map & vertex_shader->reg_maps.input_registers))
+ {
+ struct wined3d_shader_signature_element *element;
+ struct wined3d_shader_signature *signature;
+ uint32_t null_binding, location;
+
+ for (i = 0; i < ARRAY_SIZE(state->streams); ++i)
+ {
+ if (!state->streams[i].buffer)
+ {
+ null_binding = i;
+ break;
+ }
+ }
+
+ if (i == ARRAY_SIZE(state->streams))
+ {
+ ERR("No streams left for a null buffer binding.\n");
+ }
+ else
+ {
+ signature = &vertex_shader->input_signature;
+ for (i = 0; i < signature->element_count; ++i)
+ {
+ element = &signature->elements[i];
+ location = element->register_idx;
+
+ if (!(mask & (1u << location)) || element->sysval_semantic)
+ continue;
+ mask &= ~(1u << location);
+
+ a = &key->attributes[attribute_count++];
+ a->location = location;
+ a->binding = null_binding;
+ a->format = vk_format_from_component_type(element->component_type);
+ a->offset = 0;
+ }
+
+ if (mask != (~stream_info.use_map & vertex_shader->reg_maps.input_registers))
+ {
+ b = &key->bindings[binding_count++];
+ *null_buffer_binding = b->binding = null_binding;
+ b->stride = 0;
+ b->inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
+ }
+ }
+ }
+
key->input_desc.pNext = NULL;
key->input_desc.vertexBindingDescriptionCount = binding_count;
key->input_desc.vertexAttributeDescriptionCount = attribute_count;
@@ -2991,6 +3058,7 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c
VkSampleCountFlagBits sample_count;
VkCommandBuffer vk_command_buffer;
struct wined3d_buffer *buffer;
+ uint32_t null_buffer_binding;
unsigned int i;
if (wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL))
@@ -3120,8 +3188,8 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c
return VK_NULL_HANDLE;
}
- if (wined3d_context_vk_update_graphics_pipeline_key(context_vk, state, context_vk->graphics.vk_pipeline_layout)
- || !context_vk->graphics.vk_pipeline)
+ if (wined3d_context_vk_update_graphics_pipeline_key(context_vk, state, context_vk->graphics.vk_pipeline_layout,
+ &null_buffer_binding) || !context_vk->graphics.vk_pipeline)
{
if (!(context_vk->graphics.vk_pipeline = wined3d_context_vk_get_graphics_pipeline(context_vk)))
{
@@ -3131,6 +3199,12 @@ VkCommandBuffer wined3d_context_vk_apply_draw_state(struct wined3d_context_vk *c
VK_CALL(vkCmdBindPipeline(vk_command_buffer,
VK_PIPELINE_BIND_POINT_GRAPHICS, context_vk->graphics.vk_pipeline));
+ if (null_buffer_binding != ~0u)
+ {
+ VkDeviceSize offset = 0;
+ VK_CALL(vkCmdBindVertexBuffers(vk_command_buffer, null_buffer_binding, 1,
+ &device_vk->null_resources_vk.buffer_info.buffer, &offset));
+ }
}
if (wined3d_context_is_graphics_state_dirty(&context_vk->c, STATE_STENCIL_REF) && dsv)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index bf4c37756a7..f3d7cff74bf 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -652,7 +652,7 @@ bool wined3d_device_vk_create_null_resources(struct wined3d_device_vk *device_vk
vk_info = context_vk->vk_info;
usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT
- | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT;
+ | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT;
memory_type = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
if (!wined3d_context_vk_create_bo(context_vk, 16, usage, memory_type, &r->bo))
return false;
--
2.20.1
1
0
27 Apr '21
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
---
dlls/ws2_32/socket.c | 2 +-
include/winsock.h | 139 +++----------
include/winsock2.h | 480 ++++++++++++++++++++++++++++++++++++++++++-
include/ws2def.h | 160 +++++++++++++++
server/sock.c | 28 +--
5 files changed, 661 insertions(+), 148 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 262171ebab0..29464fb94c9 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -905,7 +905,7 @@ static const int ws_proto_map[][2] =
MAP_OPTION( IPPROTO_ICMP ),
MAP_OPTION( IPPROTO_IGMP ),
MAP_OPTION( IPPROTO_RAW ),
- MAP_OPTION( IPPROTO_IPIP ),
+ {WS_IPPROTO_IPV4, IPPROTO_IPIP},
{FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO},
};
diff --git a/include/winsock.h b/include/winsock.h
index cafac1a1723..b8a7a4ec400 100644
--- a/include/winsock.h
+++ b/include/winsock.h
@@ -21,9 +21,7 @@
*/
#ifdef __WINESRC__
-# ifndef __WINE_WINSOCK2__
-# error Please use Winsock2 in Wine
-# endif
+# error Please use winsock2 in Wine
#endif
#ifndef __WINE_WINSOCKAPI_STDLIB_H
@@ -168,12 +166,7 @@ extern "C" {
#define AF_FIREFOX 19
#define AF_UNKNOWN1 20
#define AF_BAN 21
-#define AF_ATM 22
-#define AF_INET6 23
-#define AF_CLUSTER 24
-#define AF_12844 25
-#define AF_IRDA 26
-#define AF_MAX 27
+#define AF_MAX 22
#define PF_UNSPEC AF_UNSPEC
#define PF_UNIX AF_UNIX
#define PF_INET AF_INET
@@ -223,12 +216,7 @@ extern "C" {
#define WS_AF_FIREFOX 19
#define WS_AF_UNKNOWN1 20
#define WS_AF_BAN 21
-#define WS_AF_ATM 22
-#define WS_AF_INET6 23
-#define WS_AF_CLUSTER 24
-#define WS_AF_12844 25
-#define WS_AF_IRDA 26
-#define WS_AF_MAX 27
+#define WS_AF_MAX 22
#endif /* USE_WS_PREFIX */
/*
@@ -257,12 +245,9 @@ extern "C" {
#define IPPROTO_ICMP 1
#define IPPROTO_IGMP 2
#define IPPROTO_GGP 3
-#define IPPROTO_IPIP 4
#define IPPROTO_TCP 6
#define IPPROTO_UDP 17
#define IPPROTO_IDP 22
-#define IPPROTO_IPV6 41
-#define IPPROTO_ICMPV6 58
#define IPPROTO_ND 77
#define IPPROTO_RAW 255
#define IPPROTO_MAX 256
@@ -271,12 +256,9 @@ extern "C" {
#define WS_IPPROTO_ICMP 1
#define WS_IPPROTO_IGMP 2
#define WS_IPPROTO_GGP 3
-#define WS_IPPROTO_IPIP 4
#define WS_IPPROTO_TCP 6
#define WS_IPPROTO_UDP 17
#define WS_IPPROTO_IDP 22
-#define WS_IPPROTO_IPV6 41
-#define WS_IPPROTO_ICMPV6 58
#define WS_IPPROTO_ND 77
#define WS_IPPROTO_RAW 255
#define WS_IPPROTO_MAX 256
@@ -468,32 +450,11 @@ typedef struct WS(timeval)
} \
} \
} while(0)
-#define __WS_FD_SET1(fd, set, cast) do { \
+
+#define __WS_FD_SET(fd, set, cast) do { \
if (((cast*)(set))->fd_count < FD_SETSIZE) \
((cast*)(set))->fd_array[((cast*)(set))->fd_count++]=(fd); \
} while(0)
-/* This version checks if the filedesc is already in the list, and appends it
- * only if it's not the case
- */
-#define __WS_FD_SET2(fd, set, cast) do { \
- unsigned int __i; \
- for (__i = 0; __i < ((cast*)(set))->fd_count ; __i++) \
- { \
- if (((cast*)(set))->fd_array[__i]==(fd)) \
- break; \
- } \
- if (__i == ((cast*)(set))->fd_count && ((cast*)(set))->fd_count < FD_SETSIZE) \
- { \
- ((cast*)(set))->fd_count++; \
- ((cast*)(set))->fd_array[__i]=(fd);\
- } \
-} while(0)
-
-#ifndef __WINE_WINSOCK2__
-#define __WS_FD_SET(fd, set, cast) __WS_FD_SET1((fd),(set), cast)
-#else
-#define __WS_FD_SET(fd, set, cast) __WS_FD_SET2((fd),(set), cast)
-#endif
#ifndef USE_WS_PREFIX
#define FD_CLR(fd, set) __WS_FD_CLR((fd),(set), fd_set)
@@ -613,13 +574,11 @@ typedef struct WS(sockaddr_in)
* Multicast group information
*/
-#if !defined(__WINE_WINSOCK2__)
struct WS(ip_mreq)
{
struct WS(in_addr) imr_multiaddr;
struct WS(in_addr) imr_interface;
};
-#endif
/*
* WSAStartup
@@ -672,12 +631,6 @@ typedef struct WS(WSAData)
#define SO_RCVTIMEO 0x1006
#define SO_ERROR 0x1007
#define SO_TYPE 0x1008
-#define SO_BSP_STATE 0x1009
-
-#define SO_RANDOMIZE_PORT 0x3005
-#define SO_PORT_SCALABILITY 0x3006
-#define SO_REUSE_UNICASTPORT 0x3007
-#define SO_REUSE_MULTICASTPORT 0x3008
#define IOCPARM_MASK 0x7f
#define IOC_VOID 0x20000000
@@ -711,12 +664,6 @@ typedef struct WS(WSAData)
#define WS_SO_RCVTIMEO 0x1006
#define WS_SO_ERROR 0x1007
#define WS_SO_TYPE 0x1008
-#define WS_SO_BSP_STATE 0x1009
-
-#define WS_SO_RANDOMIZE_PORT 0x3005
-#define WS_SO_PORT_SCALABILITY 0x3006
-#define WS_SO_REUSE_UNICASTPORT 0x3007
-#define WS_SO_REUSE_MULTICASTPORT 0x3008
#define WS_IOCPARM_MASK 0x7f
#define WS_IOC_VOID 0x20000000
@@ -737,31 +684,26 @@ typedef struct WS(WSAData)
#define WS_TCP_NODELAY 1
#endif
-/* IPPROTO_IP options */
-#ifndef __WINE_WINSOCK2__ /* WinSock2 has different values for the IP_ constants */
-# ifndef USE_WS_PREFIX
-# define IP_OPTIONS 1
-# define IP_MULTICAST_IF 2
-# define IP_MULTICAST_TTL 3
-# define IP_MULTICAST_LOOP 4
-# define IP_ADD_MEMBERSHIP 5
-# define IP_DROP_MEMBERSHIP 6
-# define IP_TTL 7
-# define IP_TOS 8
-# define IP_DONTFRAGMENT 9
-# define IP_RECEIVE_BROADCAST 22
-# else
-# define WS_IP_OPTIONS 1
-# define WS_IP_MULTICAST_IF 2
-# define WS_IP_MULTICAST_TTL 3
-# define WS_IP_MULTICAST_LOOP 4
-# define WS_IP_ADD_MEMBERSHIP 5
-# define WS_IP_DROP_MEMBERSHIP 6
-# define WS_IP_TTL 7
-# define WS_IP_TOS 8
-# define WS_IP_DONTFRAGMENT 9
-# define WS_IP_RECEIVE_BROADCAST 22
-# endif
+#ifndef USE_WS_PREFIX
+# define IP_OPTIONS 1
+# define IP_MULTICAST_IF 2
+# define IP_MULTICAST_TTL 3
+# define IP_MULTICAST_LOOP 4
+# define IP_ADD_MEMBERSHIP 5
+# define IP_DROP_MEMBERSHIP 6
+# define IP_TTL 7
+# define IP_TOS 8
+# define IP_DONTFRAGMENT 9
+#else
+# define WS_IP_OPTIONS 1
+# define WS_IP_MULTICAST_IF 2
+# define WS_IP_MULTICAST_TTL 3
+# define WS_IP_MULTICAST_LOOP 4
+# define WS_IP_ADD_MEMBERSHIP 5
+# define WS_IP_DROP_MEMBERSHIP 6
+# define WS_IP_TTL 7
+# define WS_IP_TOS 8
+# define WS_IP_DONTFRAGMENT 9
#endif
@@ -797,8 +739,6 @@ typedef struct WS(WSAData)
#define MSG_OOB 0x0001
#define MSG_PEEK 0x0002
#define MSG_DONTROUTE 0x0004
-#define MSG_WAITALL 0x0008
-#define MSG_INTERRUPT 0x0010
#define MSG_PARTIAL 0x8000
#define MSG_MAXIOVLEN 16
#else /* USE_WS_PREFIX */
@@ -807,8 +747,6 @@ typedef struct WS(WSAData)
#define WS_MSG_OOB 0x0001
#define WS_MSG_PEEK 0x0002
#define WS_MSG_DONTROUTE 0x0004
-#define WS_MSG_WAITALL 0x0008
-#define WS_MSG_INTERRUPT 0x0010
#define WS_MSG_PARTIAL 0x8000
#define WS_MSG_MAXIOVLEN 16
#endif /* USE_WS_PREFIX */
@@ -833,15 +771,6 @@ typedef struct WS(WSAData)
#define FD_CONNECT 0x00000010
#define FD_CLOSE 0x00000020
-/* internal per-socket flags */
-#ifdef __WINESRC__
-#define FD_WINE_LISTENING 0x10000000
-#define FD_WINE_NONBLOCKING 0x20000000
-#define FD_WINE_CONNECTED 0x40000000
-#define FD_WINE_RAW 0x80000000
-#define FD_WINE_INTERNAL 0xFFFF0000
-#endif
-
/*
* All Windows Sockets error constants are biased by WSABASEERR from
* the "normal". They are also defined in winerror.h.
@@ -905,17 +834,6 @@ typedef struct WS(WSAData)
#define WSAVERNOTSUPPORTED (WSABASEERR+92)
#define WSANOTINITIALISED (WSABASEERR+93)
#define WSAEDISCON (WSABASEERR+101)
-#define WSAENOMORE (WSABASEERR+102)
-#define WSAECANCELLED (WSABASEERR+103)
-#define WSAEINVALIDPROCTABLE (WSABASEERR+104)
-#define WSAEINVALIDPROVIDER (WSABASEERR+105)
-#define WSAEPROVIDERFAILEDINIT (WSABASEERR+106)
-#define WSASYSCALLFAILURE (WSABASEERR+107)
-#define WSASERVICE_NOT_FOUND (WSABASEERR+108)
-#define WSATYPE_NOT_FOUND (WSABASEERR+109)
-#define WSA_E_NO_MORE (WSABASEERR+110)
-#define WSA_E_CANCELLED (WSABASEERR+111)
-#define WSAEREFUSED (WSABASEERR+112)
/*
* Error return codes from gethostbyname() and gethostbyaddr()
@@ -1007,7 +925,6 @@ typedef struct WS(WSAData)
* Remember to keep this section in sync with the
* "Winsock Function Typedefs" section in winsock2.h.
*/
-#if !defined(__WINE_WINSOCK2__) || WS_API_PROTOTYPES
HANDLE WINAPI WSAAsyncGetHostByAddr(HWND,WS(u_int),const char*,int,int,char*,int);
HANDLE WINAPI WSAAsyncGetHostByName(HWND,WS(u_int),const char*,char*,int);
HANDLE WINAPI WSAAsyncGetProtoByName(HWND,WS(u_int),const char*,char*,int);
@@ -1058,16 +975,10 @@ SOCKET WINAPI WS(socket)(int,int,int);
int WINAPI WS(gethostname)(char*,int);
#endif
-#endif /* !defined(__WINE_WINSOCK2__) || WS_API_PROTOTYPES */
-
#ifdef __cplusplus
}
#endif
-#ifndef __WINE_WINSOCK2__
#undef WS
-#undef WS_API_PROTOTYPES
-#undef WS_API_TYPEDEFS
-#endif
#endif /* _WINSOCKAPI_ */
diff --git a/include/winsock2.h b/include/winsock2.h
index 1935c99ad40..8739cedcbc6 100644
--- a/include/winsock2.h
+++ b/include/winsock2.h
@@ -17,13 +17,118 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- *
- * FIXME: Still missing required Winsock 2 definitions.
*/
+#ifndef __WINE_WINSOCKAPI_STDLIB_H
+#define __WINE_WINSOCKAPI_STDLIB_H
+
+/*
+ * This section defines the items that conflict with the Unix headers.
+ */
+#ifndef USE_WS_PREFIX
+/* We are not using the WS_ prefix we risk getting conflicts for
+ * everything related to select.
+ */
+# ifdef FD_CLR
+/* Too late, the Unix version of stdlib.h was included before winsock.h.
+ * This means select and all the related stuff is already defined and we
+ * cannot override types and function prototypes.
+ * All we can do is disable all these symbols so that they are not used
+ * inadvertently.
+ */
+# include <sys/types.h>
+# undef FD_SETSIZE
+# undef FD_CLR
+# undef FD_SET
+# undef FD_ZERO
+# undef FD_ISSET
+
+# define FD_SETSIZE Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
+# define FD_CLR Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
+# define FD_SET Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
+# define FD_ZERO Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
+# define FD_ISSET Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
+# define fd_set Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
+# define select Include_winsock_h_before_stdlib_h_or_use_the_MSVCRT_library
+# elif defined(RLIM_INFINITY)
+/* On Darwin stdlib.h includes sys/resource.h which defines timeval but not the fd_set macros */
+# define fd_set unix_fd_set
+# include <sys/types.h>
+# include <time.h>
+# include <stdlib.h>
+# undef fd_set
+# undef FD_SETSIZE
+# undef FD_CLR
+# undef FD_SET
+# undef FD_ZERO
+# undef FD_ISSET
+# define select Include_winsock_h_before_sys_types_h_or_use_the_MSVCRT_library
+# define timeval Include_winsock_h_before_sys_types_h_or_use_the_MSVCRT_library
+# else /* FD_CLR */
+/* stdlib.h has not been included yet so it's not too late. Include it now
+ * making sure that none of the select symbols is affected. Then we can
+ * define them with our own values.
+ */
+# define fd_set unix_fd_set
+# define timeval unix_timeval
+# define select unix_select
+# define socklen_t unix_socklen_t
+# define u_long unix_u_long
+# include <sys/types.h>
+# include <time.h>
+# include <stdlib.h>
+# undef fd_set
+# undef timeval
+# undef select
+# undef socklen_t
+# undef u_long
+# undef FD_SETSIZE
+# undef FD_CLR
+# undef FD_SET
+# undef FD_ZERO
+# undef FD_ISSET
+# undef _TIMEVAL_DEFINED
+
+# define WS_DEFINE_SELECT
+# endif /* FD_CLR */
+
+#else
+# define WS_DEFINE_SELECT
+# include <sys/types.h>
+# include <stdlib.h>
+#endif /* !USE_WS_PREFIX */
+
+#endif /* __WINE_WINSOCKAPI_STDLIB_H */
+
#ifndef _WINSOCK2API_
#define _WINSOCK2API_
+#include <windows.h>
+
+#ifdef USE_WS_PREFIX
+# define WS(x) WS_##x
+#else
+# define WS(x) x
+#endif
+
+#ifdef USE_WS_PREFIX
+typedef unsigned char WS_u_char;
+typedef unsigned short WS_u_short;
+typedef unsigned int WS_u_int;
+typedef ULONG WS_u_long;
+#elif (defined(_MSC_VER) || defined(__MINGW32__) || defined(__WATCOMC__)) && !defined(_BSDTYPES_DEFINED)
+/* MinGW doesn't define the u_xxx types */
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef ULONG u_long;
+#define _BSDTYPES_DEFINED
+#else
+#define u_long ULONG /* make sure we don't use the system u_long */
+#endif
+
+typedef UINT_PTR SOCKET;
+
/*
* Setup phase
*/
@@ -43,18 +148,36 @@
#define WS_API_TYPEDEFS INCL_WINSOCK_API_TYPEDEFS
#endif
-#define __WINE_WINSOCK2__
-#include <winsock.h>
-#undef __WINE_WINSOCK2__
-
#include <ws2def.h>
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */
+#define INVALID_SOCKET (SOCKET)(~0)
+#define SOCKET_ERROR (-1)
#ifndef USE_WS_PREFIX
+#define SOL_SOCKET 0xffff
+#define SO_DEBUG 0x0001
+#define SO_ACCEPTCONN 0x0002
+#define SO_REUSEADDR 0x0004
+#define SO_EXCLUSIVEADDRUSE ((u_int)(~SO_REUSEADDR))
+#define SO_KEEPALIVE 0x0008
+#define SO_DONTROUTE 0x0010
+#define SO_BROADCAST 0x0020
+#define SO_USELOOPBACK 0x0040
+#define SO_LINGER 0x0080
+#define SO_OOBINLINE 0x0100
+#define SO_DONTLINGER ((u_int)(~SO_LINGER))
+#define SO_SNDBUF 0x1001
+#define SO_RCVBUF 0x1002
+#define SO_SNDLOWAT 0x1003
+#define SO_RCVLOWAT 0x1004
+#define SO_SNDTIMEO 0x1005
+#define SO_RCVTIMEO 0x1006
+#define SO_ERROR 0x1007
+#define SO_TYPE 0x1008
#define SO_GROUP_ID 0x2001
#define SO_GROUP_PRIORITY 0x2002
#define SO_MAX_MSG_SIZE 0x2003
@@ -64,6 +187,26 @@ extern "C" {
#define PVD_CONFIG 0x3001
#define SO_CONDITIONAL_ACCEPT 0x3002
#else
+#define WS_SOL_SOCKET 0xffff
+#define WS_SO_DEBUG 0x0001
+#define WS_SO_ACCEPTCONN 0x0002
+#define WS_SO_REUSEADDR 0x0004
+#define WS_SO_EXCLUSIVEADDRUSE ((WS_u_int)(~WS_SO_REUSEADDR))
+#define WS_SO_KEEPALIVE 0x0008
+#define WS_SO_DONTROUTE 0x0010
+#define WS_SO_BROADCAST 0x0020
+#define WS_SO_USELOOPBACK 0x0040
+#define WS_SO_LINGER 0x0080
+#define WS_SO_OOBINLINE 0x0100
+#define WS_SO_DONTLINGER ((WS_u_int)(~WS_SO_LINGER))
+#define WS_SO_SNDBUF 0x1001
+#define WS_SO_RCVBUF 0x1002
+#define WS_SO_SNDLOWAT 0x1003
+#define WS_SO_RCVLOWAT 0x1004
+#define WS_SO_SNDTIMEO 0x1005
+#define WS_SO_RCVTIMEO 0x1006
+#define WS_SO_ERROR 0x1007
+#define WS_SO_TYPE 0x1008
#define WS_SO_GROUP_ID 0x2001
#define WS_SO_GROUP_PRIORITY 0x2002
#define WS_SO_MAX_MSG_SIZE 0x2003
@@ -95,7 +238,31 @@ extern "C" {
/* protocol families */
#ifndef USE_WS_PREFIX
+#define PF_APPLETALK AF_APPLETALK
+#define PF_BAN AF_BAN
+#define PF_CCITT AF_CCITT
+#define PF_CHAOS AF_CHAOS
+#define PF_DATAKIT AF_DATAKIT
+#define PF_DECnet AF_DECnet
+#define PF_DLI AF_DLI
+#define PF_ECMA AF_ECMA
+#define PF_FIREFOX AF_FIREFOX
+#define PF_HYLINK AF_HYLINK
+#define PF_IMPLINK AF_IMPLINK
+#define PF_INET AF_INET
#define PF_INET6 AF_INET6
+#define PF_IPX AF_IPX
+#define PF_ISO AF_ISO
+#define PF_LAT AF_LAT
+#define PF_MAX AF_MAX
+#define PF_NS AF_NS
+#define PF_OSI AF_OSI
+#define PF_PUP AF_PUP
+#define PF_SNA AF_SNA
+#define PF_UNIX AF_UNIX
+#define PF_UNKNOWN1 AF_UNKNOWN1
+#define PF_UNSPEC AF_UNSPEC
+#define PF_VOICEVIEW AF_VOICEVIEW
#endif
/* option flags per socket */
@@ -112,11 +279,23 @@ extern "C" {
#define FD_ROUTING_INTERFACE_CHANGE_BIT 8
#define FD_ADDRESS_LIST_CHANGE_BIT 9
+#define FD_READ 0x00000001
+#define FD_WRITE 0x00000002
+#define FD_OOB 0x00000004
+#define FD_ACCEPT 0x00000008
+#define FD_CONNECT 0x00000010
+#define FD_CLOSE 0x00000020
#define FD_QOS 0x00000040
#define FD_GROUP_QOS 0x00000080
#define FD_ROUTING_INTERFACE_CHANGE 0x00000100
#define FD_ADDRESS_LIST_CHANGE 0x00000200
+#ifdef __WINESRC__
+#define FD_WINE_LISTENING 0x10000000
+#define FD_WINE_NONBLOCKING 0x20000000
+#define FD_WINE_CONNECTED 0x40000000
+#endif
+
/* Constants for LPCONDITIONPROC */
#define CF_ACCEPT 0x0000
#define CF_REJECT 0x0001
@@ -164,10 +343,22 @@ extern "C" {
#define WS_IOC_OUT 0x40000000
#define WS_IOC_IN 0x80000000
#define WS_IOC_INOUT (WS_IOC_IN|WS_IOC_OUT)
+#define WS_IOCPARM_MASK 0x7f
+#define WS__IO(x,y) (WS_IOC_VOID | ((x) << 8) | (y))
+#define WS__IOR(x,y,t) (WS_IOC_OUT | (((UINT)sizeof(t) & WS_IOCPARM_MASK) << 16) | ((x) << 8) | (y))
+#define WS__IOW(x,y,t) (WS_IOC_IN | (((UINT)sizeof(t) & WS_IOCPARM_MASK) << 16) | ((x) << 8) | (y))
#define _WSAIO(x,y) (WS_IOC_VOID|(x)|(y))
#define _WSAIOR(x,y) (WS_IOC_OUT|(x)|(y))
#define _WSAIOW(x,y) (WS_IOC_IN|(x)|(y))
#define _WSAIORW(x,y) (WS_IOC_INOUT|(x)|(y))
+#define WS_FIONREAD WS__IOR('f', 127, ULONG)
+#define WS_FIONBIO WS__IOW('f', 126, ULONG)
+#define WS_FIOASYNC WS__IOW('f', 125, ULONG)
+#define WS_SIOCSHIWAT WS__IOW('s', 0, ULONG)
+#define WS_SIOCGHIWAT WS__IOR('s', 1, ULONG)
+#define WS_SIOCSLOWAT WS__IOW('s', 2, ULONG)
+#define WS_SIOCGLOWAT WS__IOR('s', 3, ULONG)
+#define WS_SIOCATMARK WS__IOR('s', 7, ULONG)
#define WS_SIO_ASSOCIATE_HANDLE _WSAIOW(WS_IOC_WS2,1)
#define WS_SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(WS_IOC_WS2,2)
#define WS_SIO_FIND_ROUTE _WSAIOR(WS_IOC_WS2,3)
@@ -200,10 +391,22 @@ extern "C" {
#define IOC_OUT 0x40000000
#define IOC_IN 0x80000000
#define IOC_INOUT (IOC_IN|IOC_OUT)
+#define IOCPARM_MASK 0x7f
+#define _IO(x,y) (IOC_VOID | ((x) << 8) | (y))
+#define _IOR(x,y,t) (IOC_OUT | (((UINT)sizeof(t) & IOCPARM_MASK) << 16) | ((x) << 8) | (y))
+#define _IOW(x,y,t) (IOC_IN | (((UINT)sizeof(t) & IOCPARM_MASK) << 16) | ((x) << 8) | (y))
#define _WSAIO(x,y) (IOC_VOID|(x)|(y))
#define _WSAIOR(x,y) (IOC_OUT|(x)|(y))
#define _WSAIOW(x,y) (IOC_IN|(x)|(y))
#define _WSAIORW(x,y) (IOC_INOUT|(x)|(y))
+#define FIONREAD _IOR('f', 127, ULONG)
+#define FIONBIO _IOW('f', 126, ULONG)
+#define FIOASYNC _IOW('f', 125, ULONG)
+#define SIOCSHIWAT _IOW('s', 0, ULONG)
+#define SIOCGHIWAT _IOR('s', 1, ULONG)
+#define SIOCSLOWAT _IOW('s', 2, ULONG)
+#define SIOCGLOWAT _IOR('s', 3, ULONG)
+#define SIOCATMARK _IOR('s', 7, ULONG)
#define SIO_ASSOCIATE_HANDLE _WSAIOW(IOC_WS2,1)
#define SIO_ENABLE_CIRCULAR_QUEUEING _WSAIO(IOC_WS2,2)
#define SIO_FIND_ROUTE _WSAIOR(IOC_WS2,3)
@@ -225,6 +428,28 @@ extern "C" {
#define SIO_GET_INTERFACE_LIST _IOR ('t', 127, ULONG)
#endif /* USE_WS_PREFIX */
+#ifndef USE_WS_PREFIX
+#define SOMAXCONN 0x7fffffff
+
+#define MSG_OOB 0x0001
+#define MSG_PEEK 0x0002
+#define MSG_DONTROUTE 0x0004
+#define MSG_WAITALL 0x0008
+#define MSG_INTERRUPT 0x0010
+#define MSG_PARTIAL 0x8000
+#define MSG_MAXIOVLEN 16
+#else /* USE_WS_PREFIX */
+#define WS_SOMAXCONN 0x7fffffff
+
+#define WS_MSG_OOB 0x0001
+#define WS_MSG_PEEK 0x0002
+#define WS_MSG_DONTROUTE 0x0004
+#define WS_MSG_WAITALL 0x0008
+#define WS_MSG_INTERRUPT 0x0010
+#define WS_MSG_PARTIAL 0x8000
+#define WS_MSG_MAXIOVLEN 16
+#endif /* USE_WS_PREFIX */
+
/* Constants for WSAIoctl() */
#define WSA_FLAG_OVERLAPPED 0x0001
#define WSA_FLAG_MULTIPOINT_C_ROOT 0x0002
@@ -284,6 +509,8 @@ extern "C" {
#include <guiddef.h>
#endif
+#define MAXGETHOSTSTRUCT 1024
+
#define MAX_PROTOCOL_CHAIN 7
#define BASE_PROTOCOL 1
#define LAYERED_PROTOCOL 0
@@ -328,6 +555,81 @@ typedef struct _WSAPROTOCOLCHAIN
#define SECURITY_PROTOCOL_NONE 0x0000
+#ifndef _TIMEVAL_DEFINED
+#define _TIMEVAL_DEFINED
+typedef struct WS(timeval)
+{
+ LONG tv_sec;
+ LONG tv_usec;
+} TIMEVAL, *PTIMEVAL, *LPTIMEVAL;
+#endif
+
+#ifdef WS_DEFINE_SELECT
+
+#define __WS_FD_CLR(fd, set, cast) do { \
+ unsigned int __i; \
+ for (__i = 0; __i < ((cast*)(set))->fd_count; __i++) \
+ { \
+ if (((cast*)(set))->fd_array[__i] == fd) \
+ { \
+ while (__i < ((cast*)(set))->fd_count-1) \
+ { \
+ ((cast*)(set))->fd_array[__i] = \
+ ((cast*)(set))->fd_array[__i+1]; \
+ __i++; \
+ } \
+ ((cast*)(set))->fd_count--; \
+ break; \
+ } \
+ } \
+} while (0)
+
+#define __WS_FD_SET(fd, set, cast) do { \
+ unsigned int __i; \
+ for (__i = 0; __i < ((cast*)(set))->fd_count; __i++) \
+ { \
+ if (((cast*)(set))->fd_array[__i] == (fd)) \
+ break; \
+ } \
+ if (__i == ((cast*)(set))->fd_count && ((cast*)(set))->fd_count < FD_SETSIZE) \
+ { \
+ ((cast*)(set))->fd_count++; \
+ ((cast*)(set))->fd_array[__i]=(fd);\
+ } \
+} while (0)
+
+#ifndef USE_WS_PREFIX
+
+# ifndef FD_SETSIZE
+# define FD_SETSIZE 64
+# endif
+
+# define FD_CLR(fd, set) __WS_FD_CLR((fd), (set), fd_set)
+# define FD_SET(fd, set) __WS_FD_SET((fd), (set), fd_set)
+# define FD_ZERO(set) (((fd_set*)(set))->fd_count=0)
+# define FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (fd_set*)(set))
+
+#else
+
+# ifndef WS_FD_SETSIZE
+# define WS_FD_SETSIZE 64
+# endif
+
+# define WS_FD_CLR(fd, set) __WS_FD_CLR((fd), (set), WS_fd_set)
+# define WS_FD_SET(fd, set) __WS_FD_SET((fd), (set), WS_fd_set)
+# define WS_FD_ZERO(set) (((WS_fd_set*)(set))->fd_count=0)
+# define WS_FD_ISSET(fd, set) __WSAFDIsSet((SOCKET)(fd), (WS_fd_set*)(set))
+
+#endif
+
+typedef struct WS(fd_set)
+{
+ WS(u_int) fd_count;
+ SOCKET fd_array[WS(FD_SETSIZE)];
+} WS(fd_set), FD_SET, *PFD_SET, *LPFD_SET;
+
+#endif
+
typedef struct /*WS(pollfd)*/
{
SOCKET fd;
@@ -335,6 +637,42 @@ typedef struct /*WS(pollfd)*/
SHORT revents;
} WSAPOLLFD;
+typedef struct WS(hostent)
+{
+ char *h_name;
+ char **h_aliases;
+ short h_addrtype;
+ short h_length;
+ char **h_addr_list;
+#define h_addr h_addr_list[0]
+} HOSTENT, *PHOSTENT, *LPHOSTENT;
+
+typedef struct WS(servent)
+{
+ char *s_name;
+ char **s_aliases;
+#ifdef _WIN64
+ char *s_proto;
+ short s_port;
+#else
+ short s_port;
+ char *s_proto;
+#endif
+} SERVENT, *PSERVENT, *LPSERVENT;
+
+typedef struct WS(protoent)
+{
+ char *p_name;
+ char **p_aliases;
+ short p_proto;
+} PROTOENT, *PPROTOENT, *LPPROTOENT;
+
+typedef struct WS(linger)
+{
+ WS(u_short) l_onoff;
+ WS(u_short) l_linger;
+} LINGER, *PLINGER, *LPLINGER;
+
#define WSAPROTOCOL_LEN 255
typedef struct _WSAPROTOCOL_INFOA
{
@@ -441,6 +779,17 @@ DECL_WINELIB_TYPE_AW(LPWSASERVICECLASSINFO)
#define WSAOVERLAPPED OVERLAPPED
typedef struct _OVERLAPPED* LPWSAOVERLAPPED;
+#ifndef USE_WS_PREFIX
+#define h_errno WSAGetLastError()
+#else
+#define WS_h_errno WSAGetLastError()
+#endif
+
+#define WSAHOST_NOT_FOUND (WSABASEERR + 1001)
+#define WSATRY_AGAIN (WSABASEERR + 1002)
+#define WSANO_RECOVERY (WSABASEERR + 1003)
+#define WSANO_DATA (WSABASEERR + 1004)
+
#define WSA_IO_PENDING (ERROR_IO_PENDING)
#define WSA_IO_INCOMPLETE (ERROR_IO_INCOMPLETE)
#define WSA_INVALID_HANDLE (ERROR_INVALID_HANDLE)
@@ -628,6 +977,75 @@ typedef struct _WSACOMPLETION {
} Parameters;
} WSACOMPLETION, *PWSACOMPLETION, *LPWSACOMPLETION;
+#define WSADESCRIPTION_LEN 256
+#define WSASYS_STATUS_LEN 128
+
+typedef struct WSAData
+{
+ WORD wVersion;
+ WORD wHighVersion;
+#ifdef _WIN64
+ WORD iMaxSockets;
+ WORD iMaxUdpDg;
+ char *lpVendorInfo;
+ char szDescription[WSADESCRIPTION_LEN+1];
+ char szSystemStatus[WSASYS_STATUS_LEN+1];
+#else
+ char szDescription[WSADESCRIPTION_LEN+1];
+ char szSystemStatus[WSASYS_STATUS_LEN+1];
+ WORD iMaxSockets;
+ WORD iMaxUdpDg;
+ char *lpVendorInfo;
+#endif
+} WSADATA, *LPWSADATA;
+
+#ifndef USE_WS_PREFIX
+
+#undef htonl
+#undef htons
+#undef ntohl
+#undef ntohs
+
+#ifdef WORDS_BIGENDIAN
+
+static inline u_short __wine_ushort_noop(u_short s)
+{
+ return s;
+}
+static inline ULONG __wine_ulong_noop(ULONG l)
+{
+ return l;
+}
+#define htonl __wine_ulong_noop
+#define htons __wine_ushort_noop
+#define ntohl __wine_ulong_noop
+#define ntohs __wine_ushort_noop
+
+#else /* WORDS_BIGENDIAN */
+
+static inline u_short __wine_ushort_swap(u_short s)
+{
+ return (s >> 8) | (s << 8);
+}
+static inline ULONG __wine_ulong_swap(ULONG l)
+{
+ return ((ULONG)__wine_ushort_swap((u_short)l) << 16) | __wine_ushort_swap((u_short)(l >> 16));
+}
+#define htonl __wine_ulong_swap
+#define htons __wine_ushort_swap
+#define ntohl __wine_ulong_swap
+#define ntohs __wine_ushort_swap
+
+#endif /* WORDS_BIGENDIAN */
+#endif /* USE_WS_PREFIX */
+
+#define WSAMAKEASYNCREPLY(size, error) MAKELONG(size, error)
+#define WSAMAKESELECTREPLY(flags, error) MAKELONG(flags, error)
+#define WSAGETASYNCBUFLEN(x) LOWORD(x)
+#define WSAGETASYNCERROR(x) HIWORD(x)
+#define WSAGETSELECTEVENT(x) LOWORD(x)
+#define WSAGETSELECTERROR(x) HIWORD(x)
+
/*
* Winsock Function Typedefs
*
@@ -695,11 +1113,55 @@ typedef SOCKET (WINAPI *LPFN_SOCKET)(int,int,int);
* "Winsock2 Function Typedefs" section below.
*/
#if WS_API_PROTOTYPES
+int WINAPI __WSAFDIsSet(SOCKET, WS(fd_set) *);
+
+SOCKET WINAPI WS(accept)(SOCKET, struct WS(sockaddr) *, int *);
+int WINAPI WS(bind)(SOCKET, const struct WS(sockaddr) *, int);
+int WINAPI WS(closesocket)(SOCKET);
+int WINAPI WS(connect)(SOCKET, const struct WS(sockaddr) *, int);
+struct WS(hostent) * WINAPI WS(gethostbyaddr)(const char *, int, int);
+struct WS(hostent) * WINAPI WS(gethostbyname)(const char *);
+#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__WINE_USE_MSVCRT)
+/* gethostname is defined in unistd.h */
+int WINAPI WS(gethostname)(char *, int);
+#endif
+int WINAPI WS(getpeername)(SOCKET, struct WS(sockaddr) *, int *);
+struct WS(protoent) * WINAPI WS(getprotobyname)(const char *);
+struct WS(protoent) * WINAPI WS(getprotobynumber)(int);
+struct WS(servent) * WINAPI WS(getservbyname)(const char *, const char *);
+struct WS(servent) * WINAPI WS(getservbyport)(int, const char *);
+int WINAPI WS(getsockname)(SOCKET, struct WS(sockaddr) *, int *);
+int WINAPI WS(getsockopt)(SOCKET, int, int, char *, int *);
+ULONG WINAPI WS(inet_addr)(const char *);
+char * WINAPI WS(inet_ntoa)(struct WS(in_addr));
+int WINAPI WS(ioctlsocket)(SOCKET, LONG, WS(u_long) *);
+int WINAPI WS(listen)(SOCKET, int);
+int WINAPI WS(recv)(SOCKET, char *, int, int);
+int WINAPI WS(recvfrom)(SOCKET, char *, int, int, struct WS(sockaddr) *, int *);
+#ifdef WS_DEFINE_SELECT
+int WINAPI WS(select)(int, WS(fd_set) *, WS(fd_set) *, WS(fd_set) *, const struct WS(timeval) *);
+#endif
+int WINAPI WS(send)(SOCKET, const char *, int, int);
+int WINAPI WS(sendto)(SOCKET, const char *, int, int, const struct WS(sockaddr) *, int);
+int WINAPI WS(setsockopt)(SOCKET, int, int, const char *, int);
+int WINAPI WS(shutdown)(SOCKET, int);
+SOCKET WINAPI WS(socket)(int, int, int);
+
int WINAPI GetHostNameW(WCHAR *, int);
SOCKET WINAPI WSAAccept(SOCKET,struct WS(sockaddr)*,LPINT,LPCONDITIONPROC,DWORD_PTR);
INT WINAPI WSAAddressToStringA(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOA,LPSTR,LPDWORD);
INT WINAPI WSAAddressToStringW(LPSOCKADDR,DWORD,LPWSAPROTOCOL_INFOW,LPWSTR,LPDWORD);
#define WSAAddressToString WINELIB_NAME_AW(WSAAddressToString)
+HANDLE WINAPI WSAAsyncGetHostByAddr(HWND, WS(u_int), const char *, int, int, char *, int);
+HANDLE WINAPI WSAAsyncGetHostByName(HWND, WS(u_int), const char *, char *, int);
+HANDLE WINAPI WSAAsyncGetProtoByName(HWND, WS(u_int), const char *, char *, int);
+HANDLE WINAPI WSAAsyncGetProtoByNumber(HWND, WS(u_int), int, char *, int);
+HANDLE WINAPI WSAAsyncGetServByName(HWND, WS(u_int), const char *, const char *, char *, int);
+HANDLE WINAPI WSAAsyncGetServByPort(HWND, WS(u_int), int, const char *, char *, int);
+int WINAPI WSAAsyncSelect(SOCKET, HWND, WS(u_int), LONG);
+int WINAPI WSACancelAsyncRequest(HANDLE);
+int WINAPI WSACancelBlockingCall(void);
+int WINAPI WSACleanup(void);
BOOL WINAPI WSACloseEvent(WSAEVENT);
int WINAPI WSAConnect(SOCKET,const struct WS(sockaddr)*,int,LPWSABUF,LPWSABUF,LPQOS,LPQOS);
WSAEVENT WINAPI WSACreateEvent(void);
@@ -714,6 +1176,7 @@ int WINAPI WSAEnumProtocolsA(LPINT,LPWSAPROTOCOL_INFOA,LPDWORD);
int WINAPI WSAEnumProtocolsW(LPINT,LPWSAPROTOCOL_INFOW,LPDWORD);
#define WSAEnumProtocols WINELIB_NAME_AW(WSAEnumProtocols)
int WINAPI WSAEventSelect(SOCKET,WSAEVENT,LONG);
+int WINAPI WSAGetLastError(void);
BOOL WINAPI WSAGetOverlappedResult(SOCKET,LPWSAOVERLAPPED,LPDWORD,BOOL,LPDWORD);
BOOL WINAPI WSAGetQOSByName(SOCKET,LPWSABUF,LPQOS);
INT WINAPI WSAGetServiceClassInfoA(LPGUID,LPGUID,LPDWORD,LPWSASERVICECLASSINFOA);
@@ -728,6 +1191,7 @@ int WINAPI WSAInstallServiceClassA(LPWSASERVICECLASSINFOA);
int WINAPI WSAInstallServiceClassW(LPWSASERVICECLASSINFOW);
#define WSAInstallServiceClass WINELIB_NAME_AW(WSAInstallServiceClass)
int WINAPI WSAIoctl(SOCKET,DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+BOOL WINAPI WSAIsBlocking(void);
SOCKET WINAPI WSAJoinLeaf(SOCKET,const struct WS(sockaddr)*,int,LPWSABUF,LPWSABUF,LPQOS,LPQOS,DWORD);
INT WINAPI WSALookupServiceBeginA(LPWSAQUERYSETA,DWORD,LPHANDLE);
INT WINAPI WSALookupServiceBeginW(LPWSAQUERYSETW,DWORD,LPHANDLE);
@@ -749,16 +1213,20 @@ BOOL WINAPI WSAResetEvent(WSAEVENT);
int WINAPI WSASend(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
int WINAPI WSASendDisconnect(SOCKET,LPWSABUF);
int WINAPI WSASendTo(SOCKET,LPWSABUF,DWORD,LPDWORD,DWORD,const struct WS(sockaddr)*,int,LPWSAOVERLAPPED,LPWSAOVERLAPPED_COMPLETION_ROUTINE);
+FARPROC WINAPI WSASetBlockingHook(FARPROC);
BOOL WINAPI WSASetEvent(WSAEVENT);
+void WINAPI WSASetLastError(int);
INT WINAPI WSASetServiceA(LPWSAQUERYSETA,WSAESETSERVICEOP,DWORD);
INT WINAPI WSASetServiceW(LPWSAQUERYSETW,WSAESETSERVICEOP,DWORD);
#define WSASetService WINELIB_NAME_AW(WSASetService)
SOCKET WINAPI WSASocketA(int,int,int,LPWSAPROTOCOL_INFOA,GROUP,DWORD);
SOCKET WINAPI WSASocketW(int,int,int,LPWSAPROTOCOL_INFOW,GROUP,DWORD);
#define WSASocket WINELIB_NAME_AW(WSASocket)
+int WINAPI WSAStartup(WORD,WSADATA*);
INT WINAPI WSAStringToAddressA(LPSTR,INT,LPWSAPROTOCOL_INFOA,LPSOCKADDR,LPINT);
INT WINAPI WSAStringToAddressW(LPWSTR,INT,LPWSAPROTOCOL_INFOW,LPSOCKADDR,LPINT);
#define WSAStringToAddress WINELIB_NAME_AW(WSAStringToAddress)
+int WINAPI WSAUnhookBlockingHook(void);
DWORD WINAPI WSAWaitForMultipleEvents(DWORD,const WSAEVENT*,BOOL,DWORD,BOOL);
#endif /* WS_API_PROTOTYPES */
diff --git a/include/ws2def.h b/include/ws2def.h
index b92bf68bae8..9ddfa031633 100644
--- a/include/ws2def.h
+++ b/include/ws2def.h
@@ -29,6 +29,166 @@
typedef USHORT ADDRESS_FAMILY;
+typedef struct WS(sockaddr)
+{
+ unsigned short sa_family;
+ char sa_data[14];
+} SOCKADDR, *PSOCKADDR, *LPSOCKADDR;
+
+#ifndef USE_WS_PREFIX
+#define AF_UNSPEC 0
+#define AF_UNIX 1
+#define AF_INET 2
+#define AF_IMPLINK 3
+#define AF_PUP 4
+#define AF_CHAOS 5
+#define AF_NS 6
+#define AF_IPX AF_NS
+#define AF_ISO 7
+#define AF_OSI AF_ISO
+#define AF_ECMA 8
+#define AF_DATAKIT 9
+#define AF_CCITT 10
+#define AF_SNA 11
+#define AF_DECnet 12
+#define AF_DLI 13
+#define AF_LAT 14
+#define AF_HYLINK 15
+#define AF_APPLETALK 16
+#define AF_NETBIOS 17
+#define AF_VOICEVIEW 18
+#define AF_FIREFOX 19
+#define AF_UNKNOWN1 20
+#define AF_BAN 21
+#define AF_ATM 22
+#define AF_INET6 23
+#define AF_CLUSTER 24
+#define AF_12844 25
+#define AF_IRDA 26
+#define AF_MAX 27
+#else /* USE_WS_PREFIX */
+#define WS_AF_UNSPEC 0
+#define WS_AF_UNIX 1
+#define WS_AF_INET 2
+#define WS_AF_IMPLINK 3
+#define WS_AF_PUP 4
+#define WS_AF_CHAOS 5
+#define WS_AF_NS 6
+#define WS_AF_IPX WS_AF_NS
+#define WS_AF_ISO 7
+#define WS_AF_OSI WS_AF_ISO
+#define WS_AF_ECMA 8
+#define WS_AF_DATAKIT 9
+#define WS_AF_CCITT 10
+#define WS_AF_SNA 11
+#define WS_AF_DECnet 12
+#define WS_AF_DLI 13
+#define WS_AF_LAT 14
+#define WS_AF_HYLINK 15
+#define WS_AF_APPLETALK 16
+#define WS_AF_NETBIOS 17
+#define WS_AF_VOICEVIEW 18
+#define WS_AF_FIREFOX 19
+#define WS_AF_UNKNOWN1 20
+#define WS_AF_BAN 21
+#define WS_AF_ATM 22
+#define WS_AF_INET6 23
+#define WS_AF_CLUSTER 24
+#define WS_AF_12844 25
+#define WS_AF_IRDA 26
+#define WS_AF_MAX 27
+#endif /* USE_WS_PREFIX */
+
+#ifndef USE_WS_PREFIX
+#define IPPROTO_IP 0
+#else
+#define WS_IPPROTO_IP 0
+#endif
+
+typedef enum
+{
+ WS(IPPROTO_ICMP) = 1,
+ WS(IPPROTO_IGMP) = 2,
+ WS(IPPROTO_GGP) = 3,
+ WS(IPPROTO_IPV4) = 4,
+ WS(IPPROTO_TCP) = 6,
+ WS(IPPROTO_UDP) = 17,
+ WS(IPPROTO_IDP) = 22,
+ WS(IPPROTO_IPV6) = 41,
+ WS(IPPROTO_ICMPV6) = 58,
+ WS(IPPROTO_ND) = 77,
+ WS(IPPROTO_RAW) = 255,
+ WS(IPPROTO_MAX) = 256,
+} IPPROTO;
+
+#ifndef USE_WS_PREFIX
+#define INADDR_ANY ((ULONG)0x00000000)
+#define INADDR_LOOPBACK 0x7f000001
+#define INADDR_BROADCAST ((ULONG)0xffffffff)
+#define INADDR_NONE 0xffffffff
+#else
+#define WS_INADDR_ANY ((ULONG)0x00000000)
+#define WS_INADDR_LOOPBACK 0x7f000001
+#define WS_INADDR_BROADCAST ((ULONG)0xffffffff)
+#define WS_INADDR_NONE 0xffffffff
+#endif
+
+#ifndef USE_WS_PREFIX
+#define IN_CLASSA_NSHIFT 24
+#define IN_CLASSA_MAX 128
+#define IN_CLASSA_NET 0xff000000
+#define IN_CLASSA_HOST 0x00ffffff
+#define IN_CLASSA(i) (((LONG)(i) & 0x80000000) == 0)
+#define IN_CLASSB_NSHIFT 16
+#define IN_CLASSB_MAX 65536
+#define IN_CLASSB_NET 0xffff0000
+#define IN_CLASSB_HOST 0x0000ffff
+#define IN_CLASSB(i) (((LONG)(i) & 0xc0000000) == 0x80000000)
+#define IN_CLASSC_NSHIFT 8
+#define IN_CLASSC_NET 0xffffff00
+#define IN_CLASSC_HOST 0x000000ff
+#define IN_CLASSC(i) (((LONG)(i) & 0xe0000000) == 0xc0000000)
+#else
+#define WS_IN_CLASSA_NSHIFT 24
+#define WS_IN_CLASSA_MAX 128
+#define WS_IN_CLASSA_NET 0xff000000
+#define WS_IN_CLASSA_HOST 0x00ffffff
+#define WS_IN_CLASSA(i) (((LONG)(i) & 0x80000000) == 0)
+#define WS_IN_CLASSB_NSHIFT 16
+#define WS_IN_CLASSB_MAX 65536
+#define WS_IN_CLASSB_NET 0xffff0000
+#define WS_IN_CLASSB_HOST 0x0000ffff
+#define WS_IN_CLASSB(i) (((LONG)(i) & 0xc0000000) == 0x80000000)
+#define WS_IN_CLASSC_NSHIFT 8
+#define WS_IN_CLASSC_NET 0xffffff00
+#define WS_IN_CLASSC_HOST 0x000000ff
+#define WS_IN_CLASSC(i) (((LONG)(i) & 0xe0000000) == 0xc0000000)
+#endif /* USE_WS_PREFIX */
+
+#ifndef USE_WS_PREFIX
+#define SO_BSP_STATE 0x1009
+#define SO_RANDOMIZE_PORT 0x3005
+#define SO_PORT_SCALABILITY 0x3006
+#define SO_REUSE_UNICASTPORT 0x3007
+#define SO_REUSE_MULTICASTPORT 0x3008
+#define TCP_NODELAY 0x0001
+#else
+#define WS_SO_BSP_STATE 0x1009
+#define WS_SO_RANDOMIZE_PORT 0x3005
+#define WS_SO_PORT_SCALABILITY 0x3006
+#define WS_SO_REUSE_UNICASTPORT 0x3007
+#define WS_SO_REUSE_MULTICASTPORT 0x3008
+#define WS_TCP_NODELAY 0x0001
+#endif
+
+typedef struct WS(sockaddr_in)
+{
+ short sin_family;
+ unsigned short sin_port;
+ struct WS(in_addr) sin_addr;
+ char sin_zero[8];
+} SOCKADDR_IN, *PSOCKADDR_IN, *LPSOCKADDR_IN;
+
#ifndef __CSADDR_DEFINED__
#define __CSADDR_DEFINED__
diff --git a/server/sock.c b/server/sock.c
index 00d5b0b9044..39f02036da8 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -96,32 +96,6 @@
#include "request.h"
#include "user.h"
-/* From winsock.h */
-#define FD_MAX_EVENTS 10
-#define FD_READ_BIT 0
-#define FD_WRITE_BIT 1
-#define FD_OOB_BIT 2
-#define FD_ACCEPT_BIT 3
-#define FD_CONNECT_BIT 4
-#define FD_CLOSE_BIT 5
-
-/*
- * Define flags to be used with the WSAAsyncSelect() call.
- */
-#define FD_READ 0x00000001
-#define FD_WRITE 0x00000002
-#define FD_OOB 0x00000004
-#define FD_ACCEPT 0x00000008
-#define FD_CONNECT 0x00000010
-#define FD_CLOSE 0x00000020
-
-/* internal per-socket flags */
-#define FD_WINE_LISTENING 0x10000000
-#define FD_WINE_NONBLOCKING 0x20000000
-#define FD_WINE_CONNECTED 0x40000000
-#define FD_WINE_RAW 0x80000000
-#define FD_WINE_INTERNAL 0xFFFF0000
-
struct accept_req
{
struct list entry;
@@ -988,7 +962,7 @@ static int get_unix_protocol( int protocol )
case WS_IPPROTO_ICMP: return IPPROTO_ICMP;
case WS_IPPROTO_IGMP: return IPPROTO_IGMP;
case WS_IPPROTO_IP: return IPPROTO_IP;
- case WS_IPPROTO_IPIP: return IPPROTO_IPIP;
+ case WS_IPPROTO_IPV4: return IPPROTO_IPIP;
case WS_IPPROTO_IPV6: return IPPROTO_IPV6;
case WS_IPPROTO_RAW: return IPPROTO_RAW;
case WS_IPPROTO_TCP: return IPPROTO_TCP;
--
2.30.2
2
5
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/mshtml/tests/documentmode.js | 110 +++++++++++++++++++++++++++++-
1 file changed, 109 insertions(+), 1 deletion(-)
2
1