major source structure and module name changes

This commit is contained in:
soochoi
2006-06-07 16:34:19 +00:00
parent 5c75241b4b
commit 1fa6f07e83
651 changed files with 0 additions and 0 deletions

36
micasacache/Makefile.am Normal file
View File

@@ -0,0 +1,36 @@
#######################################################################
#
# Copyright (C) 2006 Novell, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#######################################################################
SUBDIRS = $(TARGET_OS)
DIST_SUBDIRS = linux
CFILES =
EXTRA_DIST = *.c
.PHONY: package package-clean package-install package-uninstall
package package-clean package-install package-uninstall:
$(MAKE) -C $(TARGET_OS) $@
maintainer-clean-local:
rm -f Makefile.in

View File

@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="micasacache"
ProjectGUID="{B5DB4B53-AB02-4EDC-9C02-BF7DE68F91A3}"
RootNamespace="c_micasacache"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\include"
PreprocessorDefinitions="SSCS_WIN32_PLAT_F;WIN32"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="FALSE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="FALSE"
LinkIncremental="2"
ModuleDefinitionFile=".\micasacache.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/c_micasacache.pdb"
SubSystem="2"
ImportLibrary="$(OutDir)/micasacache.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\include"
PreprocessorDefinitions="SSCS_WIN32_PLAT_F;WIN32"
RuntimeLibrary="0"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
ModuleDefinitionFile=".\micasacache.def"
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/micasacache.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\sscs_ipc.c">
</File>
<File
RelativePath=".\sscs_unx_cache.c">
</File>
<File
RelativePath=".\sscs_unx_ipc_client.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath="..\include\sscs_ipc.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
<File
RelativePath=".\micasacache.def">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

46
micasacache/link.w32 Normal file
View File

@@ -0,0 +1,46 @@
LINK_DEF_BLD = \
echo "$(addprefix $(OBJDIR),$(notdir $(OBJS)))" > $(LINKDEF);\
echo "/LIBPATH:$(MSC)lib" >> $(LINKDEF);\
echo "kernel32.lib" >> $(LINKDEF);\
echo "/DLL" >> $(LINKDEF);\
echo "/OUT:$(BINDIR)$(basename $(notdir $@)).dll" >> $(LINKDEF);\
echo "/MAP:$(BINDIR)$(basename $(notdir $@)).map" >> $(LINKDEF);\
echo "/PDB:$(BINDIR)$(basename $(notdir $@)).pdb" >> $(LINKDEF);\
echo "/MACHINE:IX86" >> $(LINKDEF);\
echo "/SUBSYSTEM:WINDOWS" >> $(LINKDEF);\
echo "/INCREMENTAL:NO" >> $(LINKDEF);\
echo "/VERSION:$(BLD_VER)" >> $(LINKDEF);\
echo "/FIXED:NO" >> $(LINKDEF);\
echo "/NODEFAULTLIB:libc" >> $(LINKDEF);\
echo "/NODEFAULTLIB:oldnames" >> $(LINKDEF);\
echo "/NODEFAULTLIB:comctl32" >> $(LINKDEF);\
echo "/NODEFAULTLIB:olepro32" >> $(LINKDEF);\
echo "/NODEFAULTLIB:oleaut32" >> $(LINKDEF);\
echo "/NODEFAULTLIB:wininet" >> $(LINKDEF);\
echo "/NODEFAULTLIB:uuid" >> $(LINKDEF);\
echo "/NODEFAULTLIB:user32" >> $(LINKDEF);\
echo "/NODEFAULTLIB:libcmtd" >> $(LINKDEF);\
echo "/NODEFAULTLIB:msvcr71.lib" >> $(LINKDEF);\
echo "/OPT:REF" >> $(LINKDEF);\
echo "/EXPORT:sscs_CacheRemoveSecretStore">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheEnumerateKeychainIDs">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheAddKeychain">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheRemoveKeychain">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheEnumerateSecretIDs">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheReadSecret">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheWriteSecret">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheRemoveSecret">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheGetSecretStoreInfo">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheGetKeychainInfo">> $(LINKDEF);\
echo "/EXPORT:sscs_LockCache">> $(LINKDEF);\
echo "/EXPORT:sscs_UnlockCache">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheRemoveSecret">> $(LINKDEF);\
echo "/EXPORT:sscs_SetMasterPasscode">> $(LINKDEF);\
echo "/EXPORT:sscs_SetMasterPassword">> $(LINKDEF);\
echo "/EXPORT:sscs_IsSecretPersistent">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheWriteKey">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheWriteBinaryKey">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheReadKey">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheReadBinaryKey">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheCloseSecretStore">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheOpenSecretStore">> $(LINKDEF);

