Annotation of mstools/samples/sdktools/image/drwatson/util.c, revision 1.1.1.1

1.1       root        1: /*++
                      2: 
                      3: Copyright (c) 1993  Microsoft Corporation
                      4: 
                      5: Module Name:
                      6: 
                      7:     util.c
                      8: 
                      9: Abstract:
                     10:     This file implements common utilitarian functions.
                     11: 
                     12: Author:
                     13: 
                     14:     Wesley Witt (wesw) 1-May-1993
                     15: 
                     16: Environment:
                     17: 
                     18:     User Mode
                     19: 
                     20: --*/
                     21: 
                     22: #include <windows.h>
                     23: #include <stdlib.h>
                     24: #include <stdio.h>
                     25: #include <string.h>
                     26: #include <commdlg.h>
                     27: #include <mmsystem.h>
                     28: #include <direct.h>
                     29: 
                     30: #include "drwatson.h"
                     31: #include "proto.h"
                     32: #include "resource.h"
                     33: 
                     34: 
                     35: void
                     36: GetAppName( char *pszAppName, DWORD len )
                     37: {
                     38:     LoadString( GetModuleHandle(NULL), IDS_APPLICATION_NAME, pszAppName, len );
                     39: }
                     40: 
                     41: 
                     42: void
                     43: GetHelpFileName( char *pszHelpFileName, DWORD len )
                     44: {
                     45:     char           szDrive[_MAX_DRIVE];
                     46:     char           szDir[_MAX_DIR];
                     47: 
                     48:     //
                     49:     // find out the path where DrWatson was run from
                     50:     //
                     51:     GetModuleFileName( GetModuleHandle(NULL), pszHelpFileName, len );
                     52: 
                     53:     //
                     54:     // take the path and append the help file name
                     55:     //
                     56:     _splitpath( pszHelpFileName, szDrive, szDir, NULL, NULL );
                     57:     wsprintf( pszHelpFileName, "%s%sdrwtsn32.hlp", szDrive, szDir );
                     58: 
                     59:     return;
                     60: }
                     61: 
                     62: 
                     63: char *
                     64: LoadRcString( UINT wId )
                     65: 
                     66: /*++
                     67: 
                     68: Routine Description:
                     69: 
                     70:     Loads a resource string from DRWTSN32 and returns a pointer
                     71:     to the string.
                     72: 
                     73: Arguments:
                     74: 
                     75:     wId        - resource string id
                     76: 
                     77: Return Value:
                     78: 
                     79:     pointer to the string
                     80: 
                     81: --*/
                     82: 
                     83: {
                     84:     static char buf[1024];
                     85: 
                     86:     LoadString( GetModuleHandle(NULL), wId, buf, sizeof(buf) );
                     87: 
                     88:     return buf;
                     89: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.