home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Home
/
Visual_Home_Books_That_Work_1996.iso
/
dll
/
w32schk.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-07-12
|
4KB
|
111 lines
// Function: LibMain
//
// Purpose: C function called from DLL entry point.
//
// Parameters: HINSTANCE hInst; DLL instance handle
// WORD wSeg; DLL data segment selector
// WORD cbHeapSize; DLL initial heap size in bytes
// LPSTR lpszCmdLine; DLL command line
//
// Returns: 1 is success, 0 fail DLL load
//
// Comments:
//
// History: Date Author Reason
//
///////////////////////////////////////////////////////////////////////////////////////
#include <windows.h>
#include <string.h>
int LibMain(HINSTANCE hInst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine)
{
return(1);
}
//***********************************************************************
// Function:
//
// Purpose: Check for support of at least 256 color display
//
// Parameters:
// LPDLLCALLPARAMS lpDllParams; Parameters from Wise
//
// Returns: TRUE if Windows version is not between 3.1 and 4.0
// Comments:
//
// History: Date Author Reason
//
//****************************************************************************BOOL FAR PASCAL IsWin32s11Loaded(LPSTR szVersion)
typedef struct {
WORD wStructLen; // The length of the structure
HWND hWnd; // Handle to main window
WORD wMaxReplaces; // Maximum number of replaces
WORD wRepNameWidth; // The width of a replace name
WORD wRepStrWidth; // The width of each replace string
WORD wCurrReps; // Current number of replace strings
char *lpszRepName; // The actual replace names
char *lpszRepStr; // The actual replace values
BYTE bRunMode; // The installation mode
HFILE fLogFile; // A file handle to the log file
char *lpszParam; // String parameter from Wise Installation System
} DLLCALLPARAMS;
typedef DLLCALLPARAMS far *LPDLLCALLPARAMS;
typedef struct {
BYTE bMajor;
BYTE bMinor;
WORD wBuildNumber;
BOOL fDebug;
} WIN32SINFO, far * LPWIN32SINFO;
BOOL FAR PASCAL _export mustLoadWin32s( LPDLLCALLPARAMS params )
{
BOOL mustLoadWin32s = TRUE; // assume failure
FARPROC pfnInfo;
HANDLE hWin32sys;
WIN32SINFO Info;
char buffer[64];
//lstrcpy(libPath, params->lpszParam);
//lstrcat(libPath, "\\W32SYS.DLL"); /* This will fail if temp is the ROOT (e.g., C:\) */
hWin32sys = LoadLibrary(params->lpszParam);
if (hWin32sys > HINSTANCE_ERROR) {
pfnInfo = GetProcAddress(hWin32sys, "GETWIN32SINFO");
if (pfnInfo) {
// Win32s version is installed
if (!(*pfnInfo)((LPWIN32SINFO) &Info)) {
mustLoadWin32s = FALSE;
#if 0
// Now check version number
if ((Info.bMajor > 1) || ((Info.bMajor == 1) && (Info.bMinor >= 25))) {
mustLoadWin32s = FALSE;
}
#endif
#if 0
wsprintf(buffer, "%d.%d.%d.0",
Info.bMajor, Info.bMinor, Info.wBuildNumber);
MessageBox(params->hWnd, buffer, "Win32s Version", MB_OK);
#endif
} else {
#if 0
MessageBox(params->hWnd, "Pinfo function return false", "Win32s Version", MB_OK);
#endif
}
} else {
#if 0
MessageBox(params->hWnd, "No pinfo", "Win32s Version", MB_OK);
#endif
}
FreeLibrary( hWin32sys );
} else {
#if 0
MessageBox(params->hWnd, params->lpszParam, "No Win32s Lib", MB_OK);
#endif
}
return mustLoadWin32s;
}