Determine Remote Desktop Client supported protocol version - remote-desktop

How do I determine the Remote Desktop Protocol version supported by a particular client?
Note that I am NOT asking for the ActiveX control version but the underlying protocol version. As examples from two machines I checked using Help->About (or just About in the case of Windows XP):
On Windows 8, I do NOT want 6.2.9200, I want 8.0.
On Windows XP, I do NOT want 6.0.6001, I want 6.1.
And I am not asking for the protocol version in use in a given session (which is what Determine Remote Desktop Protocol version programatically? is referring to) because we're not in a session, we are validating a client's configuration.
Thanks!

I eventually contact Microsoft about this question and the (somewhat amazing) answer I got back is as follows:
That string is hard-coded and not retrieved from the server or AX (in
fact mstsc.exe checks the build number of mstsax.dll before loading it
to make sure it is consistent with its own build number).
So I guess I will need to fall back on hard-coded OS version information - perhaps the mstsc.exe version. That's yucky but I don't see what choice I have.

Related

Setting up a workflow for autoformatting a git repository (C)

I want to set up a workflow that allows me to have a git repository with a uniform/consistent formatting. The developers (approx. 30) should be able to commit properly formatted changes to their local repository easily, independent of their operating system (either some Linux or Windows 10) and independent from their IDE. Changes shall be pushed to a Linux server which administrates the remote repository.
From my point of view there are two steps necessary to ensure that the remote repository is properly formatted:
Format the current state of repository according to a set of rules.
Format the files affected by every new commit according to these rules.
The first step can be implemented easily by running an auto-formatting tool (e.g. clang-format) on the complete repository. The implementation of the second step can be further divided into two substeps:
2a) Client side: Format a commit properly before pushing it to the server.
2b) Server side: Check if the repository will be properly formatted after the changes of the commit are applied.
The second substep (2b) can be implemented easily (simlar to step 1). However, the implementation of the first substep (2a) is more demanding and I would like to reach out to the community for tipps/tricks/ideas.
So far I've had a closer look on the Eclipse autoformatter and clang-format:
The Eclipse autoformatter can only be used when Eclipse is installed, I haven't found a Eclipse autoformatter standalone application. Is it possible to run the eclipse autoformatter from the command line without a GUI?
clang-format is a unix tool which I cannot install and run standalone on a windows system. I've seen there is a LLVM executable for windows but I am not sure if the installation will inflict any undesired changes to my system. Is anybody using LLVM/clang-format on windows?
Are there other auto-formatting tools for C which work on Linux and Windows 10? Is anybody successfully using python scripts for this purpose?

How to transfer a file from Windows XP to a virtual machine inside vSphere 5.5?

I have a file on my desktop that I need to put onto one of the virtual machines, however when I search for solutions on how to do this many say to download third party software to do it, or to use drag and drop through vSphere. The issue is I am on a restricted network and can't install additional software, and also don't have the drag an drop functionality in vSphere.
I have seen it done in the past using the command line and the IP address of the machine I want to send it to, along with the username and password, however I can't remember the syntax. Can anyone provide instruction on what to type into the terminal to do this?
Have you given the Copy-VMGuestFile cmdlet a look from PowerCLI?
http://www.vmware.com/support/developer/PowerCLI/PowerCLI651/html/Copy-VMGuestFile.html
If you're not a fan of PowerShell, there's a couple SDK options you could use with the vSphere Web Services API. Specifically, you're looking for the GuestFileManager object and the InitiateFileTransferToGuest method: http://pubs.vmware.com/vsphere-5-5/topic/com.vmware.wssdk.apiref.doc/vim.vm.guest.FileManager.html

Which cab should I deploy to my handheld device to install CF version 2?

