libwinpr-com: create empty module
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Mon, 19 Aug 2013 23:06:47 +0000 (19:06 -0400)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Mon, 19 Aug 2013 23:06:47 +0000 (19:06 -0400)
winpr/libwinpr/com/CMakeLists.txt [new file with mode: 0644]
winpr/libwinpr/com/ModuleOptions.cmake [new file with mode: 0644]
winpr/libwinpr/com/com.c [new file with mode: 0644]
winpr/libwinpr/com/module.def [new file with mode: 0644]
winpr/libwinpr/com/test/.gitignore [new file with mode: 0644]
winpr/libwinpr/com/test/CMakeLists.txt [new file with mode: 0644]
winpr/libwinpr/com/test/TestComReference.c [new file with mode: 0644]

diff --git a/winpr/libwinpr/com/CMakeLists.txt b/winpr/libwinpr/com/CMakeLists.txt
new file mode 100644 (file)
index 0000000..826c678
--- /dev/null
@@ -0,0 +1,49 @@
+# WinPR: Windows Portable Runtime
+# libwinpr-com cmake build script
+#
+# Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set(MODULE_NAME "winpr-com")
+set(MODULE_PREFIX "WINPR_COM")
+
+set(${MODULE_PREFIX}_SRCS
+       com.c)
+
+if(MSVC AND (NOT MONOLITHIC_BUILD))
+       set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def)
+endif()
+
+add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT"
+       MONOLITHIC ${MONOLITHIC_BUILD}
+       SOURCES ${${MODULE_PREFIX}_SRCS})
+
+set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib")
+
+if(WIN32)
+       set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} credui)
+endif()
+
+if(MONOLITHIC_BUILD)
+       set(WINPR_LIBS ${WINPR_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE)
+else()
+       target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
+       install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif()
+
+set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR")
+
+if(BUILD_TESTING)
+       add_subdirectory(test)
+endif()
diff --git a/winpr/libwinpr/com/ModuleOptions.cmake b/winpr/libwinpr/com/ModuleOptions.cmake
new file mode 100644 (file)
index 0000000..37c3b96
--- /dev/null
@@ -0,0 +1,9 @@
+
+set(MINWIN_LAYER "1")
+set(MINWIN_GROUP "core")
+set(MINWIN_MAJOR_VERSION "1")
+set(MINWIN_MINOR_VERSION "0")
+set(MINWIN_SHORT_NAME "com")
+set(MINWIN_LONG_NAME "Component Object Model (COM)")
+set(MODULE_LIBRARY_NAME "api-ms-win-${MINWIN_GROUP}-${MINWIN_SHORT_NAME}-l${MINWIN_LAYER}-${MINWIN_MAJOR_VERSION}-${MINWIN_MINOR_VERSION}")
+
diff --git a/winpr/libwinpr/com/com.c b/winpr/libwinpr/com/com.c
new file mode 100644 (file)
index 0000000..97332a0
--- /dev/null
@@ -0,0 +1,115 @@
+/**
+ * WinPR: Windows Portable Runtime
+ * Component Object Model (COM)
+ *
+ * Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <winpr/crt.h>
+
+/**
+ * api-ms-win-core-com-l1-1-0.dll:
+ *
+ * CLSIDFromProgID
+ * CLSIDFromString
+ * CoAddRefServerProcess
+ * CoAllowUnmarshalerCLSID
+ * CoCancelCall
+ * CoCopyProxy
+ * CoCreateFreeThreadedMarshaler
+ * CoCreateGuid
+ * CoCreateInstance
+ * CoCreateInstanceEx
+ * CoCreateInstanceFromApp
+ * CoDecodeProxy
+ * CoDecrementMTAUsage
+ * CoDisableCallCancellation
+ * CoDisconnectContext
+ * CoDisconnectObject
+ * CoEnableCallCancellation
+ * CoFreeUnusedLibraries
+ * CoFreeUnusedLibrariesEx
+ * CoGetApartmentType
+ * CoGetCallContext
+ * CoGetCallerTID
+ * CoGetCancelObject
+ * CoGetClassObject
+ * CoGetContextToken
+ * CoGetCurrentLogicalThreadId
+ * CoGetCurrentProcess
+ * CoGetDefaultContext
+ * CoGetInterfaceAndReleaseStream
+ * CoGetMalloc
+ * CoGetMarshalSizeMax
+ * CoGetObjectContext
+ * CoGetPSClsid
+ * CoGetStandardMarshal
+ * CoGetStdMarshalEx
+ * CoGetTreatAsClass
+ * CoImpersonateClient
+ * CoIncrementMTAUsage
+ * CoInitializeEx
+ * CoInitializeSecurity
+ * CoInvalidateRemoteMachineBindings
+ * CoIsHandlerConnected
+ * CoLockObjectExternal
+ * CoMarshalHresult
+ * CoMarshalInterface
+ * CoMarshalInterThreadInterfaceInStream
+ * CoQueryAuthenticationServices
+ * CoQueryClientBlanket
+ * CoQueryProxyBlanket
+ * CoRegisterClassObject
+ * CoRegisterPSClsid
+ * CoRegisterSurrogate
+ * CoReleaseMarshalData
+ * CoReleaseServerProcess
+ * CoResumeClassObjects
+ * CoRevertToSelf
+ * CoRevokeClassObject
+ * CoSetCancelObject
+ * CoSetProxyBlanket
+ * CoSuspendClassObjects
+ * CoSwitchCallContext
+ * CoTaskMemAlloc
+ * CoTaskMemFree
+ * CoTaskMemRealloc
+ * CoTestCancel
+ * CoUninitialize
+ * CoUnmarshalHresult
+ * CoUnmarshalInterface
+ * CoWaitForMultipleHandles
+ * CoWaitForMultipleObjects
+ * CreateStreamOnHGlobal
+ * FreePropVariantArray
+ * GetHGlobalFromStream
+ * IIDFromString
+ * ProgIDFromCLSID
+ * PropVariantClear
+ * PropVariantCopy
+ * StringFromCLSID
+ * StringFromGUID2
+ * StringFromIID
+ */
+
+#ifndef _WIN32
+
+
+
+#endif
diff --git a/winpr/libwinpr/com/module.def b/winpr/libwinpr/com/module.def
new file mode 100644 (file)
index 0000000..4467b6c
--- /dev/null
@@ -0,0 +1,2 @@
+LIBRARY                "libwinpr-com"
+EXPORTS
diff --git a/winpr/libwinpr/com/test/.gitignore b/winpr/libwinpr/com/test/.gitignore
new file mode 100644 (file)
index 0000000..4a027ee
--- /dev/null
@@ -0,0 +1,3 @@
+TestCom
+TestCom.c
+
diff --git a/winpr/libwinpr/com/test/CMakeLists.txt b/winpr/libwinpr/com/test/CMakeLists.txt
new file mode 100644 (file)
index 0000000..94e42c3
--- /dev/null
@@ -0,0 +1,31 @@
+
+set(MODULE_NAME "TestCom")
+set(MODULE_PREFIX "TEST_COM")
+
+set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c)
+
+set(${MODULE_PREFIX}_TESTS
+       TestComReference.c)
+
+create_test_sourcelist(${MODULE_PREFIX}_SRCS
+       ${${MODULE_PREFIX}_DRIVER}
+       ${${MODULE_PREFIX}_TESTS})
+
+add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
+
+set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
+       MONOLITHIC ${MONOLITHIC_BUILD}
+       MODULE winpr
+       MODULES winpr-crt winpr-com)
+
+target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
+
+set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}")
+
+foreach(test ${${MODULE_PREFIX}_TESTS})
+       get_filename_component(TestName ${test} NAME_WE)
+       add_test(${TestName} ${TESTING_OUTPUT_DIRECTORY}/${MODULE_NAME} ${TestName})
+endforeach()
+
+set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Test")
+
diff --git a/winpr/libwinpr/com/test/TestComReference.c b/winpr/libwinpr/com/test/TestComReference.c
new file mode 100644 (file)
index 0000000..4b26f3d
--- /dev/null
@@ -0,0 +1,8 @@
+
+#include <winpr/crt.h>
+
+int TestComReference(int argc, char* argv[])
+{
+       return 0;
+}
+