This assembly code is a port from Windows 7 SP1 x86 to Windows 8.1 x64 of the code listed by MWR Labs on their PWN-2-OWN write up here: https://labs.mwrinfosecurity.com/blog/2013/09/06/mwr-labs-pwn2own-2013-write-up---kernel-exploit/
The WND variable should contain the address of a win32k!tagWND structure on the Desktop Heap