]> xenbits.xensource.com Git - pvdrivers/win/xencons.git/log
pvdrivers/win/xencons.git
7 years agoDestroy all handles on FdoD0ToD3
Owen Smith [Mon, 11 Sep 2017 20:04:22 +0000 (13:04 -0700)]
Destroy all handles on FdoD0ToD3

Since the StreamWorker holds a reference to the XENBUS_CONS interface,
xenbus will BUG_ON if the handles are not cleaned up before power down.
The service should close all handles in response to a
DBT_DEVICEQUERYREMOVE notification, but this may not be issued on
system power down.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Added missing UNREFERENCED_PARAMETER() to fix build failure.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoCancel all outstanding IRPs in StreamDestroy
Owen Smith [Tue, 29 Aug 2017 11:05:02 +0000 (12:05 +0100)]
Cancel all outstanding IRPs in StreamDestroy

After IRP_MJ_CLEANUP completes, all outstanding IRPs (for that FileObject)
are cancelled. This would attempt to use the cancel safe queue and list
which are now zeroed, and lead to a 0xCC Bugcheck.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
7 years agoFlush and Disconnect pipe clients
Owen Smith [Tue, 29 Aug 2017 11:03:22 +0000 (12:03 +0100)]
Flush and Disconnect pipe clients

Named pipes should be flushed and disconnected before closed.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
7 years agoUse PutString to manage short WriteFile
Owen Smith [Tue, 29 Aug 2017 10:25:51 +0000 (11:25 +0100)]
Use PutString to manage short WriteFile

PutString will now deal in UCHARs, so the calculated lengths need to be
translated into byte counts.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
7 years agoEnsure handles are closed when pipe disconnects
Owen Smith [Tue, 29 Aug 2017 10:07:48 +0000 (11:07 +0100)]
Ensure handles are closed when pipe disconnects

Fixes leaks where the pipe handles were not closed, preventing new
connections. Fixes the MONITOR_PIPE context leaking when its thread
is stopped.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Since error gotos are introduced, have them do the cleanup. The scope of
Pipe and Instance needs to be widened but it keeps the code neater overall.
Also removed the unnecessary newlines in the log messages.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoRemove ZwFlushKey() from registry code
Paul Durrant [Thu, 3 Aug 2017 10:35:54 +0000 (11:35 +0100)]
Remove ZwFlushKey() from registry code

Attempting to flush registry keys early in boot causes an error to be
logged.

This patch therefore removes the explicit flushes from the registry code.
There is no option but to trust Windows lazy flush.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoAdd option to not spawn child process.
Owen Smith [Tue, 25 Jul 2017 13:13:19 +0000 (14:13 +0100)]
Add option to not spawn child process.

If the "Executable" registry parameter is not found, do not spawn
a child process instead of failing.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
Removed unnecessary hunk checking value for NULL before passing to
free().

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoLaunch monitored process without command line
Owen Smith [Tue, 25 Jul 2017 13:09:34 +0000 (14:09 +0100)]
Launch monitored process without command line

Changed tty to open named pipe by name, not command line argument

Signed-off-by: Owen Smith <owen.smith@citrix.com>
7 years agoPass data through pipe
Owen Smith [Tue, 25 Jul 2017 12:47:37 +0000 (13:47 +0100)]
Pass data through pipe

All data read during the DeviceThread will be passes to all named pipes.
All data read from any named pipe will be passed to the device.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
7 years agoAdd named pipe server
Owen Smith [Tue, 25 Jul 2017 12:39:30 +0000 (13:39 +0100)]
Add named pipe server

Create a threaded NamedPipe server for the device.
This will be used to pass data from the console to child processes, and
read data from the child processes to pass to the console device.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
s/memset/ZeroMemory
Add a '__' prefix to forceinlined list manipulation primitives

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoAdd asynchronous device polling thread
Owen Smith [Tue, 25 Jul 2017 12:26:27 +0000 (13:26 +0100)]
Add asynchronous device polling thread

Adds a thread that will asynchrously read the device handle.
This will be used to read console data from the device, for passing
to the named pipe.

Signed-off-by: Owen Smith <owen.smith@citrix.com>
s/memset/ZeroMemory

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
7 years agoRename ThreadEvent and Thread to Monitor[Event|Thread]
Owen Smith [Tue, 25 Jul 2017 12:14:06 +0000 (13:14 +0100)]
Rename ThreadEvent and Thread to Monitor[Event|Thread]

Add clarity to the variables used with the MonitorThread

Signed-off-by: Owen Smith <owen.smith@citrix.com>
7 years agoAdd BUILD.md and fix final package location
Paul Durrant [Thu, 18 May 2017 11:05:54 +0000 (12:05 +0100)]
Add BUILD.md and fix final package location

Microsoft helpfully removed the PackageDir property from package projects
in VS2015 so, as an interim fix, OutDir was used. This unfortunately means
that package output ends up in xencons/<arch>/package rather than just
xencons/<arch>.

This patch fixes the final package location by using python to do the
final copy (replacing what older VS used to do) and also adds a BUILD.md,
which was missing.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoSquash a spurious warning that is breaking SDV
Paul Durrant [Fri, 5 May 2017 16:09:24 +0000 (17:09 +0100)]
Squash a spurious warning that is breaking SDV

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoAdd a TTY utility
Paul Durrant [Fri, 5 May 2017 15:02:26 +0000 (16:02 +0100)]
Add a TTY utility

This patch adds a new TTY utility which will open the console device and
pipe it to a command shell (cmd.exe) process. It also provides login
functionality for a local user such that the command shell is invoked as
that user.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoAdd a monitor service
Paul Durrant [Fri, 5 May 2017 14:45:06 +0000 (15:45 +0100)]
Add a monitor service

This patch adds a basic service to monitor the xencons interface.

All it does is open the interface when it becomes available and close it
down when either the device is going away, or the service is being
stopped.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoAdd console functionality
Paul Durrant [Fri, 5 May 2017 14:24:27 +0000 (15:24 +0100)]
Add console functionality

This patch adds a new interface so that user-space code can open a
character device to the PV console along with all the necessary dispatch
handling for basic functionality.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoAdd basic driver and associated build scripts
Paul Durrant [Fri, 5 May 2017 14:02:24 +0000 (15:02 +0100)]
Add basic driver and associated build scripts

This driver is just the necessary boilerplate for PnP, Power and basic
interaction with XENBUS.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
8 years agoInitial commit
Paul Durrant [Fri, 5 May 2017 10:59:18 +0000 (11:59 +0100)]
Initial commit

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>