48
micasacache/link_mdd.w32 Normal file
View File

@@ -0,0 +1,48 @@
LINK_DEF_BLD = \
echo "$(addprefix $(OBJDIR),$(notdir $(OBJS)))" > $(LINKDEF);\
echo "$(MSC)lib/kernel32.lib" >> $(LINKDEF);\
echo "$(MSC)lib/msvcrt.lib" >> $(LINKDEF);\
echo "/LIBPATH:$(MSC)lib" >> $(LINKDEF);\
echo "/DLL" >> $(LINKDEF);\
echo "/OUT:$(BINDIR)$(basename $(notdir $@)).dll" >> $(LINKDEF);\
echo "/MAP:$(BINDIR)$(basename $(notdir $@)).map" >> $(LINKDEF);\
echo "/PDB:$(BINDIR)$(basename $(notdir $@)).pdb" >> $(LINKDEF);\
echo "/MACHINE:IX86" >> $(LINKDEF);\
echo "/SUBSYSTEM:WINDOWS" >> $(LINKDEF);\
echo "/INCREMENTAL:NO" >> $(LINKDEF);\
echo "/VERSION:$(BLD_VER)" >> $(LINKDEF);\
echo "/FIXED:NO" >> $(LINKDEF);\
echo "/NODEFAULTLIB:libc" >> $(LINKDEF);\
echo "/NODEFAULTLIB:oldnames" >> $(LINKDEF);\
echo "/NODEFAULTLIB:comctl32" >> $(LINKDEF);\
echo "/NODEFAULTLIB:olepro32" >> $(LINKDEF);\
echo "/NODEFAULTLIB:oleaut32" >> $(LINKDEF);\
echo "/NODEFAULTLIB:wininet" >> $(LINKDEF);\
echo "/NODEFAULTLIB:uuid" >> $(LINKDEF);\
echo "/NODEFAULTLIB:user32" >> $(LINKDEF);\
echo "/NODEFAULTLIB:libcmt" >> $(LINKDEF);\
echo "/NODEFAULTLIB:libcmtd" >> $(LINKDEF);\
echo "/WARN:3" >> $(LINKDEF);\
echo "/OPT:REF" >> $(LINKDEF);\
echo "/EXPORT:sscs_CacheRemoveSecretStore">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheEnumerateKeychainIDs">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheAddKeychain">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheRemoveKeychain">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheEnumerateSecretIDs">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheReadSecret">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheWriteSecret">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheRemoveSecret">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheGetSecretStoreInfo">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheGetKeychainInfo">> $(LINKDEF);\
echo "/EXPORT:sscs_LockCache">> $(LINKDEF);\
echo "/EXPORT:sscs_UnlockCache">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheRemoveSecret">> $(LINKDEF);\
echo "/EXPORT:sscs_SetMasterPasscode">> $(LINKDEF);\
echo "/EXPORT:sscs_SetMasterPassword">> $(LINKDEF);\
echo "/EXPORT:sscs_IsSecretPersistent">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheWriteKey">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheWriteBinaryKey">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheReadKey">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheReadBinaryKey">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheCloseSecretStore">> $(LINKDEF);\
echo "/EXPORT:sscs_CacheOpenSecretStore">> $(LINKDEF);

View File

