Commit b19b72bd authored by Aleksey R.'s avatar Aleksey R.

* test: table transposition

parent f81e477e
This diff is collapsed.
clock.png

741 Bytes

......@@ -91,32 +91,25 @@ class Masks:
self.version = nt.getVersion()
def print_table(f, collected, function_name, enum_name):
versions = [".".join(["{}".format(n) for n in x.version]) for x in collected]
values = list()
values = set()
for x in collected:
values += [ i for i in x.values[function_name] ]
line = 0
for i in sorted( set(values) ):
if (line % 16) == 0:
if line:
f.write( "| | {} | |\n".format(" | ".join(versions)) )
f.write( "\n".format(" | ".join(versions)) )
f.write( "| | {} | |\n".format(" | ".join(versions)) )
f.write( "| {} |\n".format(" | ".join(["---" for x in range(len(versions) + 2)])) )
line += 1
values = values | set([ i for i in x.values[function_name] ])
for i in sorted(values): # for each InfoClass value
names = set([ x.enums[enum_name][i] for x in collected if i in x.enums[enum_name] ])
f.write( "| {} (={}) |".format(" / ".join(names), i) )
f.write( "\n" )
f.write( "## {} == {}".format(" / ".join(names), i) )
f.write( "\n" )
f.write( "| Windows version | Required access masks |\n" )
f.write( "| --- | --- |\n" )
prev = None
for x in collected:
ver = ".".join(["{}".format(n) for n in x.version])
am = ""
color = ""
if i in x.values[function_name]:
am = format_file_access_masks(x.values[function_name][i])
if not prev is None:
......@@ -126,12 +119,14 @@ def print_table(f, collected, function_name, enum_name):
color = "![C](arrow_circle_double.png) "
elif i < max([ j for j in x.values[function_name] ]):
am = "![X](deny_rd_cr.png)"
else:
color = "![U](clock.png)"
f.write( " {}{} |".format(color, am) )
f.write( "| {} | {}{} |\n".format(ver, color, am) )
prev = am
f.write( " {} (={}) |\n".format(" / ".join(names), i) )
f.write( "| | {} | |\n".format(" | ".join(versions)) )
f.write( "\n" )
def collect(fs_path):
collected = list()
......@@ -168,18 +163,24 @@ def main():
f.write( "# NtQueryInformationFile\n" )
print_table( f, collected, "NtQueryInformationFile", "FILE_INFORMATION_CLASS" )
f.write( "\n" )
f.write( "# NtSetInformationFile\n" )
print_table( f, collected, "NtSetInformationFile", "FILE_INFORMATION_CLASS" )
f.write( "\n" )
f.write( "# NtQueryVolumeInformationFile\n" )
print_table( f, collected, "NtQueryVolumeInformationFile", "FSINFOCLASS" )
f.write( "\n" )
f.write( "# NtSetVolumeInformationFile\n" )
print_table( f, collected, "NtSetVolumeInformationFile", "FSINFOCLASS" )
f.write( "# Legend\n" )
f.write( "\n" )
f.write( "| Icon | Description |\n" )
f.write( "| --- | --- |\n" )
f.write( "| ![U](clock.png) | Not yet supported for this version |\n" )
f.write( "| ![A](plus_green.png) | Started to be supported from this version |\n" )
f.write( "| ![C](arrow_circle_double.png) | Changed from this version |\n" )
f.write( "| ![X](deny_rd_cr.png) | No longer supported from this version |\n" )
f.write( "\n" )
f.write( "# How to generate README.md\n" )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment