Archive

Posts Tagged ‘Windows’

InvokeRequired with anonymous delegates for threading in WinForms!

September 12th, 2009 2 comments

Here’s a little cookie from the cookie jar. To quote the legendary Jon Skeet from Threading with Windows Forms:

There are two different ways of invoking a method on the UI thread, one synchronous (Invoke) and one asynchronous (BeginInvoke). They work in much the same way – you specify a delegate and (optionally) some arguments, and a message goes on the queue for the UI thread to process. If you use Invoke, the current thread will block until the delegate has been executed. If you use BeginInvoke, the call will return immediately. If you need to get the return value of a delegate invoked asynchronously, you can use EndInvoke with the IAsyncResult returned by BeginInvoke to wait until the delegate has completed and fetch the return value.

Here’s a simple, uncluttered version you can utilise and reuse – this example just adds a list item to the listview.

        public void Add(ListViewItem item)
        {
            if (m_ListView.InvokeRequired)
            {
                m_ListView.BeginInvoke(new MethodInvoker(() => Add(item)));
            }
            else
            {
                m_ListView.Items.Add(item);
            }
        }

First we check whether we’re executing on the GUI thread or not (InvokeRequired), then execute a delegate thats parsed into the MethodInvoker calling itself using a lambda expression. This code is VS2008 compatible (.NET 2.0 +).

For a non lambda version:

      
        public void Add(ListViewItem item)
        {
            if (m_ListView.InvokeRequired)
            {
                m_ListView.BeginInvoke(new MethodInvoker(delegate
                                                             {
                                                                 Add(item);
                                                             }));
            }
            else
            {
                m_ListView.Items.Add(item);
            }
        }

The advantage of using an anonymous delegate is that by design, delegates are able to use local variables and parameters scoped in the containing method. Therefore we didn’t need to create a custom delegate with the signature to pass onto the method.

{lang: 'en-GB'}
Share

Lets Get The Party Started: Windows 7 House Party!

September 3rd, 2009 No comments

Excited about Windows 7 launch to the public in October? Organise a party and get some swagger!

Choose a day from October 22-29 and if you’re selected, you’ll not only receive a special Signature Edition of Windows® 7 Ultimate but your very own Windows® 7 Party Pack.

Windows 7 Partaye!

Countries allowed to partaye!

  • Australia
  • Canada
  • France
  • Germany
  • HongKong
  • India
  • Italy
  • Japan
  • Mexico
  • Spain
  • UK
  • USA

Get the details and lets get this party started. (Did I mention I don’t like Pink?)

{lang: 'en-GB'}
Share

Ars Technica reviews Mac OS X 10.6 Leopard

September 2nd, 2009 No comments

The only review you’ll ever need to read for the newly released Apple OS X 10.6 Leopard from Ars.

Having used 10.6 for a few days now (yes believe it or not I do have a couple of Macs at home!) I’ve felt it to be snappier than the original Leopard the Macbook and iMac shipped with. Still my main box is a Windows 7 machine 🙂 But I’d highly recommend installing 10.6 if you’re running 10.5 *after* you’ve made sure all your software is compatible, unfortunately Adobe CS3 is not supported in 10.6 (I mean not working in Snow Leopard), so I went out and got CS4 for Mac.

[Update: No one said anything about CS3 being “not supported” on Snow Leopard. The plan, however, is not to take resources away from other efforts (e.g. porting Photoshop to Cocoa) in order to modify 2.5-year-old software in response to changes Apple makes in the OS foundation.]

Lovely.

{lang: 'en-GB'}
Share

Windows 7 available for MSDN and Technet subscribers!

August 8th, 2009 1 comment

A bit late on this one, Windows 7 has finally hit MSDN and Technet subscribers, go grab your product key and ISO.

Windows 7 MSDN

As posted earlier the Windows 7 hashes remain the same. Dont forget to grab the latest Windows 7 SDK and the RTM version of the Windows API Code Pack for .NET Framework.

From Channel 9:

Enjoy, I’m house hunting this weekend!

{lang: 'en-GB'}
Share

Apple Security: I’m in yo keeboards hax0ring yo porn sitez.

August 2nd, 2009 No comments

I’ll let you decide if this is LOL worthy.

APPLE KEYBOARDS ARE vulnerable to a hack that puts keyloggers and malware directly into the keyboard. This could be a serious problem, and now that the presentation and code is out there, the bad guys will surely be exploiting it.

The vulnerability was discovered by K. Chen, and he gave a talk on it at Blackhat this year. The concept is simple, a modern Apple keyboard has about 8K of flash memory, and 256 bytes of working ram. For the intelligent, this is more than enough space to have a field day.

Nothing is encrypted, decrypted, and the process is simple. You then resume HIDFirmwareUpdaterTool, and in a few seconds, your keyboard is compromised. Formatting the OS won’t do you any good, the code is in keyboard flash. There are no batteries to pull, no nothing, the keyboard is simply compromised.

Then from the proof of concept document:

The application checks a number of properties of the keyboard and checks the validity of the ?rmware image ?le kbd 0x0069 0x0220.irrxfw in the bundle. The ?rmware validity checking routine is called CRC32: and is the 75 byte routine starting at 0x00003005. Despite the name, this routine does not do CRC32 at all and in fact, it simply just adds up the bytes of the ?rmware image ?le and the application veri?es that the sum is 0x252ed7.