@@ -0,0 +1,113 @@
#######################################################################
#
# Copyright (C) 2006 Novell, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#######################################################################
if DEBUG
TARGET_CFG = Debug
CFLAGS += -v -w
else
TARGET_CFG = Release
endif
SUBDIRS =
DIST_SUBDIRS =
EXTRA_DIST = $(CFILES)
CASAROOT = ../..
CASALIBDIR = $(CASAROOT)/$(LIB)
# handle Mono secondary dependencies
export MONO_PATH := $(MONO_PATH)
PLATFORMINDEPENDENTSOURCEDIR = ..
PLATFORMDEPENDENTSOURCEDIR = .
MODULE_NAME =libmicasacache
MODULE_EXT =a
CFILES = ../sscs_unx_cache.c \
../sscs_unx_ipc_client.c \
../sscs_ipc.c
CSFILES_CSC :=
INCLUDES = -I. -I.. -I$(CASAROOT)/include -I/opt/gnome/include/gnome-keyring-1/
EXTRA_CFLAGS =
RESOURCES =
CFLAGS += $(EXTRA_CFLAGS) $(INCLUDES) $(DEFINES)
LIBS = -lpthread -ldl
LDFLAGS = -Bsymbolic -shared -Wl,-soname=$(MODULE_NAME).$(MODULE_EXT)
OBJDIR = ./$(TARGET_CFG)/$(LIB)
OBJS = $(addprefix $(OBJDIR)/, $(CFILES:%.c=%.o))
CUR_DIR := $(shell pwd)
all: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
#
# Pattern based rules.
#
vpath %.c $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR)
vpath %.cpp $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR)
$(OBJDIR)/%.o: %.c
@echo [======== Compiling $@ ========]
@echo [======== OBJDIR $(OBJDIR) ========]
$(CC) -c $(CFLAGS) -o $@ $<
$(OBJDIR)/%.o: %.cpp
$(CC) -c $(CFLAGS) -o $@ $<
$(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT): $(OBJDIR) $(OBJS)
@echo [======== Linking $@ ========]
# $(LINK) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
ar crus $@ $(OBJS)
cp -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT)
$(OBJDIR):
[ -d $(OBJDIR) ] || mkdir -p $(OBJDIR)
[ -d $(CASALIBDIR) ] || mkdir -p $(CASALIBDIR)
[ -d $(CASALIBDIR)/$(TARGET_CFG) ] || mkdir -p $(CASALIBDIR)/$(TARGET_CFG)
install-exec-local: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
$(mkinstalldirs) $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(DESTDIR)$(libdir)/
uninstall-local:
cd $(DESTDIR)$(libdir); rm -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
rmdir $(DESTDIR)$(libdir)
#installcheck-local: install
# $(mkinstalldirs) $(DESTDIR)$(libdir)
# $(INSTALL_PROGRAM) $(DESTDIR)$(libdir)
# cd $(DESTDIR)$(libdir); $(MONO)
clean-local:
if [ -d $(TARGET_CFG) ]; then rm -rf $(TARGET_CFG); fi
distclean-local:
maintainer-clean-local:
rm -f Makefile.in

View File

@@ -0,0 +1,3 @@
LINK = $(AR) \
$(LIBDIR)$(XTRA)/lib$(TARGET).a \
$(OBJDIR)/*.$(O)

View File

@@ -0,0 +1,4 @@
OBJS=\
sscs_unx_cache.$(O)\
sscs_unx_ipc_client.$(O)\
sscs_ipc.$(O)

View File

@@ -0,0 +1,23 @@
EXPORTS
sscs_CacheRemoveSecretStore
sscs_CacheEnumerateKeychainIDs
sscs_CacheAddKeychain
sscs_CacheRemoveKeychain
sscs_CacheEnumerateSecretIDs
sscs_CacheReadSecret
sscs_CacheWriteSecret
sscs_CacheRemoveSecret
sscs_CacheGetSecretStoreInfo
sscs_CacheGetKeychainInfo
sscs_LockCache
sscs_UnlockCache
sscs_CacheRemoveSecret
sscs_SetMasterPasscode
sscs_SetMasterPassword
sscs_IsSecretPersistent
sscs_CacheWriteKey
sscs_CacheWriteBinaryKey
sscs_CacheReadKey
sscs_CacheReadBinaryKey
sscs_CacheCloseSecretStore
sscs_CacheOpenSecretStore

5
micasacache/objs.w32 Normal file
View File

@@ -0,0 +1,5 @@
OBJS=\
sscs_unx_cache.$(O)\
sscs_unx_ipc_client.$(O)\
sscs_ipc.$(O)

273
micasacache/sscs_ipc.c Normal file
View File

@@ -0,0 +1,273 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
#include "sscs_ipc.h"
#ifdef SSCS_WIN32_PLAT_F
#include "windows.h"
#define XTIER_RPC_PIPE TEXT("\\\\.\\PIPE\\SS_RPC_PIPE")
// global
int firstReadAfterWrite = 0;
#endif
/*
*/
#ifdef SSCS_LINUX_PLAT_F
void* ipc_unx_create()
{
int retVal = 0;
struct sockaddr_un servAddr;
char path[MAX_SOCKET_PATH_LEN];
int sockFd = 0;
do
{
sockFd = socket(AF_UNIX,SOCK_STREAM,0);
if( sockFd < 0 )
{
retVal = sockFd;
break;
}
memset(&servAddr,0,sizeof(servAddr));
servAddr.sun_family = AF_UNIX;
strcpy(servAddr.sun_path,"/tmp/.novellCASA");
retVal = connect(sockFd,(struct sockaddr*)&servAddr, sizeof(servAddr));
if(retVal < 0 )
{
DMSG(("Connect fails : %s\n",strerror(errno)));
DMSG(("Closing socket : %d\n",sockFd));
close(sockFd);
break;
}
else
retVal = sockFd;
}while(0);
return (void*)retVal;
}
#else
void * ipc_win_create()
{
//#ifdef SSCS_WIN32_PLAT_F
// connect to the named Pipe
HANDLE hPipe = NULL;
int rcode;
DWORD mode = PIPE_READMODE_MESSAGE;
hPipe = CreateFile(
XTIER_RPC_PIPE,
GENERIC_READ | GENERIC_WRITE,
0,
NULL, //null,
OPEN_EXISTING,
0,
0);
if (hPipe == INVALID_HANDLE_VALUE)
{
rcode = GetLastError();
return 0;
}
return hPipe;
}
#endif
#ifdef SSCS_LINUX_PLAT_F
int ipc_unx_write(int fd, Byte *pData, int bytes)
{
int retVal = write(fd,pData,bytes);
if( retVal < 0 )
{
DMSG(("Write returns error : %d - %s\n",retVal, strerror(errno)));
}
return retVal;
//#endif
}
#else
int ipc_win_write(HANDLE hPipe, LPCVOID lpBuffer, DWORD bytesToWrite)
{
//#ifdef SSCS_WIN32_PLAT_F
BOOL rcode;
int icode;
DWORD lpBytesWritten = 0;
//LPCVOID msgLen = malloc(4);
// rcode = WaitNamedPipe(
// XTIER_RPC_PIPE,
// NMPWAIT_WAIT_FOREVER);
// the server expects us to first write the number of bytes in the msg we're about to write.
rcode = WriteFile(
hPipe,
(LPCVOID)&bytesToWrite,
4,
&lpBytesWritten,
NULL);
if (!rcode)
{
icode = GetLastError();
return 0;
}
// rcode = WaitNamedPipe(
// XTIER_RPC_PIPE,
// NMPWAIT_WAIT_FOREVER);
rcode = WriteFile(
hPipe,
lpBuffer, //LPCVOID lpBuffer,
bytesToWrite, //DWORD nNumberOfBytesToWrite,
&lpBytesWritten, // LPDWORD lpNumberOfBytesWritten,
NULL); //LPOVERLAPPED lpOverlapped
if (!rcode)
{
icode = GetLastError();
}
firstReadAfterWrite = 1;
return lpBytesWritten;
}
#endif
/*
*
*/
#ifdef SSCS_LINUX_PLAT_F
int ipc_unx_read(int fd, Byte *pData, int bytes)
{
int bytesToRead = 0; // Keep track of number of bytes to read
int bytesRead = 0; // Number of bytes read
int retVal = 0;
for(bytesToRead = bytes; bytesToRead;)
{
if ((bytesRead = read(fd, pData, bytesToRead)) == 0)
{
break;
}
else
{
if(bytesRead < 0)
{
return -1;
}
bytesToRead -= bytesRead;
pData += bytesRead;
}
}
return bytesRead;
}
//#endif
#else
int ipc_win_read(HANDLE hPipe, LPVOID lpBuffer, DWORD numOfBytesToRead)
{
//#ifdef SSCS_WIN32_PLAT_F
BOOL rcode;
DWORD numBytesRead = 0;
LPVOID pMsgLen = malloc(4);
int icode;
if (firstReadAfterWrite)
{
firstReadAfterWrite = 0;
// server first sends the number of bytes that gets sent.
rcode = ReadFile(
hPipe, //HANDLE hFile,
pMsgLen, //LPVOID lpBuffer,
4, //numOfBytesToRead, //DWORD nNumberOfBytesToRead,
&numBytesRead, //LPDWORD lpNumberOfBytesRead,
NULL); //LPOVERLAPPED lpOverlapped
if (!rcode)
{
icode = GetLastError();
return 0;
}
}
rcode = ReadFile(
hPipe, //HANDLE hFile,
lpBuffer, //LPVOID lpBuffer,
numOfBytesToRead, //DWORD nNumberOfBytesToRead,
&numBytesRead, //LPDWORD lpNumberOfBytesRead,
NULL); //LPOVERLAPPED lpOverlapped
if (pMsgLen)
free(pMsgLen);
return numBytesRead;
}
#endif
#ifdef SSCS_LINUX_PLAT_F
int ipc_unx_close(int fd)
{
return close(fd);
}
#else
int ipc_win_close(HANDLE hPipe)
{
//#ifdef SSCS_WIN32_PLAT_F
BOOL rcode;
rcode = DisconnectNamedPipe(hPipe);
rcode = CloseHandle(hPipe);
return 0;
}
#endif

View File

