NOT PART OF BUILD. Fixed makefile.win to work with new REQUIRES feature & generate an error when MOZ_PLUGINSDK is undefined. Changed legacy plugin to parse CLSIDs properly.

This commit is contained in:
locka%iol.ie 2001-10-10 14:07:23 +00:00
Родитель 8fbc0669f0
Коммит b0c4e7acce
2 изменённых файлов: 59 добавлений и 26 удалений

Просмотреть файл

@ -156,23 +156,23 @@ NPError NewControl(const char *pluginType,
// The first example is the proper way
char szCLSID[256];
if (strnicmp(argv[i], "CLSID:", 6) == 0)
{
char szTmp[256];
sscanf(argv[i], "CLSID:%s", szTmp);
sprintf(szCLSID, "{%s}", szTmp);
}
else if(argv[i][0] != '{')
{
sprintf(szCLSID, "{%s}", argv[i]);
}
else
{
strncpy(szCLSID, argv[i], sizeof(szCLSID));
}
USES_CONVERSION;
CLSIDFromString(A2OLE(szCLSID), &clsid);
if (strlen(argv[i]) < sizeof(szCLSID))
{
if (strnicmp(argv[i], "CLSID:", 6) == 0)
{
sprintf(szCLSID, "{%s}", &argv[i][6]);
}
else if(argv[i][0] != '{')
{
sprintf(szCLSID, "{%s}", argv[i]);
}
else
{
strncpy(szCLSID, argv[i], sizeof(szCLSID));
}
USES_CONVERSION;
CLSIDFromString(A2OLE(szCLSID), &clsid);
}
}
else if (stricmp(argn[i], "NAME") == 0)
{
@ -183,13 +183,22 @@ NPError NewControl(const char *pluginType,
{
szCodebase = tstring(A2T(argv[i]));
}
else if (strnicmp(argn[i], "PARAM_", 6) == 0)
else
{
USES_CONVERSION;
std::wstring szName(A2W(argn[i] + 6));
std::wstring szName;
std::wstring szParam(A2W(argv[i]));
if (strnicmp(argn[i], "PARAM_", 6) == 0)
{
szName = A2W(argn[i]+6);
}
else
{
szName = A2W(argn[i]);
}
// Empty parameters are ignored
if (szName.empty())
{
@ -236,6 +245,11 @@ NPError NewControl(const char *pluginType,
}
}
// Make sure we got a CLSID
if (memcmp(&clsid, &CLSID_NULL, sizeof(CLSID)) == 0)
{
return NPERR_GENERIC_ERROR;
}
// Create the control site
CControlSiteInstance *pSite = NULL;

Просмотреть файл

@ -23,15 +23,34 @@ DLLNAME = npmozax
QUIET =
DEPTH =..\..\..\..\..
# Specify the path to the Communicator plugin SDK or get the default!
REQUIRES = \
java \
$(NULL)
# Specify the path to the Communicator plugin SDK or get an error message!
!ifndef MOZ_PLUGINSDK
MOZ_PLUGINSDK = M:\PluginSDK
!message Build cannot proceed without knowing where your Plugin SDK is installed.
!message Please specify the path to the SDK either by setting the MOZ_PLUGINSDK
!message environment variable or as a parameter to nmake. e.g.
!message
!message set MOZ_PLUGINSDK=c:\pluginsdk
!message nmake /f makefile.win
!message
!message Or:
!message
!message nmake /f makefile.win MOZ_PLUGINSDK=c:\pluginsdk
!message
!message The Plugin SDK can be found at:
!message
!message ftp://ftp.netscape.com/pub/sdk/plugin/windows/winsdk40.zip
!message
!error
!endif
# The default is to include control support unless told to do otherwise
MOZ_ACTIVEX_PLUGIN_SUPPORT = 1
MOZ_ACTIVEX_PLUGIN_LIVECONNECT = 1
# MOZ_ACTIVEX_PLUGIN_LIVECONNECT = 1
MAKE_OBJ_TYPE = DLL
DLL=.\$(OBJDIR)\$(DLLNAME).dll
@ -85,9 +104,9 @@ include <$(DEPTH)\config\rules.mak>
!ifdef MOZ_ACTIVEX_PLUGIN_LIVECONNECT
LCFLAGS = /D MOZ_ACTIVEX_PLUGIN_LIVECONNECT $(LCFLAGS)
JAVADIR = m:\VisualCafe\java
JAVADIR = D:\jdk1.3.1
JAVAH = $(MOZ_PLUGINSDK)\bin\win32\javah
JAVAC = $(JAVADIR)\bin\javac
JAVAC = $(JAVADIR)\bin\oldjavac
JAVACLASSES = $(MOZ_PLUGINSDK)\classes\java_30.zip
CLASSPATH = $(JAVACLASSES);.