source: trunk/kStuff/kLdr/kLdr-win.c

Last change on this file was 3601, checked in by bird, 18 years ago

license update.

  • Property svn:keywords set to Id
File size: 2.4 KB
RevLine 
[2834]1/* $Id: kLdr-win.c 3601 2007-10-29 00:21:13Z bird $ */
[2833]2/** @file
3 * kLdr - The Dynamic Loader, Windows Specifics.
[3601]4 */
5
6/*
7 * Copyright (c) 2006-2007 knut st. osmundsen <bird-kStuff-spam@anduin.net>
[2833]8 *
[3601]9 * This file is part of kStuff.
[2833]10 *
[3601]11 * kStuff is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
[2833]15 *
[3601]16 * In addition to the permissions in the GNU Lesser General Public
17 * License, you are granted unlimited permission to link the compiled
18 * version of this file into combinations with other programs, and to
19 * distribute those combinations without any restriction coming from
20 * the use of this file.
[2833]21 *
[3601]22 * kStuff is distributed in the hope that it will be useful,
[2833]23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
[3601]24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * Lesser General Public License for more details.
[2833]26 *
[3601]27 * You should have received a copy of the GNU Lesser General Public
28 * License along with kStuff; if not, write to the Free Software
29 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
30 * 02110-1301, USA
[2833]31 */
32
33/*******************************************************************************
34* Header Files *
35*******************************************************************************/
36#include <Windows.h>
37
[3570]38#include <k/kLdr.h>
[2833]39#include "kLdrInternal.h"
40
41
42/**
43 * The DLL main function.
44 *
45 * @returns TRUE / FALSE.
46 * @param hDllHandle The dll handle.
47 * @param dwReason The reason we're being called.
48 * @param lpReserved Reserved.
49 */
50BOOL __stdcall DllMain(HANDLE hDllHandle, DWORD dwReason, LPVOID lpReserved)
51{
52 switch (dwReason)
53 {
54 case DLL_PROCESS_ATTACH:
[2865]55 {
56 int rc = kldrInit();
57 return rc == 0;
58 }
[2833]59
60 case DLL_PROCESS_DETACH:
[2865]61 kldrTerm();
[2833]62 return TRUE;
63
64 case DLL_THREAD_ATTACH:
[2865]65 {
66 //int rc = kLdrDyldThreadAttach();
67 //return rc == 0;
68 return TRUE;
69 }
70
[2833]71 case DLL_THREAD_DETACH:
[2865]72 //kLdrDyldThreadDetach();
[2833]73 return TRUE;
74
75 default:
76 return FALSE;
77 }
78}
79
Note: See TracBrowser for help on using the repository browser.