Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Recommend me some books

Options
  • 18-10-2009 6:21pm
    #1
    Closed Accounts Posts: 248 ✭✭


    I'm looking for a recommendation for books on the following -

    1. WinAPI/Win32 API programming
    2. Low level windows system programming, stuff like device drivers, hooking, how security is handled, etc...


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    The Windows SDK would be a good place to start.


  • Registered Users Posts: 515 ✭✭✭NeverSayDie


    Charles Petzold's "Programming Windows" is considered a bit of a bible for Win32 programming;
    http://www.amazon.co.uk/Programming-Windows-5th-Book-Package/dp/157231995X


  • Registered Users Posts: 1,228 ✭✭✭carveone


    Charles Petzold's "Programming Windows" is considered a bit of a bible for Win32 programming;
    http://www.amazon.co.uk/Programming-Windows-5th-Book-Package/dp/157231995X

    I was going to say that that book is expensive but at 37 quid at current exchange rates, I'll have one of those! And amazon have just sent me an email saying Super Saver delivery is now in Ireland.

    I learnt Win32 from TheForger's Win32 tutorial and anything weird like threading and system programming from codeproject and msdn. Mark Russinovich has a book and a blog if you want to scare yourself.


  • Closed Accounts Posts: 248 ✭✭bSlick


    Charles Petzold's "Programming Windows" is considered a bit of a bible for Win32 programming;
    http://www.amazon.co.uk/Programming-Windows-5th-Book-Package/dp/157231995X

    Looks good, however I see it was published in 1998. Is the win32 api unchanged, will the code in this book work in xp/vista?

    And is it worth learning any .net stuff? Well using .net speed up application development?


  • Registered Users Posts: 1,228 ✭✭✭carveone


    bSlick wrote: »
    Looks good, however I see it was published in 1998. Is the win32 api unchanged, will the code in this book work in xp/vista?

    And is it worth learning any .net stuff? Well using .net speed up application development?

    Yes, it's an older book but still seems to be the one to use. There have been API additions and updates (if you see Ex on the end of a function that's an update - you'd use CreateWindowEx rather than CreateWindow for example) but that is what MSDN is for. If it runs on Windows 98 it will run on XP.

    The trend is towards managed application development using C# and VB.net and other trendy .Net things that need a whopping great runtime lib. If you were doing this for employment purposes that's likely what you'd be doing. There's still absolutely no harm in knowing the Win32 API though and MFC is confusing without knowing the API basics. Of course I'm a crufty old bollox that refuses to even use C++ and somehow I don't believe you can do Device Drivers in C#! If you can do COM in C, then C++ can stuff itself :)


  • Advertisement
  • Registered Users Posts: 2,150 ✭✭✭dazberry


    Charles Petzold's "Programming Windows" is considered a bit of a bible for Win32 programming;
    http://www.amazon.co.uk/Programming-Windows-5th-Book-Package/dp/157231995X

    I picked up a slightly older version (1996) in town a number of years ago for a tenner - can't go wrong with that.

    I also came across Win32 System Services back in the day. Got A LOT of use out of it - well worth it great book. Doesn't deal with hWnd stuff btw.

    D.


  • Registered Users Posts: 515 ✭✭✭NeverSayDie


    bSlick wrote: »
    Looks good, however I see it was published in 1998. Is the win32 api unchanged, will the code in this book work in xp/vista?

    And is it worth learning any .net stuff? Well using .net speed up application development?

    API's pretty much the same - there's a lot of extra stuff, every version of Windows adds a good deal of support for new features, fixes, etc etc. They're big on backwards compatibility though, so yeah, I'd imagine the basic stuff should mostly work fine, certainly up to XP at least. Some specific subsystems did change pretty substantially in Vista, so there may be new stuff to learn there, but Petzold would still give you a good reference for Win32 stuff. There are probably newer and better books in the meantime, I'd take a look around - the related/recommended features on that Amazon page will probably turn some up.

    Re .NET speeding up application development, yeah, bigtime. It's a lot closer to things like Java or Ruby than to C (though as with Java, C# syntax is pretty close to C++). If you want to do Windows GUI development in particular, I'd very strongly recommend Windows Forms over tech like MFC, assuming you have the option. The newer WPF stuff will give you a lot more power and flexibility for GUI design, though the learning curve seems to be higher.

    Keep in mind it's still worth being familiar with Win32 if you're doing Windows development though .NET. For instance, various lower level desktop functionality (manipulating the other windows on the desktop for instance) isn't exposed through the .NET Framework, so you need to make calls to Win32 functions to do some of that stuff (You still make the calls through .NET using P/Invoke, but calling Win32 API directly though).

    Also, as carveone points out, it isn't feasible to write Windows device drivers in .NET code - you'd be using C/C++ for that. Google for "WDK" if you want to get into that stuff. Used to be the Windows DDK, they have the WDK now apparently - the driver system is one aspect that changed quite a bit with the Vista update. Don't know much about it now, apparently driver development was a bit of a bastard on the old system at least.


  • Registered Users Posts: 981 ✭✭✭fasty


    Petzold's book is pretty good, but it doesn't really touch upon things like common controls, and I found his section on threading to be only okay. Not that I have a better book suggestion, I just learned what I could from online docs and what I could glean from open source Win32 based software.


  • Registered Users Posts: 515 ✭✭✭NeverSayDie


    Having poked around Amazon a bit; re Windows' inner workings (especially the more recent changes in the Vista generation), this book looks promising;
    http://www.amazon.co.uk/gp/product/0735625301
    Might pick up a copy myself in fact.


  • Closed Accounts Posts: 1,567 ✭✭✭Martyr


    bSlick wrote:
    ...hooking...

    sometimes called 'code splicing', there are some very good articles/source code out there about this already.

    microsoft use this method for 'hot patching' their o/s

    Registry monitor by mark rusinovich was actually the first source code i saw using the method in kernel land..most of the rootkits that developed later, not to mention many anti-virus and firewalls are probably based on it.

    actually, if you read rootkits book, you can see snippets of regmon in there without the author acknowledging where he got it.

    It's a little outdated but still relevant foundation work of what you need to know.
    The best info is already freely available online in e-zines and various other articles.


  • Advertisement
Advertisement