EPIC FAIL. While the rest of the world has been working hard on securing the fabrics of their kernel, Apple have concentrated on painting the Lepoard with new stripes. Before you fall into a trap thinking this isn’t as big as they make it out to be – because you need physical (and root) access to update firmware (and the user would have to approve), think of malware or a Safari related exploit. How many security conscience Mac users are there do you think? Wasn’t the original deal move to Mac and forget all your troubles?

Surely Apple can’t be the only keyboard at fault, I’m sure my Razer Tarrantula (with a few modifications) can fall into the same trap – atleast you’d hope so, for Apple’s sake (or not!).

Anyway, woo WINdows 7 to Technet/MSDN guys this week!

{lang: 'en-GB'}
Share

Windows 7 RTMs finally

July 23rd, 2009 4 comments

After many leaks, a public release of RC1 and several premature releases of what cuda been the final RTM we finally have sufficient proof that Windows 7 has infact been Released To Manufacturing (confirmed too!).

Heres a summary of what to know.

Build information

The final build is tagged as 6.1.7600.16385.090713-1255. It was compiled on July 13, 2009, at 12:45pm.

Windows 7 x64 DVD-ISO

7600.16385.090713-1255_x64fre_client_en-us_Retail_Ultimate-GRMCULXFRER_EN_DVD.iso

CRC32: 0x1F1257CA
SHA-1: 0x326327CC2FF9F05379F5058C41BE6BC5E004BAA7

Windows 7 x86 DVD-ISO

7600.16385.090713-1255_x86fre_client_en-us_Retail_Ultimate-GRMCULFRER_EN_DVD.iso

CRC32: 0xC1C20F76
SHA-1: 0x5395DC4B38F7BDB1E005FF414DEEDFDB16DBF610

These hashes and values are from Daniel Melancthon’s blog post.

Release Dates

This is what we know.

General Public October 22nd
OEMS July 24th
Microsoft Partner Program (Gold/Certified) August 16 (English)
October 1st (Other languages)
Businesses with Volume Licensing (Software Assurance) August 1st
Businesses with Volume Licensing (Other) September 1st
MSDN/Technet Subscribers August 6th (English)
October 6th (Other languages)
Microsoft Action Pack August 23rd (English)
October 1st (Other languages)

Thats about it, if you ‘obtained’ a copy from somewhere, give Long Zheng‘s Windows 7 ISO verifier a go to see what you’ve actually got, last thing you’d want is a copy of Vista with a Windows 7 Transformation pack!

6.1.7600.16385.

090713-1255
{lang: 'en-GB'}
Share

Microsoft releases Windows Vista SP2 and Windows 2008 Server SP2

May 27th, 2009 No comments

Quick note to let you know that Microsoft has released Service Pack 2 for Windows 2008 Server & Vista for the general public.

Download: Vista SP2 / Server 2008 SP2 x86Vista SP2 / Server 2008 SP2 x64
Download Size: 348.3 MB | 577.4 MB
Direct Downloads: Windows6.0-KB948465-x86.exe | Windows6.0-KB948465-X64.exe

KB Article: Microsoft KBQ948865

Service Pack 2 Details

x86

Build: 6002.18005.090410-1830
File Name: Windows6.0-KB948465-X86.exe
Size: 365,230,920 bytes
CRC: 3368C777
MD5: C9394FD32DB15619328AF4FF0315750A
SHA1: 106C0484D7449CC4B70353C21D0C0D63E4BA66C3

x64

Build: 6002.18005.090410-1830
File Name: Windows6.0-KB948465-X64.exe
Size: 605,410,472 bytes
CRC: 1737E14D
MD5: A3BCB1FFDB366397FA5FAB0898EB098D
SHA1: BE8D74ADC029FA7350FC1F0D32BEF853C0519A92

Enjoy! You can also slipstream this release into an existing SP1 installation media using vLite, just be weary of a couple of caveats.

{lang: 'en-GB'}
Share

Server Upgrade!

May 25th, 2009 No comments

New servers are now hosting this domain and the WebSoftware Systems, HotHTML domain. There was a temporary hiccup with the DNS’s going a little crazy – my fault, last week but everythings back to norm 🙂 Hopefully with the additional RAM, faster CPU and move to 64bit things should be faster.

{lang: 'en-GB'}
Share

Hot Booty: Visual Studio 2010 Beta Launches!

May 19th, 2009 No comments

Quick note from Somasegars blog that Visual Studio 2010 Beta 1 along with .NET Framework 4.0 Beta 1 is shipping. Take a look at the Visual Studio 2010 Home Page for more information or if you have MSDN grab it from your subscriber downloads.


{lang: 'en-GB'}
Share

Thanks for the memory: Understanding the memory usage in the JVM in Windows and Linux

May 11th, 2009 No comments

I’m nothing special, in fact I’m a bit of a bore
If I tell a joke, you’ve probably heard it before
But I have a talent, a wonderful thing
cause everyone listens when I start to sing
I’m so grateful and proud
All I want is to sing it out loud

Sooo I sang, thank-you for the memory tuning options for the JVM Andrew Hall, you’ve made my day. Andrew has written an excellent article detailing the inner workings of the JVM and how it manages memory, it goes quite deep starting with Kernel vs User Space, how the JVM uses native memory (including some examples to show running out of native memory), how to detect/measure heap usage and finally how to move over to the 64bit world with some caveats (native 64bit binaries for JNI libs etc).

Well worth the read.

{lang: 'en-GB'}
Share