Based on what I read here, in order to install CF version 2 on my handheld device, I should copy over one of the cab files here:
...but which one?
The device in question is a Symbol 3090, which currently has only CF version 1.0.3316.00 (1.0 SP2) installed. The OS version of the device is 05.00.1400
The device CPU is presumably 'ARMV4I' as a similar device (Motorola 3190) says that it is equipped with such.
UPDATE
Based on what I see here when I click "this link" here:
-- OR -- If you have Windows Mobile 5 or newer on your device, click this link and save the file to the desktop of your computer.
...it seems "NETCFv2.wm.armv4i.cab" is probably the best choice.
Any refutations?
UPDATE 2
I copied the file I reckoned to be the one, and clicked it on the device, but:
What in Sam L. Clemens' illustrious memory is going on here?!?
UPDATE 3
I then copied over the other file from the link above, which was slightly different (2.12MB as opposed to 2.14MB, for one thing), and tried to run it, and got the same err msg as above.
UPDATE 4
Trying to install from the last link, I see:
UPDATE 5
Actually, it turns out that what I might really need is to install CF version 1 after a cold boot of the device...but I don't know if version 1 of CF is still available. That's the only version the existing .exe will run on, but my PC only has cab files for versions 2 and 3.5...???
UPDATE 6
In the most recent version of the .exe (builds and compiles, but won't run on either device), it has three, count 'em three mscorlibs in its References area; the versions are:
1.0.5000.0
2.0.0.0
3.5.0.0
They all have the same public key token (the same as shown in the screen shot)
The only other multi-reference is System, which has both version 2 and 3.5
AND, below System.Xml, there are three coredll.dlls, albeit spelled differently:
coredll.dll
CoreDll.dll
CoreDll.DLL
(no info for any of them...???)
UPDATE 7
I copied NETCFv2.wce4.ARMV4.cab to the 3090.
I 2-clicked it on the device, but got this:
And so, I retreated (selected "No").
Thus continue unabated the travails of an accidental handheld developer.
UPDATE 8
The project is set to Framework Version == v2.0, Platform == Windows CE, Target Device == Windows Mobile 6 Classic Emulator (one of the few emulator choices I have), and the output shows that it is ARMV4i that is being deployed:
Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i
\sqlce.ppc.wce5.armv4i.CAB'
Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i
\sqlce.repl.ppc.wce5.armv4i.CAB'
Deploying '%CSIDL_PROGRAM_FILES%\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\ARMV4i
\sqlce.dev.enu.ppc.wce5.armv4i.CAB'
Deploying 'C:\Program Files (x86)\Motorola EMDK for .NET\v2.8\SDK\Smart Devices\wce500\armv4i\symbol.all.arm.cab'
And when I run the .exe in the emulator, it fails with, "Error - An unexpected error has occurred in Platypus.exe
Select Quit and restart this program, or select Details for more information.
This application requires a newer version of the MS .NET Compact Framework than the version installed on this device."
Selecting the "Details" button augments the mental anguish with, "TypeLoadException
This application requires a newer version of the MS .NET Compact Framework than the version installed on this device."
Assuming your are using the WinCE 4.2 version of the 3090 (it comes in 4.2 and 5.0), you should proceed with the install using NETCFv2.wce4.ARMV4.cab. "The program is not compatible..." message is a warning only, and not a very smart one. There is even a way to edit the cab to remove that warning if you wanted to, though my memory fails me on the exact way to do it. I've had to do it to allow a silent install before (otherwise the nag screen gets in your way).
First you need to figure out what version of CE you are running. You can find this by going to System Properties. Also while you are in System Properties note what processor you are running ( arm, mips ...). If you are running windows ce 4.2 or higher you will pick a cab file out of the wce400 folder. If you are running windows CE 5.0 or higher you will pick a cab file out of the wce500 folder. Note you can't install .net 2.0 on windows ce 4.1 or lower, according to Microsoft documentation, however, I have noticed that the minimum version setting on the cab files is 4.0, so you might be able to hack it.
Like I said before on also the System Properties page is the type of processor you are using. From that select the appropriate sub-folder in either wce400 or wce500. In most of the folders for each processor there should be only one cab file. If there is more than one cab file see if the file name contains wm for windows mobile, wce for windows ce, or ppc for pocket PC and pick the one most appropriate for you.
You can also take the guess work out of this whole process by creating an ini file with the fallowing text and using ceappmgn.exe to pick and install the right cab file for you.
[CEAppManager]
Version = 1.0
Component = NETCF
[NETCF]
Description = .NET Compact Framework v2.0
CabFiles=wce400\armv4\NETCFv2.ppc.armv4.cab,wce400\armv4\NETCFv2.wce4.ARMV4.cab,wce400\mipsii\NETCFv2.wce4.MIPSII.cab,wce400\mipsiv\NETCFv2.wce4.MIPSIV.cab,wce400\sh4\NETCFv2.wce4.sh4.cab,wce400\x86\NETCFv2.wce4.x86.cab,wce500\armv4i\NETCFv2.wm.armv4i.cab,wce500\mipsii\NETCFv2.wce5.mipsii.cab,wce500\mipsiv\NETCFv2.wce5.mipsiv.cab,wce500\sh4\NETCFv2.wce5.sh4.cab,wce500\armv4i\NETCFv2.wce5.armv4i.cab

File System Filter MiniDriver

I have a Program.exe that I need to intercept. That specific program uses CreateFile & ReadFile, however I need to intercept ReadFile function.
I thought about writing my own File System Filter MiniDriver.
I found this link by Googling: http://msdn.microsoft.com/en-us/library/ff551862(v=vs.85)
It seems that is the correct way to do this. However last time I did any driver development, I remember that >= VISTA did not allow drivers to be installed easily. You needed to acquire "Signed" priviledge from Microsoft(you had to pay).
My question is that, can I create Simple File System Filter Driver for my USB stick and intercept any readings from ReadFile()? All I want to do is to allow ReadFile by a specific process.
1) I need this legally
2) I need to avoid unsigned drivers, so the driver would always work.
Will one minifilter driver work for every OS starting from XP?!
Prohibit of loading unsigned drivers is exist only on x64 versions of windows >= vista
On x64 versions you can
1) Switch to test mode to turm off this restriction
2) Add test sertificate as root to certificate storage
But if you want distribute this driver you must bay certificate.
Yes, minifilter is the preferred way for this. You can intercept system calls/IRPs and allow-deny any of them depending upon your criteria.
Also, same driver code can be used for multiple OSes, however you need to build for specific Os.
WDK 7 can be used to build drivers from XP to Windows 7.
Also, as izlesa suggested, you need to sign for x64 windows higher than vista.

