~unity-team/nux/nux-0.9-dispose-calls-unreference

« back to all changes in this revision

Viewing changes to NuxCore/NSystemWindows.cpp

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-01 19:25:37 UTC
  • Revision ID: neil.patel@canonical.com-20100901192537-mfz7rm6q262pewg6
Import and build NuxCore

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "NKernel.h"
 
2
 
 
3
#pragma pack(push,8)
 
4
#include <string.h>
 
5
#include <TlHelp32.h>                           // For module info.
 
6
#include <DbgHelp.h>                            // For stack walker.
 
7
#include <psapi.h>
 
8
#pragma pack(pop)
 
9
 
 
10
 
 
11
NAMESPACE_BEGIN
 
12
 
 
13
void* GetDllHandle( const TCHAR* Filename )
 
14
{
 
15
    nuxAssert(Filename);        
 
16
    return CALL_OS_TCHAR_FUNCTION(LoadLibraryW(Filename),LoadLibraryA(TCHAR_TO_ANSI(Filename)));
 
17
}
 
18
 
 
19
//
 
20
// Free a DLL.
 
21
//
 
22
void FreeDllHandleappFreeDllHandle( void* DllHandle )
 
23
{
 
24
    nuxAssert(DllHandle);
 
25
    FreeLibrary( (HMODULE)DllHandle );
 
26
}
 
27
 
 
28
//
 
29
// Lookup the address of a DLL function.
 
30
//
 
31
void* GetDllExport( void* DllHandle, const TCHAR* ProcName )
 
32
{
 
33
    nuxAssert(DllHandle);
 
34
    nuxAssert(ProcName);
 
35
    return (void*)GetProcAddress( (HMODULE)DllHandle, TCHAR_TO_ANSI(ProcName) );
 
36
}
 
37
 
 
38
NAMESPACE_END
 
39