From 3da35d0cba1f7a52662ce7c0307ec89d4c6e7e2a Mon Sep 17 00:00:00 2001 From: stansmith Date: Wed, 19 Sep 2007 19:46:45 +0000 Subject: [PATCH] {WinOF-WIX] Make sure %PATH% variable gets updated after install. git-svn-id: svn://openib.tc.cornell.edu/gen1@804 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/tools/nsc/SOURCES | 26 ++++++++++++++++ trunk/tools/nsc/makefile | 8 +++++ trunk/tools/nsc/nsc.c | 67 ++++++++++++++++++++++++++++++++++++++++ trunk/tools/nsc/nsc.rc | 47 ++++++++++++++++++++++++++++ 4 files changed, 148 insertions(+) create mode 100644 trunk/tools/nsc/SOURCES create mode 100644 trunk/tools/nsc/makefile create mode 100644 trunk/tools/nsc/nsc.c create mode 100644 trunk/tools/nsc/nsc.rc diff --git a/trunk/tools/nsc/SOURCES b/trunk/tools/nsc/SOURCES new file mode 100644 index 00000000..d4401bc9 --- /dev/null +++ b/trunk/tools/nsc/SOURCES @@ -0,0 +1,26 @@ +TARGETNAME=nsc +TARGETPATH=..\..\bin\user\obj$(BUILD_ALT_DIR) +TARGETTYPE=PROGRAM +UMTYPE=console +USE_CRTDLL=1 + +SOURCES=nsc.c \ + nsc.rc + +INCLUDES=$(SDK_INC_PATH); + +RCOPTIONS=/I..\..\inc; + +TARGETLIBS=$(SDK_LIB_PATH)\user32.lib $(SDK_LIB_PATH)\ws2_32.lib + +!if $(FREEBUILD) + +!else +C_DEFINES=$(C_DEFINES) -DDEBUG +!endif + +C_DEFINES=$(C_DEFINES) -D__WIN__ + +386_STDCALL=0 + + diff --git a/trunk/tools/nsc/makefile b/trunk/tools/nsc/makefile new file mode 100644 index 00000000..af203a50 --- /dev/null +++ b/trunk/tools/nsc/makefile @@ -0,0 +1,8 @@ +# +# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the driver components of the Windows NT DDK +# + +!INCLUDE ..\..\inc\openib.def + diff --git a/trunk/tools/nsc/nsc.c b/trunk/tools/nsc/nsc.c new file mode 100644 index 00000000..19d102ff --- /dev/null +++ b/trunk/tools/nsc/nsc.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2007 Intel Corporation. All rights reserved. + * + * This software is available to you under a choice of one of two + * licenses. You may choose to be licensed under the terms of the GNU + * General Public License (GPL) Version 2, available from the file + * COPYING in the main directory of this source tree, or the + * OpenIB.org BSD license below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */ + +/* + * broadcast a settings changed message to all top-level windows in the system, + * including disabled or invisible unowned windows, overlapped windows, + * and pop-up windows; message is not sent to child windows. + * + * Utilized to notify top-level windows that an environment variable has + * been modified; specifically PATH. Functionality utilized during WinOF + * installation. + * +*/ +#include +#include +#include +#include + +int main(int argc, char* argv[]) +{ + DWORD dwReturnValue; + LRESULT rc; + + rc = SendMessageTimeout ( HWND_BROADCAST, + WM_SETTINGCHANGE, + 0, + (LPARAM) "Environment", + SMTO_ABORTIFHUNG, + 5000, + (PDWORD_PTR)&dwReturnValue ); + if (rc != 1) + printf("%s() SendMessageTimeout() returns %d\n", + __FUNCTION__,rc); + + return 0; +} + diff --git a/trunk/tools/nsc/nsc.rc b/trunk/tools/nsc/nsc.rc new file mode 100644 index 00000000..92df29a5 --- /dev/null +++ b/trunk/tools/nsc/nsc.rc @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2007 Intel Corporation. All rights reserved. + * + * This software is available to you under the OpenIB.org BSD license + * below: + * + * Redistribution and use in source and binary forms, with or + * without modification, are permitted provided that the following + * conditions are met: + * + * - Redistributions of source code must retain the above + * copyright notice, this list of conditions and the following + * disclaimer. + * + * - Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * $Id$ + */ + + +#include + +#define VER_FILETYPE VFT_APP +#define VER_FILESUBTYPE VFT2_UNKNOWN + +#if DBG +#define VER_FILEDESCRIPTION_STR "Broadcast a setting changed message to root windows (Debug)" +#else +#define VER_FILEDESCRIPTION_STR "Broadcast a setting changed message to root windows" +#endif + +#define VER_INTERNALNAME_STR "notifychange.exe" +#define VER_ORIGINALFILENAME_STR "notifychange.exe" + +#include -- 2.41.0