Windows display driver hooking, 64 bit

Once I've written a sort of a driver for Windows, which had to intercept the interaction of the native display driver with the OS. The native display driver consists of a miniport driver and a DLL loaded by win32k.sys into the session space. My goal was to meddle between the win32k.sys and that DLL. Moreover, the system might have several display drivers, I had to hook them all.
I created a standard WDM driver, which was configured to load at system boot (i.e. before win32k). During its initialization it hooked the ZwSetSystemInformation, by patching the SSDT. This function is called by the OS whenever it loads/unloads a DLL into the session space, which is exactly what I need.
When ZwSetSystemInformation is invoked with SystemLoadImage parameter - one of its parameters is the pointer to a SYSTEM_LOAD_IMAGE structure, and its ModuleBase is the module base mapping address. Then I analyze the mapped image, patch its entry point with my function, and the rest is straightforward.
Now I need to port this driver to a 64-bit Windows. Needless to say it's not a trivial task at all. So far I found the following obstacles:
All drivers must be signed
PatchGuard
SSDT is not directly exported.
If I understand correctly, PatchGuard and driver signing verification may be turned off, the driver should be installed on a dedicated machine, and we may torture it the way we want.
There're tricks to locate the SSDT as well, according to online sources.
However recently I've discovered there exists a function called PsSetLoadImageNotifyRoutine. It may simplify the task considerably, and help avoid dirty tricks.
My question are:
If I use PsSetLoadImageNotifyRoutine, will I receive notifications about DLLs loaded into the session space? The official documentation talks about "system space or user space", but does "system space" also includes the session space?
Do I need to disable the PatchGuard if I'm going to patch the mapped DLL image after it was mapped?
Are there any more potential problems I didn't think about?
Are there any other ways to achieve what I want?
Thanks in advance.
Do I need to disable the PatchGuard if I'm going to patch the mapped DLL image after it was mapped?
To load any driver on x64 it must be signed. With admin rights you can disabled PatchGuard and I personally recommend using DSEO, a GUI application made for this. Or you can bypass PatchGuard by overwriting the MBR (or BIOS), although this is typically considered a bootkit - malware.

Resources