Back to index

php5  5.3.10
deplister.c
Go to the documentation of this file.
00001 /*
00002   +----------------------------------------------------------------------+
00003   | PHP Version 5                                                        |
00004   +----------------------------------------------------------------------+
00005   | Copyright (c) 1997-2010 The PHP Group                                |
00006   +----------------------------------------------------------------------+
00007   | This source file is subject to version 3.01 of the PHP license,      |
00008   | that is bundled with this package in the file LICENSE, and is        |
00009   | available through the world-wide-web at the following url:           |
00010   | http://www.php.net/license/3_01.txt                                  |
00011   | If you did not receive a copy of the PHP license and are unable to   |
00012   | obtain it through the world-wide-web, please send a note to          |
00013   | license@php.net so we can mail you a copy immediately.               |
00014   +----------------------------------------------------------------------+
00015   | Author: Wez Furlong <wez@thebrainroom.com>                           |
00016   +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: deplister.c 293036 2010-01-03 09:23:27Z sebastian $ */
00020 
00021 /* This little application will list the DLL dependencies for a PE
00022  * module to it's stdout for use by distro/installer building tools */
00023 
00024 #include <windows.h>
00025 #include <imagehlp.h>
00026 
00027 BOOL CALLBACK StatusRoutine(IMAGEHLP_STATUS_REASON reason,
00028               PSTR image_name, PSTR dll_name,
00029               ULONG va, ULONG param)
00030 {
00031        switch (reason) {
00032               case BindImportModuleFailed:
00033                      printf("%s,NOTFOUND\n", dll_name);
00034                      return TRUE;
00035 
00036               case BindImportModule:
00037                      printf("%s,OK\n", dll_name);
00038                      return TRUE;
00039        }
00040        return TRUE;
00041 }
00042 
00043 /* usage:
00044  * deplister.exe path\to\module.exe path\to\symbols\root
00045  * */
00046 
00047 int main(int argc, char *argv[])
00048 {
00049        return BindImageEx(BIND_NO_BOUND_IMPORTS | BIND_NO_UPDATE | BIND_ALL_IMAGES,
00050               argv[1], NULL, argv[2], StatusRoutine);   
00051 }
00052 
00053 /*
00054  * Local variables:
00055  * tab-width: 4
00056  * c-basic-offset: 4
00057  * End:
00058  * vim600: noet sw=4 ts=4 fdm=marker
00059  * vim<600: noet sw=4 ts=4
00060  */