import glob
import tarfile
import subprocess
+import shutil
def make_header():
now = datetime.datetime.now()
file.close()
return expired
-
-def get_configuration_name(debug):
- configuration = 'WindowsVista'
-
- if debug:
- configuration += 'Debug'
- else:
- configuration += 'Release'
-
- return configuration
-
-def get_configuration(debug):
- configuration = 'Windows Vista'
+def get_configuration(release, debug):
+ configuration = release
if debug:
configuration += ' Debug'
return configuration
-
-def get_target_path(arch, debug):
- configuration = get_configuration_name(debug)
-
+def get_target_path(release, arch, debug):
+ configuration = get_configuration(release, debug)
+ name = ''.join(configuration.split(' '))
target = { 'x86': 'proj', 'x64': os.sep.join(['proj', 'x64']) }
- target_path = os.sep.join([target[arch], configuration])
+ target_path = os.sep.join([target[arch], name])
return target_path
def __str__(self):
return repr(self.value)
-def msbuild(name, arch, debug):
+def msbuild(platform, configuration, target, file, args, dir):
+
+ os.environ['PLATFORM'] = platform
+ os.environ['CONFIGURATION'] = configuration
+ os.environ['TARGET'] = target
+ os.environ['FILE'] = file
+ os.environ['EXTRA'] = args
+
cwd = os.getcwd()
- configuration = get_configuration(debug)
+ bin = os.path.join(cwd, 'msbuild.bat')
- os.environ['SOLUTION'] = name
+ os.chdir(dir)
+ status = shell(bin)
+ os.chdir(cwd)
+
+ if (status != None):
+ raise msbuild_failure(configuration)
+
+def build_sln(name, release, arch, debug):
+ configuration = get_configuration(release, debug)
if arch == 'x86':
- os.environ['PLATFORM'] = 'Win32'
+ platform = 'Win32'
elif arch == 'x64':
- os.environ['PLATFORM'] = 'x64'
+ platform = 'x64'
- os.environ['CONFIGURATION'] = configuration
- os.environ['TARGET'] = 'Build'
+ cwd = os.getcwd()
- os.chdir('proj')
- status = shell('msbuild.bat')
- os.chdir(cwd)
+ msbuild(platform, configuration, 'Build', name+'.sln', '', 'proj')
- if (status != None):
- raise msbuild_failure(configuration)
+def remove_timestamps(path):
+ try:
+ os.unlink(path + '.orig')
+ except OSError:
+ pass
+
+ os.rename(path, path + '.orig')
+
+ src = open(path + '.orig', 'r')
+ dst = open(path, 'w')
+
+ for line in src:
+ if line.find('TimeStamp') == -1:
+ dst.write(line)
+
+ dst.close()
+ src.close()
+
+def run_sdv(name, dir):
+ configuration = get_configuration('Windows 8', False)
+ platform = 'x64'
+
+ msbuild(platform, configuration, 'Build', name + '.vcxproj',
+ '', os.path.join('proj', name))
+ msbuild(platform, configuration, 'sdv', name + '.vcxproj',
+ '/p:Inputs="/clean"', os.path.join('proj', name))
+ msbuild(platform, configuration, 'sdv', name + '.vcxproj',
+ '/p:Inputs="/check:default.sdv"', os.path.join('proj', name))
+
+ path = ['proj', name, 'sdv', 'SDV.DVL.xml']
+ remove_timestamps(os.path.join(*path))
+
+ msbuild(platform, configuration, 'dvl', name + '.vcxproj',
+ '', os.path.join('proj', name))
+
+ path = ['proj', name, name + '.DVL.XML']
+ shutil.copy(os.path.join(*path), dir)
def symstore_del(age):
symstore_path = [os.environ['KIT'], 'Debuggers']
shell(' '.join(command))
-def symstore_add(name, arch, debug):
+def symstore_add(name, release, arch, debug):
cwd = os.getcwd()
- configuration = get_configuration_name(debug)
- target_path = get_target_path(arch, debug)
+ target_path = get_target_path(release, arch, debug)
symstore_path = [os.environ['KIT'], 'Debuggers']
if os.environ['PROCESSOR_ARCHITECTURE'] == 'x86':
if __name__ == '__main__':
+
+ driver = 'xeniface'
os.environ['MAJOR_VERSION'] = '7'
os.environ['MINOR_VERSION'] = '2'
os.environ['MICRO_VERSION'] = '0'
symstore_del(30)
- msbuild('xeniface', 'x86', debug[sys.argv[1]])
- msbuild('xeniface', 'x64', debug[sys.argv[1]])
+ release = 'Windows Vista'
+
+ build_sln(driver, release, 'x86', debug[sys.argv[1]])
+ build_sln(driver, release, 'x64', debug[sys.argv[1]])
+
+ symstore_add(driver, release, 'x86', debug[sys.argv[1]])
+ symstore_add(driver, release, 'x64', debug[sys.argv[1]])
- symstore_add('xeniface', 'x86', debug[sys.argv[1]])
- symstore_add('xeniface', 'x64', debug[sys.argv[1]])
+ if len(sys.argv) <= 2 or sys.argv[2] != 'nosdv':
+ run_sdv(driver, driver)
listfile = callfnout(['git','ls-tree', '-r', '--name-only', 'HEAD'])
archive('xeniface\\source.tgz', listfile.splitlines(), tgz=True)
+++ /dev/null
-#!python -u
-
-# Copyright (c) Citrix Systems Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms,
-# with or without modification, are permitted provided
-# that the following conditions are met:
-#
-# * Redistributions of source code must retain the above
-# copyright notice, this list of conditions and the
-# following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the
-# following disclaimer in the documentation and/or other
-# materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
-# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-
-
-import os, sys
-import datetime
-import re
-import glob
-import tarfile
-import subprocess
-
-def shell(command):
- print(command)
- sys.stdout.flush()
-
- pipe = os.popen(command, 'r', 1)
-
- for line in pipe:
- print(line.rstrip())
-
- return pipe.close()
-
-
-class msbuild_failure(Exception):
- def __init__(self, value):
- self.value = value
- def __str__(self):
- return repr(self.value)
-
-def msbuild(batfile, projdir, name, sdv_arg):
- cwd = os.getcwd()
-
- os.environ['CONFIGURATION'] = 'Windows 8 Release'
- os.environ['SDV_PROJ'] = name
- os.environ['SDV_ARG'] = sdv_arg
-
- os.chdir('proj')
- os.chdir(projdir)
- status = shell(batfile)
- os.chdir(cwd)
-
-# if (status != None):
-# raise msbuild_failure(sdv_arg)
-
-
-if __name__ == '__main__':
- msbuild('..\msbuild_sdv.bat', 'xeniface', 'xeniface.vcxproj', '/clean')
-
- msbuild('..\msbuild_sdv.bat', 'xeniface', 'xeniface.vcxproj', '/check:default.sdv')
-
- msbuild('..\msbuild_dvl.bat', 'xeniface', 'xeniface.vcxproj', '')
fail5:
Error("fail5\n");
+#pragma warning(suppress : 6031)
IoSetDeviceInterfaceState(&Fdo->InterfaceName, FALSE);
fail4:
__FdoSetDevicePnpState(Fdo, SurpriseRemovePending);
Irp->IoStatus.Status = STATUS_SUCCESS;
- IoSetDeviceInterfaceState(&Fdo->InterfaceName, FALSE);
- WmiFinalise(Fdo);
+#pragma warning(suppress : 6031)
+ IoSetDeviceInterfaceState(&Fdo->InterfaceName, FALSE);
+ WmiFinalise(Fdo);
IoSkipCurrentIrpStackLocation(Irp);
status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
__FdoSetDevicePnpState(Fdo, Deleted);
Irp->IoStatus.Status = STATUS_SUCCESS;
- IoSetDeviceInterfaceState(&Fdo->InterfaceName, FALSE);
- WmiFinalise(Fdo);
+#pragma warning(suppress : 6031)
+ IoSetDeviceInterfaceState(&Fdo->InterfaceName, FALSE);
+ WmiFinalise(Fdo);
IoSkipCurrentIrpStackLocation(Irp);
status = IoCallDriver(Fdo->LowerDeviceObject, Irp);
{
NTSTATUS status;
- PAGED_CODE();
-
XenIfaceDebugPrint(TRACE, "Create \n");
NTSTATUS status;
- PAGED_CODE();
-
XenIfaceDebugPrint(TRACE, "Close \n");
status = STATUS_SUCCESS;
NTSTATUS status;
- PAGED_CODE();
-
-
XenIfaceDebugPrint(TRACE, "ReadWrite called\n");
status = STATUS_SUCCESS;
if (!NT_SUCCESS(status))
goto fail5;
+#pragma prefast(suppress:6014) // Possibly leaking Fdo->InterfaceName
status = IoRegisterDeviceInterface(PhysicalDeviceObject,
(LPGUID)&GUID_INTERFACE_XENIFACE,
NULL,