diff --git a/winpr/include/winpr/interlocked.h b/winpr/include/winpr/interlocked.h index 519eb6a18cd7..6beb3f015f57 100644 --- a/winpr/include/winpr/interlocked.h +++ b/winpr/include/winpr/interlocked.h @@ -150,8 +150,6 @@ WINPR_API LONGLONG InterlockedCompareExchange64(LONGLONG volatile *Destination, /* Doubly-Linked List */ -#ifndef _WIN32 - VOID InitializeListHead(PLIST_ENTRY ListHead); BOOL IsListEmpty(const LIST_ENTRY* ListHead); @@ -168,7 +166,5 @@ VOID AppendTailList(PLIST_ENTRY ListHead, PLIST_ENTRY ListToAppend); VOID PushEntryList(PSINGLE_LIST_ENTRY ListHead, PSINGLE_LIST_ENTRY Entry); PSINGLE_LIST_ENTRY PopEntryList(PSINGLE_LIST_ENTRY ListHead); -#endif - #endif /* WINPR_INTERLOCKED_H */ diff --git a/winpr/include/winpr/pipe.h b/winpr/include/winpr/pipe.h new file mode 100644 index 000000000000..675065317082 --- /dev/null +++ b/winpr/include/winpr/pipe.h @@ -0,0 +1,33 @@ +/** + * WinPR: Windows Portable Runtime + * Pipe Functions + * + * Copyright 2012 Marc-Andre Moreau + * + * 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. + */ + +#ifndef WINPR_PIPE_H +#define WINPR_PIPE_H + +#include +#include +#include + +#ifndef _WIN32 + +WINPR_API BOOL CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize); + +#endif + +#endif /* WINPR_PIPE_H */ diff --git a/winpr/libwinpr/asn1/CMakeLists.txt b/winpr/libwinpr/asn1/CMakeLists.txt index 5cbef153a4d5..0698bfc6eb76 100644 --- a/winpr/libwinpr/asn1/CMakeLists.txt +++ b/winpr/libwinpr/asn1/CMakeLists.txt @@ -21,6 +21,10 @@ set(MODULE_PREFIX "WINPR_ASN1") set(${MODULE_PREFIX}_SRCS asn1.c) +if(MSVC AND (NOT WITH_MONOLITHIC_BUILD)) + set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) +endif() + if(WITH_MONOLITHIC_BUILD) add_library(${MODULE_NAME} OBJECT ${${MODULE_PREFIX}_SRCS}) else() @@ -36,3 +40,7 @@ else() endif() set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR") + +if(BUILD_TESTING) + add_subdirectory(test) +endif() diff --git a/winpr/libwinpr/asn1/module.def b/winpr/libwinpr/asn1/module.def new file mode 100644 index 000000000000..eba1a913a922 --- /dev/null +++ b/winpr/libwinpr/asn1/module.def @@ -0,0 +1,3 @@ +LIBRARY "libwinpr-asn1" +EXPORTS + diff --git a/winpr/libwinpr/asn1/test/.gitignore b/winpr/libwinpr/asn1/test/.gitignore new file mode 100644 index 000000000000..e2363391e5c1 --- /dev/null +++ b/winpr/libwinpr/asn1/test/.gitignore @@ -0,0 +1,2 @@ +TestAsn1 +TestAsn1.c diff --git a/winpr/libwinpr/asn1/test/CMakeLists.txt b/winpr/libwinpr/asn1/test/CMakeLists.txt new file mode 100644 index 000000000000..3ff2010b5627 --- /dev/null +++ b/winpr/libwinpr/asn1/test/CMakeLists.txt @@ -0,0 +1,34 @@ + +set(MODULE_NAME "TestAsn1") +set(MODULE_PREFIX "TEST_ASN1") + +set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c) + +set(${MODULE_PREFIX}_TESTS + TestAsn1Module.c + TestAsn1Encoder.c + TestAsn1Decoder.c + TestAsn1Encode.c + TestAsn1Decode.c + TestAsn1String.c + TestAsn1Integer.c + TestAsn1Compare.c + TestAsn1BerEnc.c + TestAsn1BerDec.c + TestAsn1DerEnc.c + TestAsn1DerDec.c) + +create_test_sourcelist(${MODULE_PREFIX}_SRCS + ${${MODULE_PREFIX}_DRIVER} + ${${MODULE_PREFIX}_TESTS}) + +add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) + +target_link_libraries(${MODULE_NAME} winpr-asn1) + +foreach(test ${${MODULE_PREFIX}_TESTS}) + get_filename_component(TestName ${test} NAME_WE) + add_test(${TestName} ${EXECUTABLE_OUTPUT_PATH}/${MODULE_NAME} ${TestName}) +endforeach() + +set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Test") diff --git a/winpr/libwinpr/asn1/test/TestAsn1BerDec.c b/winpr/libwinpr/asn1/test/TestAsn1BerDec.c new file mode 100644 index 000000000000..d096b3120eba --- /dev/null +++ b/winpr/libwinpr/asn1/test/TestAsn1BerDec.c @@ -0,0 +1,11 @@ + +#include +#include +#include +#include + +int TestAsn1BerDec(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/asn1/test/TestAsn1BerEnc.c b/winpr/libwinpr/asn1/test/TestAsn1BerEnc.c new file mode 100644 index 000000000000..66568e5e6833 --- /dev/null +++ b/winpr/libwinpr/asn1/test/TestAsn1BerEnc.c @@ -0,0 +1,11 @@ + +#include +#include +#include +#include + +int TestAsn1BerEnc(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/asn1/test/TestAsn1Compare.c b/winpr/libwinpr/asn1/test/TestAsn1Compare.c new file mode 100644 index 000000000000..407e631a0cc7 --- /dev/null +++ b/winpr/libwinpr/asn1/test/TestAsn1Compare.c @@ -0,0 +1,11 @@ + +#include +#include +#include +#include + +int TestAsn1Compare(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/asn1/test/TestAsn1Decode.c b/winpr/libwinpr/asn1/test/TestAsn1Decode.c new file mode 100644 index 000000000000..6e604f3d818b --- /dev/null +++ b/winpr/libwinpr/asn1/test/TestAsn1Decode.c @@ -0,0 +1,11 @@ + +#include +#include +#include +#include + +int TestAsn1Decode(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/asn1/test/TestAsn1Decoder.c b/winpr/libwinpr/asn1/test/TestAsn1Decoder.c new file mode 100644 index 000000000000..a8ff7bc21eeb --- /dev/null +++ b/winpr/libwinpr/asn1/test/TestAsn1Decoder.c @@ -0,0 +1,11 @@ + +#include +#include +#include +#include + +int TestAsn1Decoder(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/asn1/test/TestAsn1DerDec.c b/winpr/libwinpr/asn1/test/TestAsn1DerDec.c new file mode 100644 index 000000000000..07ef107497f1 --- /dev/null +++ b/winpr/libwinpr/asn1/test/TestAsn1DerDec.c @@ -0,0 +1,11 @@ + +#include +#include +#include +#include + +int TestAsn1DerDec(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/asn1/test/TestAsn1DerEnc.c b/winpr/libwinpr/asn1/test/TestAsn1DerEnc.c new file mode 100644 index 000000000000..bfbd872b7fa3 --- /dev/null +++ b/winpr/libwinpr/asn1/test/TestAsn1DerEnc.c @@ -0,0 +1,11 @@ + +#include +#include +#include +#include + +int TestAsn1DerEnc(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/asn1/test/TestAsn1Encode.c b/winpr/libwinpr/asn1/test/TestAsn1Encode.c new file mode 100644 index 000000000000..9a1e478ea478 --- /dev/null +++ b/winpr/libwinpr/asn1/test/TestAsn1Encode.c @@ -0,0 +1,11 @@ + +#include +#include +#include +#include + +int TestAsn1Encode(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/asn1/test/TestAsn1Encoder.c b/winpr/libwinpr/asn1/test/TestAsn1Encoder.c new file mode 100644 index 000000000000..6d262cb6a989 --- /dev/null +++ b/winpr/libwinpr/asn1/test/TestAsn1Encoder.c @@ -0,0 +1,11 @@ + +#include +#include +#include +#include + +int TestAsn1Encoder(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/asn1/test/TestAsn1Integer.c b/winpr/libwinpr/asn1/test/TestAsn1Integer.c new file mode 100644 index 000000000000..ffa83cbeacfd --- /dev/null +++ b/winpr/libwinpr/asn1/test/TestAsn1Integer.c @@ -0,0 +1,11 @@ + +#include +#include +#include +#include + +int TestAsn1Integer(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/asn1/test/TestAsn1Module.c b/winpr/libwinpr/asn1/test/TestAsn1Module.c new file mode 100644 index 000000000000..3e9d1d4007ff --- /dev/null +++ b/winpr/libwinpr/asn1/test/TestAsn1Module.c @@ -0,0 +1,11 @@ + +#include +#include +#include +#include + +int TestAsn1Module(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/asn1/test/TestAsn1String.c b/winpr/libwinpr/asn1/test/TestAsn1String.c new file mode 100644 index 000000000000..c5b0577977e2 --- /dev/null +++ b/winpr/libwinpr/asn1/test/TestAsn1String.c @@ -0,0 +1,11 @@ + +#include +#include +#include +#include + +int TestAsn1String(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/handle/CMakeLists.txt b/winpr/libwinpr/handle/CMakeLists.txt index 69acd270f650..eb0a9db343d4 100644 --- a/winpr/libwinpr/handle/CMakeLists.txt +++ b/winpr/libwinpr/handle/CMakeLists.txt @@ -22,6 +22,10 @@ set(${MODULE_PREFIX}_SRCS handle.c table.c) +if(MSVC AND (NOT WITH_MONOLITHIC_BUILD)) + set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) +endif() + if(WITH_MONOLITHIC_BUILD) add_library(${MODULE_NAME} OBJECT ${${MODULE_PREFIX}_SRCS}) else() diff --git a/winpr/libwinpr/handle/module.def b/winpr/libwinpr/handle/module.def new file mode 100644 index 000000000000..5e4d32f95bc2 --- /dev/null +++ b/winpr/libwinpr/handle/module.def @@ -0,0 +1,3 @@ +LIBRARY "libwinpr-handle" +EXPORTS + diff --git a/winpr/libwinpr/interlocked/interlocked.c b/winpr/libwinpr/interlocked/interlocked.c index e1741ed452bc..2fc887fa4e7e 100644 --- a/winpr/libwinpr/interlocked/interlocked.c +++ b/winpr/libwinpr/interlocked/interlocked.c @@ -294,8 +294,6 @@ LONGLONG InterlockedCompareExchange64(LONGLONG volatile *Destination, LONGLONG E * http://msdn.microsoft.com/en-us/library/windows/hardware/ff563802/ */ -#ifndef _WIN32 - VOID InitializeListHead(PLIST_ENTRY ListHead) { ListHead->Flink = ListHead->Blink = ListHead; @@ -395,4 +393,3 @@ PSINGLE_LIST_ENTRY PopEntryList(PSINGLE_LIST_ENTRY ListHead) return FirstEntry; } -#endif diff --git a/winpr/libwinpr/interlocked/module.def b/winpr/libwinpr/interlocked/module.def index 20b5fd0553d0..160c9de80da6 100644 --- a/winpr/libwinpr/interlocked/module.def +++ b/winpr/libwinpr/interlocked/module.def @@ -1,3 +1,13 @@ LIBRARY "libwinpr-interlocked" EXPORTS InterlockedCompareExchange64 @1 + InitializeListHead @2 + IsListEmpty @3 + RemoveEntryList @4 + InsertHeadList @5 + RemoveHeadList @6 + InsertTailList @7 + RemoveTailList @8 + AppendTailList @9 + PushEntryList @10 + PopEntryList @11 diff --git a/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c b/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c index 8ab2b2982502..afabdc709f43 100644 --- a/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c +++ b/winpr/libwinpr/library/test/TestLibraryGetProcAddress.c @@ -11,7 +11,7 @@ int TestLibraryGetProcAddress(int argc, char* argv[]) char* str; int length; LPTSTR BasePath; - HINSTANCE library; + //HINSTANCE library; LPTSTR LibraryPath; str = argv[1]; diff --git a/winpr/libwinpr/pipe/CMakeLists.txt b/winpr/libwinpr/pipe/CMakeLists.txt new file mode 100644 index 000000000000..42ba8f3d3466 --- /dev/null +++ b/winpr/libwinpr/pipe/CMakeLists.txt @@ -0,0 +1,47 @@ +# WinPR: Windows Portable Runtime +# libwinpr-pipe cmake build script +# +# Copyright 2012 Marc-Andre Moreau +# +# 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-pipe") +set(MODULE_PREFIX "WINPR_PIPE") + +set(${MODULE_PREFIX}_SRCS + pipe.c) + +if(MSVC AND (NOT WITH_MONOLITHIC_BUILD)) + set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) +endif() + +if(WITH_MONOLITHIC_BUILD) + add_library(${MODULE_NAME} OBJECT ${${MODULE_PREFIX}_SRCS}) +else() + add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) +endif() + +set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib") + +if(WITH_MONOLITHIC_BUILD) + +else() + target_link_libraries(${MODULE_NAME} winpr-crt) + 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/pipe/ModuleOptions.cmake b/winpr/libwinpr/pipe/ModuleOptions.cmake new file mode 100644 index 000000000000..557e6a149d98 --- /dev/null +++ b/winpr/libwinpr/pipe/ModuleOptions.cmake @@ -0,0 +1,9 @@ + +set(MINWIN_LAYER "1") +set(MINWIN_GROUP "core") +set(MINWIN_MAJOR_VERSION "2") +set(MINWIN_MINOR_VERSION "0") +set(MINWIN_SHORT_NAME "namedpipe") +set(MINWIN_LONG_NAME "Named Pipe Functions") +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/pipe/module.def b/winpr/libwinpr/pipe/module.def new file mode 100644 index 000000000000..8c4cc1eac916 --- /dev/null +++ b/winpr/libwinpr/pipe/module.def @@ -0,0 +1,3 @@ +LIBRARY "libwinpr-pipe" +EXPORTS + diff --git a/winpr/libwinpr/pipe/pipe.c b/winpr/libwinpr/pipe/pipe.c new file mode 100644 index 000000000000..4e857730faa8 --- /dev/null +++ b/winpr/libwinpr/pipe/pipe.c @@ -0,0 +1,35 @@ +/** + * WinPR: Windows Portable Runtime + * Pipe Functions + * + * Copyright 2012 Marc-Andre Moreau + * + * 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 + +#include + +#ifndef _WIN32 + +BOOL CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize) +{ + return TRUE; +} + +#endif diff --git a/winpr/libwinpr/pipe/test/.gitignore b/winpr/libwinpr/pipe/test/.gitignore new file mode 100644 index 000000000000..5ecbf1e1e697 --- /dev/null +++ b/winpr/libwinpr/pipe/test/.gitignore @@ -0,0 +1,3 @@ +TestPipe +TestPipe.c + diff --git a/winpr/libwinpr/pipe/test/CMakeLists.txt b/winpr/libwinpr/pipe/test/CMakeLists.txt new file mode 100644 index 000000000000..9122159adcbd --- /dev/null +++ b/winpr/libwinpr/pipe/test/CMakeLists.txt @@ -0,0 +1,23 @@ + +set(MODULE_NAME "TestPipe") +set(MODULE_PREFIX "TEST_PIPE") + +set(${MODULE_PREFIX}_DRIVER ${MODULE_NAME}.c) + +set(${MODULE_PREFIX}_TESTS + TestPipeCreatePipe.c) + +create_test_sourcelist(${MODULE_PREFIX}_SRCS + ${${MODULE_PREFIX}_DRIVER} + ${${MODULE_PREFIX}_TESTS}) + +add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) + +target_link_libraries(${MODULE_NAME} winpr-pipe) + +foreach(test ${${MODULE_PREFIX}_TESTS}) + get_filename_component(TestName ${test} NAME_WE) + add_test(${TestName} ${EXECUTABLE_OUTPUT_PATH}/${MODULE_NAME} ${TestName}) +endforeach() + +set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR/Test") diff --git a/winpr/libwinpr/pipe/test/TestPipeCreatePipe.c b/winpr/libwinpr/pipe/test/TestPipeCreatePipe.c new file mode 100644 index 000000000000..4d596ed2a656 --- /dev/null +++ b/winpr/libwinpr/pipe/test/TestPipeCreatePipe.c @@ -0,0 +1,12 @@ + +#include +#include +#include +#include +#include + +int TestPipeCreatePipe(int argc, char* argv[]) +{ + return 0; +} + diff --git a/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c b/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c index cab3884c66d4..8cca3e3cc54f 100644 --- a/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c +++ b/winpr/libwinpr/sspi/test/TestEnumerateSecurityPackages.c @@ -23,7 +23,7 @@ int TestEnumerateSecurityPackages(int argc, char* argv[]) printf("\nEnumerateSecurityPackages (%d):\n", (unsigned int)cPackages); - for (index = 0; index < cPackages; index++) + for (index = 0; index < (int) cPackages; index++) { printf("\"%s\", \"%s\"\n", pPackageInfo[index].Name, pPackageInfo[index].Comment); } diff --git a/winpr/libwinpr/thread/CMakeLists.txt b/winpr/libwinpr/thread/CMakeLists.txt index 8c729f340828..66a354c5096a 100644 --- a/winpr/libwinpr/thread/CMakeLists.txt +++ b/winpr/libwinpr/thread/CMakeLists.txt @@ -27,6 +27,10 @@ set(${MODULE_PREFIX}_SRCS thread.c tls.c) +if(MSVC AND (NOT WITH_MONOLITHIC_BUILD)) + set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def) +endif() + if(WITH_MONOLITHIC_BUILD) add_library(${MODULE_NAME} OBJECT ${${MODULE_PREFIX}_SRCS}) else() diff --git a/winpr/libwinpr/thread/module.def b/winpr/libwinpr/thread/module.def new file mode 100644 index 000000000000..688109ba69c2 --- /dev/null +++ b/winpr/libwinpr/thread/module.def @@ -0,0 +1,3 @@ +LIBRARY "libwinpr-thread" +EXPORTS +