Using (Modern) C++ in Driver Development

Wednesday, November 30, 2016

When most developers think of writing a driver, they think of hard core C programming, with C99/C11 usage as a bonus - if they’re lucky. However, C++ can be used today in driver development, but not just for the ability to declare variables at any point in a function (available in C99 as well), but use more useful C++ features, both old and new, available with the C++ 11 and C++14 standards. In the kernel, there is no standard library nor C++ runtime library, which means most types used in user mode are simply unavailable, such as std::string, std::vector,...
no comments

PE Explorer (Work in progress)

Saturday, July 16, 2016

The other day I wanted to take a look at a DLL file and see its imports, exports, resources and other interesting information. There are several tools out there that show part of this information, some of which are not free, so I thought why not create a Portable Executable (PE) Viewer for myself? If nothing else, at least to gain a better understanding of the PE format. The PE format is called "Portable" because it's not essentially tied to Windows and can represent files on any OS. The format has evolved over the years but still retains its backwards...
no comments

Tip for using static in C# 6

Friday, January 1, 2016

One of the new features introduced in C# 6 is the "using static" keyword that is aimed at simplifying repeated access to static members of a particular class. A classic example is using Console.WriteLine a lot. In this case it can be simplified. Instead of: class Program {    static void Main(string args) {        Console.WriteLine("Hello, world!");        Console.WriteLine("This is C# 6 in action!");    }}  We can write: using static System.Console; class Program {    static void Main(string args) {        WriteLine("Hello, world!");        WriteLine("This is C# 6 in action!");    }}  Another common example might be using a lot of math calculations with the static methods of the System.Math class. Here's some method calculating points along the circumference of a circle: static IEnumerable<Point> CalcPoints(double radius, int count) {    for(int i = 0; i < count; i++) {        var x = radius * Math.Cos(2 * Math.PI * i / count);        var y = radius * Math.Sin(2 * Math.PI * i / count);        yield return new Point(x, y);    }}  All that Math stuff can be simplified like so: using static System.Math; … static IEnumerable<Point> CalcPoints(double radius, int count) {    for(int i = 0; i < count; i++) {        var x = radius * Cos(2 * PI * i / count);        var y = radius * Sin(2 * PI * i / count);        yield return new Point(x, y);    }}  Certainly convenient. One feature that is still missing, in my humble opinion, is allowing "using static"...
no comments

Mandelbrot Set with Xamarin Forms (part 1)

Tuesday, August 11, 2015

Reader following my blog already know of my fondness of the Mandelbrot Set. I’ve written versions for WPF, Silverlight, Windows Phone Silverlight, the Windows Runtime and even C++ AMP. Missing still are the Windows 10 Universal Windows Platform and Xamarin Forms. In this post (and the next) I’ll tackle Xamarin Forms. If you’re not familiar with Xamarin Forms, it’s a cross platform library for writing mobile apps for iOS, Android and Windows Phone – all with the C# language and .NET principles. It’s based on “classic” Xamarin, where the application logic could be written just once for all...
no comments

How should the Next WPF Version Look Like?

Friday, June 26, 2015

Microsoft has announced the next WPF version, as part of the new .NET 4.6. I’ve heard the news that WPF is back in development and it made me pretty happy; it was about time! A few months back, Microsoft started to talk about what to expect in this new update. Unfortunately, I was disappointed to see that there’s really nothing new. The feature list is mostly performance enhancements (which should have been done a long time ago), allowing interop with Direct3D 11/12 instead of Direct3D 9 (this was overdue as well), some improvements to the default control templates and...
one comment

Windows 10 Developer Readiness Live Session

Sunday, May 31, 2015

Next week, on June 8th, I’ll be presenting a live session (with my colleague Alon Fliess) on developing with the new Windows Universal Platform on Windows 10, focusing on apps with C# and XAML. This is just one of several such sessions happening all over the world on the week of June 8-12 by MVPs. My session will be in Hebrew with Q&A interactively possible and encouraged. You are all invited! Learn about Windows 10 and the universal windows platform with Visual Studio 2015 with slides and code samples. Register for the session here. The main page for all...
no comments

Build 2015 Impressions

Saturday, May 2, 2015

The Build 2015 conference just ended. It was one of the most important Build/PDC conferences since the Build/PDC inception. Most (if not all) sessions are available on channel 9, and even those that attended Build (myself included) were in only a fraction of the sessions since there were about 10 of them in each time slot. To get a good overview of the various announcements and get links to important downloads, you should head to this post in the Visual Studio blog. What follows are my own impressions and opinions on some of what I experienced at this year’s...
no comments