@@ -0,0 +1,733 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
#if defined(__cplusplus) || defined(c_plusplus)
extern "C"
{
#endif
#include <stdio.h>
#ifdef SSCS_WIN32_PLAT_F
#include <windows.h>
#include <sscs_ipc.h>
#endif
#include "sscs_cache.h"
/* Starts a session with the cache and returns a handle to the cache.
* Parametrs:
* secretStoreID
* (IN) Points to SecretStoreID structure.
*
* Return Values:
* returns a pointer to SecretStoreHandle structure.
*/
void* sscs_CacheOpenSecretStore
(
void *secretStoreID,
uint32_t ssFlags,
void *reserved
)
{
SSCS_SECRETSTORE_HANDLE_T *ssHandle = NULL;
SSCS_LINUX_SS_HANDLE_T *platHandle = NULL;
int32_t retVal = 0;
ssHandle = (SSCS_SECRETSTORE_HANDLE_T *)malloc((sizeof(SSCS_SECRETSTORE_HANDLE_T) + (sizeof(SSCS_LINUX_SS_HANDLE_T))));
if(NULL == ssHandle)
{
return NULL;
}
memset(ssHandle,0,sizeof(SSCS_SECRETSTORE_HANDLE_T));
ssHandle->platHandle = ssHandle + sizeof(SSCS_SECRETSTORE_HANDLE_T);
retVal = ipc_OpenSecretStore(secretStoreID,ssHandle);
if(retVal)
{
memset(ssHandle, 0, sizeof(SSCS_SECRETSTORE_HANDLE_T) + (sizeof(SSCS_LINUX_SS_HANDLE_T)));
free(ssHandle);
return NULL;
}
return ssHandle;
}
/* Closes the secretstore and destroys the SecretStore context for that
* application.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context information regarding the SecretStore.
*
*
* Return Values
*
*/
int32_t sscs_CacheCloseSecretStore
(
void *ssHandle,
uint32_t ssFlags,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
if(ssHandleCopy->platHandle)
{
retVal = ipc_CloseSecretStore(ssHandleCopy, ssFlags);
}
if(ssHandleCopy)
free(ssHandleCopy);
return retVal;
}
/* Removes all application defined keychains from the store. It also removes
* secrets stored in system defined keychains.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context information regarding the SecretStore.
*
*
* Return Values:
*/
int32_t sscs_CacheRemoveSecretStore
(
void *ssHandle,
uint32_t ssFlags,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_RemoveSecretStore(ssHandleCopy);
return retVal;
}
/* Enumerates key chain ids available in the store.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context information regarding the SecretStore.
*
*
* kcIDList
* (OUT) Points to the key chain id enumeration structure. Points to
* KeyChainIDList structure.
*
* bytesRequired
* (OUT) Specifies the buffer requirement if it is not possible
* to copy KeyChain IDs in the buffer passed by the application.
*
* Return Values:
*
*/
int32_t sscs_CacheEnumerateKeychainIDs
(
void *ssHandle,
uint32_t ssFlags,
SSCS_SRCH_KEY_T *searchKey,
SSCS_KEYCHAIN_ID_LIST_T *kcIDList,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_EnumerateKeychainIDs(ssHandleCopy,kcIDList);
return retVal;
}
/* Creates a new keychain in the store.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context information regarding the SecretStore.
*
* ssFlags
* (IN) Can be a combination of follwing flags:
* SSCS_HIDDEN_LOCAL_KEY_CHAIN_F
* SSCS_SESSION_KEY_CHAIN_F
* SSCS_LOCAL_KEY_CHAIN_F
* SSCS_REMOTE_KEY_CHAIN_F
* SSCS_LOCAL_REMOTE_CHAIN_F
* SSCS_RESERVED1_KEY_CHAIN_F
* SSCS_RESERVED2_KEY_CHAIN_F
* keychainID
* (IN) Specifies the unique keychain ID within the secretstore.
*
*/
int32_t sscs_CacheAddKeychain
(
void *ssHandle,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T *keychainID,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_AddKeychain(ssHandleCopy,ssFlags,keychainID);
return retVal;
}
/* Removes the specified keychain from the store.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context information regarding the SecretStore.
*
* keychainID
* (IN) Specifies the unique keychain ID within the secretstore.
*
* Return Values:
*/
int32_t sscs_CacheRemoveKeychain
(
void *ssHandle,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T *keyChainID,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_RemoveKeychain(ssHandleCopy,keyChainID);
return retVal;
}
/* Enumerates secret ids in a given keychain.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context information regarding the SecretStore.
*
* keyChainID
* (IN) handle obtained during sscs_CacheOpenKeychain.
*
*
* secretIDList
* (OUT) Points to the secret id enumeration structure. Points to
* SecretIDList structure.
*
* bytesRequired
* (OUT) Specifies the buffer requirement if it is not possible
* to copy Secret IDs in the buffer passed by the application.
* Return Values:
*/
int32_t sscs_CacheEnumerateSecretIDs
(
void *ssHandle,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T *keyChainID,
SSCS_SRCH_KEY_T *searchKey,
SSCS_SECRET_ID_LIST_T *secretIDList,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_EnumerateSecretIDs(ssHandleCopy,keyChainID,secretIDList);
return retVal;
}
/* Reads Secret value for a given Secret ID in a given keychain.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context information regarding the SecretStore.
*
* keyChainID
* (IN) KeyChainID where the specified SecretID stored.
*
* secretID
* (IN) Specifies the unique secret ID within the keychain. This data is
* encoded in SSCS_SECRET_ID_T.
*
* secretData
* (IN/OUT) Specifies the information of the secret stored w.r.t the secretID.
* Points to a SSCS_SECRET_T structure.
*
* epPassword
* (IN) Points to an optional field to pass in the Enhanced Protection Password
* for reading a secret.When the password is not present, you can pass in a NULL.
*
* bytesRequired
* (OUT) Specifies the buffer requirement if it is not possible
* to copy Secret data in the buffer passed by the application.
*
* Return Values :
*/
int32_t sscs_CacheReadSecret
(
void *ssHandle,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T *keychainID,
SSCS_SECRET_ID_T *secretID,
SSCS_SECRET_T *secretData,
SSCS_PASSWORD_T *epPassword,
uint32_t *bytesRequired,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_ReadSecret(ssHandleCopy,keychainID,secretID,secretData,epPassword,bytesRequired);
return retVal;
}
/* Writes Secret value for a given Secret ID in a given keychain.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context information regarding the SecretStore.
*
* ssFlags
* (IN) ...
*
* keyChainID
* (IN) KeyChainID where the specified SecretID stored.
*
* secretID
* (IN) Specifies the unique secret ID within the keychain. This data is
* encoded in SSCS_SECRET_ID_T.
*
* secretData
* (IN) Specifies the information of the secret stored w.r.t the secretID.
* Points to a SSCS_SECRET_T structure.
*
*
* epPassword
* (IN) Points to an optional field to pass in the Enhanced Protection Password
* for reading a secret.When the password is not present, you can pass in a NULL.
*
*
*
* Return Values:
*/
int sscs_CacheWriteSecret
(
void *ssHandle,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T *keyChainID,
SSCS_SECRET_ID_T *secretID,
SSCS_SECRET_T *secretData,
SSCS_PASSWORD_T *epPassword,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_WriteSecret(ssHandleCopy,ssFlags,keyChainID,secretID,secretData,epPassword, reserved);
return retVal;
}
/* Removes Secret for a given Secret ID in a given keychain.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context information regarding the SecretStore.
*
*
* keyChainID
* (IN) KeyChainID where the specified SecretID stored.
*
* secretID
* (IN) Specifies the unique secret ID within the keychain. This data is
* encoded in SSCS_SECRET_ID_T.
*
*
* epPassword
* (IN) Points to an optional field to pass in the Enhanced Protection Password
* for reading a secret.When the password is not present, you can pass in a NULL.
*
* Return Values:
*/
int32_t sscs_CacheRemoveSecret
(
void *ssHandle,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T *keyChainID,
SSCS_SECRET_ID_T *secredID,
SSCS_PASSWORD_T *epPassword,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_RemoveSecret(ssHandleCopy,keyChainID,secredID,epPassword);
return retVal;
}
/* Returns statistical information regarding the SecretStore and its Keychains.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context with respect to the instance of open cache in it.
*
*
* ssInfo
* (OUT) This structure contains the statistical information regarding the
* SecretStore and its Keychains.
*
* Return Values:
*/
int32_t sscs_CacheGetSecretStoreInfo
(
void *ssHandle,
uint32_t ssFlags,
SSCS_SECRETSTORE_INFO_T *ssInfo,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_GetSecretStoreInfo(ssHandleCopy,ssInfo);
return retVal;
}
/* Retrieves the statistical information regarding the target Keychain.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context with respect to the instance of open cache in it.
*
* keyChainID
* (IN) KeyChainID where the specified SecretID stored.
*
*
* kcInfo
* (OUT) This structure contains the statistical information regarding the
* Keychain.
*
*
* Return Values:
*/
int32_t sscs_CacheGetKeychainInfo
(
void *ssHandle,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T *keyChainID,
SSCS_KEYCHAIN_INFO_T *kcInfo,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_GetKeychainInfo(ssHandleCopy,keyChainID,kcInfo);
return retVal;
}
/* This call locks that cache to prevent access until the MasterPassword is
* supplied.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context with respect to the instance of open cache in it.
*
* Return Values :
*/
int32_t sscs_LockCache
(
void *ssHandle,
uint32_t ssFlags,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_LockCache(ssHandleCopy);
return retVal;
}
/* This unlocks previously locked cache using the MasterPassword
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context with respect to the instance of open cache in it.
* masterPassword
*
* Return Values :
*/
int32_t sscs_UnlockCache
(
void *ssHandle,
uint32_t ssFlags,
SSCS_PASSCODE_T *passcode,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_UnlockCache(ssHandle,passcode);
return retVal;
}
int32_t sscs_SetMasterPasscode
(
void *ssHandle,
SSCS_PASSCODE_T *passcode,
void *reserved
)
{
int32_t retVal = 0;
retVal = ipc_SetMasterPasscode(ssHandle,passcode);
return retVal;
}
int32_t sscs_SetMasterPassword
(
void *ssHandle,
SSCS_PASSWORD_T *password,
SSCS_HINT_T *hint,
void *reserved
)
{
int32_t retVal = 0;
retVal = ipc_SetMasterPassword(ssHandle,password,hint);
return retVal;
}
//#if 0
/* Writes A key-value for a given Secret ID in a given keychain.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context information regarding the SecretStore.
*
* ssFlags
* (IN) ...
*
* keyChainID
* (IN) KeyChainID where the specified SecretID stored.
*
* secretID
* (IN) Specifies the unique secret ID within the keychain. This data is
* encoded in SSCS_SECRET_ID_T.
*
* secretData
* (IN) Specifies the information of the secret stored w.r.t the secretID.
* Points to a SSCS_SECRET_T structure.
*
*
* epPassword
* (IN) Points to an optional field to pass in the Enhanced Protection Password
* for reading a secret.When the password is not present, you can pass in a NULL.
*
*
*
* Return Values:
*/
int sscs_CacheWriteKey
(
void *ssHandle,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T *keyChainID,
SSCS_SECRET_ID_T *secretID,
SS_UTF8_T *key,
uint32_t keyLen,
uint8_t *val,
int32_t valLen,
SSCS_PASSWORD_T *epPassword,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_WriteKey(ssHandleCopy,ssFlags,keyChainID,secretID,key,keyLen,val,valLen,epPassword, reserved);
return retVal;
}
int sscs_CacheWriteBinaryKey
(
void *ssHandle,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T *keyChainID,
SSCS_SECRET_ID_T *secretID,
SS_UTF8_T *key,
uint32_t keyLen,
uint8_t *val,
uint32_t valLen,
SSCS_PASSWORD_T *epPassword,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_WriteBinaryKey(ssHandleCopy,ssFlags,keyChainID,secretID,key,keyLen,val,valLen,epPassword, reserved);
return retVal;
}
/* Reads Secret value for a given Secret ID in a given keychain.
*
* Parameters:
* ssHandle
* (IN) Handle returned by sscs_CacheOpenSecretStore function. This will have
* context information regarding the SecretStore.
*
* keyChainID
* (IN) KeyChainID where the specified SecretID stored.
*
* secretID
* (IN) Specifies the unique secret ID within the keychain. This data is
* encoded in SSCS_SECRET_ID_T.
*
* secretData
* (IN/OUT) Specifies the information of the secret stored w.r.t the secretID.
* Points to a SSCS_SECRET_T structure.
*
* epPassword
* (IN) Points to an optional field to pass in the Enhanced Protection Password
* for reading a secret.When the password is not present, you can pass in a NULL.
*
* bytesRequired
* (OUT) Specifies the buffer requirement if it is not possible
* to copy Secret data in the buffer passed by the application.
*
* Return Values :
*/
int32_t sscs_CacheReadKey
(
void *ssHandle,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T *keychainID,
SSCS_SECRET_ID_T *secretID,
SS_UTF8_T *key,
uint32_t keyLen,
uint8_t *val,
uint32_t *valLen,
SSCS_PASSWORD_T *epPassword,
uint32_t *bytesRequired,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_ReadKey(ssHandleCopy,keychainID,secretID,key,keyLen,val,valLen,epPassword,bytesRequired);
return retVal;
}
int32_t sscs_CacheReadBinaryKey
(
void *ssHandle,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T *keychainID,
SSCS_SECRET_ID_T *secretID,
SS_UTF8_T *key,
uint32_t keyLen,
uint8_t *val,
uint32_t *valLen,
SSCS_PASSWORD_T *epPassword,
uint32_t *bytesRequired,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_ReadBinaryKey(ssHandleCopy,keychainID,secretID,key,keyLen,val,valLen,epPassword,bytesRequired);
return retVal;
}
int sscs_IsSecretPersistent
(
void *ssHandle,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T *keyChainID,
SSCS_SECRET_ID_T *secretID,
void *reserved
)
{
int32_t retVal = 0;
SSCS_SECRETSTORE_HANDLE_T *ssHandleCopy = (SSCS_SECRETSTORE_HANDLE_T *)ssHandle;
retVal = ipc_IsSecretPersistent(ssHandleCopy,ssFlags,keyChainID,secretID,reserved);
return retVal;
}
//#endif
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif

File diff suppressed because it is too large Load Diff

75
micasacache/sscscache.rc Normal file
View File

@@ -0,0 +1,75 @@
/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
#include "ssbldver.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION WSS_BLD_NO
PRODUCTVERSION WSS_BLD_NO
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", SSS_WCLIENT_STRING "\0"
VALUE "CompanyName", SSS_COMPANY_STR "\0"
VALUE "FileDescription", SSS_NSSS_PR_STRING "\0"
VALUE "FileVersion", WSS_BLD_STR "\0"
VALUE "LegalCopyright", SSS_COPYRIGHT_STR "\0"
VALUE "LegalTrademarks", SSS_PATENT_STR "\0"
VALUE "OriginalFilename", SSS_NSSS_STR "\0"
VALUE "ProductName", SSS_PRODUCT_STR "\0"
VALUE "ProductVersion", GSS_BLD_STR "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC

107
micasacache/windows/Makefile.am Executable file
View File

@@ -0,0 +1,107 @@
#######################################################################
#
# Copyright (C) 2006 Novell, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#######################################################################
if DEBUG
TARGET_CFG = Debug
CFLAGS += -v -w
else
TARGET_CFG = Release
endif
SUBDIRS =
DIST_SUBDIRS =
EXTRA_DIST = $(SFILES)
CASAROOT = ../..
CASALIBDIR = $(CASAROOT)/lib
if LIB64
CASABINDIR = $(CASAROOT)/bin64
else
CASABINDIR = $(CASAROOT)/bin
endif
OBJDIR = ./$(TARGET_CFG)/$(LIB)
# handle Mono secondary dependencies
export MONO_PATH := $(MONO_PATH)
PLATFORMINDEPENDENTSOURCEDIR = ..
PLATFORMDEPENDENTSOURCEDIR = .
MODULE_NAME =micasacache
MODULE_EXT =dll
SFILES = $(CASAROOT)/vs_solutions/CASAInstall/CASA.sln
PROJECT_NAME= micasacache
CUR_DIR := $(shell pwd)
all: $(MODULE_NAME).$(MODULE_EXT)
#
# Pattern based rules.
#
vpath %.c $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR)
vpath %.cpp $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR)
$(MODULE_NAME).$(MODULE_EXT): $(OBJDIR) devenv
@echo [======== Building Solution $(SFILES) ========]
# cp -f ../micasacache.def .
# cp -f ../c_micasacache.vcproj .
"$(VSINSTALLDIR)/devenv" /rebuild $(TARGET_CFG) /project $(PROJECT_NAME) $(SFILES) /out build.log
cp -f ../$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT) $(CASALIBDIR)/$(TARGET_CFG)
devenv:
@if ! test -x "$(VSINSTALLDIR)/devenv.exe";then echo "Error: MS Studio .NET is currently required to build MSI and MSM";exit 1;fi
$(OBJDIR):
@echo [ ==creating lib dir ===]
[ -d $(OBJDIR) ] || mkdir -p $(OBJDIR)
[ -d $(CASABINDIR) ] || mkdir -p $(CASABINDIR)
[ -d $(CASALIBDIR) ] || mkdir -p $(CASALIBDIR)
[ -d $(CASALIBDIR)/$(TARGET_CFG) ] || mkdir -p $(CASALIBDIR)/$(TARGET_CFG)
install-exec-local: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
$(mkinstalldirs) $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(DESTDIR)$(libdir)/
uninstall-local:
cd $(DESTDIR)$(libdir); rm -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT)
rmdir $(DESTDIR)$(libdir)
clean-local:
if [ -d $(TARGET_CFG) ]; then rm -rf $(TARGET_CFG); fi
if [ -d ../$(TARGET_CFG) ]; then rm -rf ../$(TARGET_CFG); fi
if [ -f build.log ]; then rm -rf build.log; fi
distclean-local:
maintainer-clean-local:
rm -f Makefile.in