- Timestamp:
- Mar 5, 2014 6:48:59 AM (11 years ago)
- Location:
- pjproject/branches/projects/winphone
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/winphone/pjlib/include/pj/compat/os_winphone.h
r4618 r4777 22 22 23 23 /** 24 * @file os_win 32.h25 * @brief Describes Win 32operating system family specifics.24 * @file os_winphone.h 25 * @brief Describes Windows Phone operating system family specifics. 26 26 */ 27 27 … … 146 146 147 147 148 #endif /* __PJ_COMPAT_OS_WIN32_WIN CE_H__ */148 #endif /* __PJ_COMPAT_OS_WIN32_WINPHONE_H__ */ 149 149 150 /* $Id$ */151 /*152 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)153 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>154 *155 * This program is free software; you can redistribute it and/or modify156 * it under the terms of the GNU General Public License as published by157 * the Free Software Foundation; either version 2 of the License, or158 * (at your option) any later version.159 *160 * This program is distributed in the hope that it will be useful,161 * but WITHOUT ANY WARRANTY; without even the implied warranty of162 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the163 * GNU General Public License for more details.164 *165 * You should have received a copy of the GNU General Public License166 * along with this program; if not, write to the Free Software167 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA168 */169 #ifndef __PJ_COMPAT_OS_WINPHONE_H__170 #define __PJ_COMPAT_OS_WIN32_WINPHONE_H__171 172 /**173 * @file os_win32.h174 * @brief Describes Win32 operating system family specifics.175 */176 177 #define PJ_OS_NAME "winphone"178 179 #define WIN32_LEAN_AND_MEAN180 #define RPC_NO_WINDOWS_H181 #define PJ_WIN32_WINNT 0x0602 /*_WIN32_WINNT_WIN8*/182 #ifdef _WIN32_WINNT183 #undef _WIN32_WINNT184 #define _WIN32_WINNT PJ_WIN32_WINNT185 #endif186 187 #define PJ_HAS_ARPA_INET_H 0188 #define PJ_HAS_ASSERT_H 1189 #define PJ_HAS_CTYPE_H 1190 #define PJ_HAS_ERRNO_H 0 /* Must be zero, otherwise errno_test() fails. */191 #define PJ_HAS_LINUX_SOCKET_H 0192 #define PJ_HAS_MALLOC_H 1193 #define PJ_HAS_NETDB_H 0194 #define PJ_HAS_NETINET_IN_H 0195 #define PJ_HAS_NETINET_TCP_H 0196 #define PJ_HAS_SETJMP_H 1197 #define PJ_HAS_STDARG_H 1198 #define PJ_HAS_STDDEF_H 1199 #define PJ_HAS_STDIO_H 1200 #define PJ_HAS_STDLIB_H 1201 #define PJ_HAS_STRING_H 1202 #define PJ_HAS_SYS_IOCTL_H 0203 #define PJ_HAS_SYS_SELECT_H 0204 #define PJ_HAS_SYS_SOCKET_H 0205 #define PJ_HAS_SYS_TIME_H 0206 #define PJ_HAS_SYS_TIMEB_H 0 /* Doesn't have sys/timeb.h */207 #define PJ_HAS_SYS_TYPES_H 0 /* Doesn't have sys/types.h */208 #define PJ_HAS_TIME_H 1209 #define PJ_HAS_UNISTD_H 0210 211 #define PJ_HAS_MSWSOCK_H 1212 #define PJ_HAS_WINSOCK_H 0213 #define PJ_HAS_WINSOCK2_H 1214 215 #define PJ_SOCK_HAS_INET_ATON 0216 217 /* Set 1 if native sockaddr_in has sin_len member.218 * Default: 0219 */220 #define PJ_SOCKADDR_HAS_LEN 0221 222 /* Is errno a good way to retrieve OS errors? (no)223 */224 #define PJ_HAS_ERRNO_VAR 0225 226 /* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return227 * the status of non-blocking connect() operation.228 */229 #define PJ_HAS_SO_ERROR 0230 231 /* This value specifies the value set in errno by the OS when a non-blocking232 * socket recv() or send() can not return immediately.233 */234 #define PJ_BLOCKING_ERROR_VAL WSAEWOULDBLOCK235 236 /* This value specifies the value set in errno by the OS when a non-blocking237 * socket connect() can not get connected immediately.238 */239 #define PJ_BLOCKING_CONNECT_ERROR_VAL WSAEWOULDBLOCK240 241 /**242 * If this macro is set, it tells select I/O Queue that select() needs to243 * be given correct value of nfds (i.e. largest fd + 1). This requires244 * select ioqueue to re-scan the descriptors on each registration and245 * unregistration.246 * If this macro is not set, then ioqueue will always give FD_SETSIZE for247 * nfds argument when calling select().248 *249 * Default: 0250 */251 #define PJ_SELECT_NEEDS_NFDS 0252 253 /* Endianness */254 #ifndef PJ_IS_LITTLE_ENDIAN255 # define PJ_IS_LITTLE_ENDIAN 1256 # define PJ_IS_BIG_ENDIAN 0257 #endif258 259 /* Default threading is enabled, unless it's overridden. */260 #ifndef PJ_HAS_THREADS261 # define PJ_HAS_THREADS (1)262 #endif263 264 #define PJ_HAS_HIGH_RES_TIMER 1265 #define PJ_HAS_MALLOC 1266 #define PJ_OS_HAS_CHECK_STACK 1267 268 #define PJ_ATOMIC_VALUE_TYPE long269 270 /* No console. */271 #define PJ_TERM_HAS_COLOR 0272 273 /* TlsAlloc() error value. */274 #define TLS_OUT_OF_INDEXES 0xFFFFFFFF275 276 /* No rdtsc */277 #define PJ_TIMESTAMP_USE_RDTSC 0278 279 /* Native string is Unicode. */280 #define PJ_NATIVE_STRING_IS_UNICODE 1281 282 /* If 1, use Read/Write mutex emulation for platforms that don't support it */283 #define PJ_EMULATE_RWMUTEX 1284 285 /* If 1, pj_thread_create() should enforce the stack size when creating286 * threads.287 * Default: 0 (let OS decide the thread's stack size).288 */289 #define PJ_THREAD_SET_STACK_SIZE 0290 291 /* If 1, pj_thread_create() should allocate stack from the pool supplied.292 * Default: 0 (let OS allocate memory for thread's stack).293 */294 #define PJ_THREAD_ALLOCATE_STACK 0295 296 297 #endif /* __PJ_COMPAT_OS_WIN32_WINCE_H__ */298 299 /* $Id$ */300 /*301 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)302 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>303 *304 * This program is free software; you can redistribute it and/or modify305 * it under the terms of the GNU General Public License as published by306 * the Free Software Foundation; either version 2 of the License, or307 * (at your option) any later version.308 *309 * This program is distributed in the hope that it will be useful,310 * but WITHOUT ANY WARRANTY; without even the implied warranty of311 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the312 * GNU General Public License for more details.313 *314 * You should have received a copy of the GNU General Public License315 * along with this program; if not, write to the Free Software316 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA317 */318 #ifndef __PJ_COMPAT_OS_WINPHONE_H__319 #define __PJ_COMPAT_OS_WIN32_WINPHONE_H__320 321 /**322 * @file os_win32.h323 * @brief Describes Win32 operating system family specifics.324 */325 326 #define PJ_OS_NAME "winphone"327 328 #define WIN32_LEAN_AND_MEAN329 #define RPC_NO_WINDOWS_H330 #define PJ_WIN32_WINNT 0x0602 /*_WIN32_WINNT_WIN8*/331 #ifdef _WIN32_WINNT332 #undef _WIN32_WINNT333 #define _WIN32_WINNT PJ_WIN32_WINNT334 #endif335 336 #define PJ_HAS_ARPA_INET_H 0337 #define PJ_HAS_ASSERT_H 1338 #define PJ_HAS_CTYPE_H 1339 #define PJ_HAS_ERRNO_H 0 /* Must be zero, otherwise errno_test() fails. */340 #define PJ_HAS_LINUX_SOCKET_H 0341 #define PJ_HAS_MALLOC_H 1342 #define PJ_HAS_NETDB_H 0343 #define PJ_HAS_NETINET_IN_H 0344 #define PJ_HAS_NETINET_TCP_H 0345 #define PJ_HAS_SETJMP_H 1346 #define PJ_HAS_STDARG_H 1347 #define PJ_HAS_STDDEF_H 1348 #define PJ_HAS_STDIO_H 1349 #define PJ_HAS_STDLIB_H 1350 #define PJ_HAS_STRING_H 1351 #define PJ_HAS_SYS_IOCTL_H 0352 #define PJ_HAS_SYS_SELECT_H 0353 #define PJ_HAS_SYS_SOCKET_H 0354 #define PJ_HAS_SYS_TIME_H 0355 #define PJ_HAS_SYS_TIMEB_H 0 /* Doesn't have sys/timeb.h */356 #define PJ_HAS_SYS_TYPES_H 0 /* Doesn't have sys/types.h */357 #define PJ_HAS_TIME_H 1358 #define PJ_HAS_UNISTD_H 0359 360 #define PJ_HAS_MSWSOCK_H 1361 #define PJ_HAS_WINSOCK_H 0362 #define PJ_HAS_WINSOCK2_H 1363 364 #define PJ_SOCK_HAS_INET_ATON 0365 366 /* Set 1 if native sockaddr_in has sin_len member.367 * Default: 0368 */369 #define PJ_SOCKADDR_HAS_LEN 0370 371 /* Is errno a good way to retrieve OS errors? (no)372 */373 #define PJ_HAS_ERRNO_VAR 0374 375 /* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return376 * the status of non-blocking connect() operation.377 */378 #define PJ_HAS_SO_ERROR 0379 380 /* This value specifies the value set in errno by the OS when a non-blocking381 * socket recv() or send() can not return immediately.382 */383 #define PJ_BLOCKING_ERROR_VAL WSAEWOULDBLOCK384 385 /* This value specifies the value set in errno by the OS when a non-blocking386 * socket connect() can not get connected immediately.387 */388 #define PJ_BLOCKING_CONNECT_ERROR_VAL WSAEWOULDBLOCK389 390 /**391 * If this macro is set, it tells select I/O Queue that select() needs to392 * be given correct value of nfds (i.e. largest fd + 1). This requires393 * select ioqueue to re-scan the descriptors on each registration and394 * unregistration.395 * If this macro is not set, then ioqueue will always give FD_SETSIZE for396 * nfds argument when calling select().397 *398 * Default: 0399 */400 #define PJ_SELECT_NEEDS_NFDS 0401 402 /* Endianness */403 #ifndef PJ_IS_LITTLE_ENDIAN404 # define PJ_IS_LITTLE_ENDIAN 1405 # define PJ_IS_BIG_ENDIAN 0406 #endif407 408 /* Default threading is enabled, unless it's overridden. */409 #ifndef PJ_HAS_THREADS410 # define PJ_HAS_THREADS (1)411 #endif412 413 #define PJ_HAS_HIGH_RES_TIMER 1414 #define PJ_HAS_MALLOC 1415 #define PJ_OS_HAS_CHECK_STACK 1416 417 #define PJ_ATOMIC_VALUE_TYPE long418 419 /* No console. */420 #define PJ_TERM_HAS_COLOR 0421 422 /* TlsAlloc() error value. */423 #define TLS_OUT_OF_INDEXES 0xFFFFFFFF424 425 /* No rdtsc */426 #define PJ_TIMESTAMP_USE_RDTSC 0427 428 /* Native string is Unicode. */429 #define PJ_NATIVE_STRING_IS_UNICODE 1430 431 /* If 1, use Read/Write mutex emulation for platforms that don't support it */432 #define PJ_EMULATE_RWMUTEX 1433 434 /* If 1, pj_thread_create() should enforce the stack size when creating435 * threads.436 * Default: 0 (let OS decide the thread's stack size).437 */438 #define PJ_THREAD_SET_STACK_SIZE 0439 440 /* If 1, pj_thread_create() should allocate stack from the pool supplied.441 * Default: 0 (let OS allocate memory for thread's stack).442 */443 #define PJ_THREAD_ALLOCATE_STACK 0444 445 446 #endif /* __PJ_COMPAT_OS_WIN32_WINCE_H__ */447 -
pjproject/branches/projects/winphone/pjlib/src/pj/file_access_win32.c
r4629 r4777 36 36 static pj_status_t get_file_size(HANDLE hFile, pj_off_t *size) 37 37 { 38 #if defPJ_WIN32_WINPHONE39 FILE_ STANDARD_INFO fileInfo;40 41 if (GetFileInformationByHandleEx(hFile, File StandardInfo, &fileInfo,42 sizeof(FILE_ STANDARD_INFO)))38 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 39 FILE_COMPRESSION_INFO fileInfo; 40 41 if (GetFileInformationByHandleEx(hFile, FileCompressionInfo, &fileInfo, 42 sizeof(FILE_COMPRESSION_INFO))) 43 43 { 44 *size = fileInfo. AllocationSize.QuadPart;44 *size = fileInfo.CompressedFileSize.QuadPart; 45 45 } else { 46 46 *size = -1; … … 71 71 HANDLE template_file) 72 72 { 73 #if defPJ_WIN32_WINPHONE73 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 74 74 PJ_UNUSED_ARG(security_attributes); 75 75 PJ_UNUSED_ARG(flags_and_attributes); … … 216 216 HANDLE hFile; 217 217 FILETIME creationTime, accessTime, writeTime; 218 #if defPJ_WIN32_WINPHONE218 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 219 219 FILE_BASIC_INFO fileInfo; 220 220 #endif … … 234 234 return PJ_RETURN_OS_ERROR(GetLastError()); 235 235 } 236 #if defPJ_WIN32_WINPHONE236 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 237 237 if (GetFileInformationByHandleEx(hFile, FileBasicInfo, &fileInfo, 238 238 sizeof(FILE_BASIC_INFO))) -
pjproject/branches/projects/winphone/pjlib/src/pj/file_io_win32.c
r4629 r4777 89 89 dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL; 90 90 91 #if defPJ_WIN32_WINPHONE91 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 92 92 hFile = CreateFile2(PJ_STRING_TO_NATIVE(pathname, 93 93 wpathname,sizeof(wpathname)), … … 190 190 DWORD dwMoveMethod) 191 191 { 192 #if defPJ_WIN32_WINPHONE192 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 193 193 LARGE_INTEGER liDistance, liNewPos; 194 194 -
pjproject/branches/projects/winphone/pjlib/src/pj/ioqueue_select.c
r4537 r4777 880 880 pj_lock_release(ioqueue->lock); 881 881 882 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 883 count = 0; 884 __try { 885 #endif 886 882 887 count = pj_sock_select(ioqueue->nfds+1, &rfdset, &wfdset, &xfdset, 883 888 timeout); 889 890 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 891 /* Ignore Invalid Handle Exception raised by select().*/ 892 } __except(GetExceptionCode() == STATUS_INVALID_HANDLE? 893 EXCEPTION_CONTINUE_EXECUTION:EXCEPTION_CONTINUE_SEARCH) { 894 } 895 #endif 884 896 885 897 if (count == 0) -
pjproject/branches/projects/winphone/pjlib/src/pj/os_core_win32.c
r4618 r4777 39 39 #endif 40 40 41 #if PJ_WIN32_WINPHONE42 # include "../../ third_party/threademulation/include/ThreadEmulation.h"41 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 42 # include "../../../third_party/threademulation/include/ThreadEmulation.h" 43 43 #endif 44 44 … … 306 306 PJ_DEF(int) pj_thread_get_prio(pj_thread_t *thread) 307 307 { 308 #if PJ_WIN32_WINPHONE308 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 309 309 PJ_UNUSED_ARG(thread); 310 310 return -1; … … 326 326 PJ_EINVAL); 327 327 328 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 329 if (SetThreadPriorityRT(thread->hthread, prio) == FALSE) 330 #else 328 331 if (SetThreadPriority(thread->hthread, prio) == FALSE) 332 #endif 329 333 return PJ_RETURN_OS_ERROR(GetLastError()); 330 334 … … 487 491 pj_thread_t *rec; 488 492 493 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 494 PJ_UNUSED_ARG(stack_size); 495 #endif 496 489 497 PJ_CHECK_STACK(); 490 498 PJ_ASSERT_RETURN(pool && proc && thread_ptr, PJ_EINVAL); … … 521 529 rec->arg = arg; 522 530 523 #if defPJ_WIN32_WINPHONE524 rec->hthread = CreateThread (NULL, stack_size,525 thread_main, rec,526 dwflags, NULL);531 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 532 rec->hthread = CreateThreadRT(NULL, 0, 533 thread_main, rec, 534 dwflags, NULL); 527 535 #else 528 536 rec->hthread = CreateThread(NULL, stack_size, … … 562 570 PJ_ASSERT_RETURN(p, PJ_EINVAL); 563 571 572 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 573 if (ResumeThreadRT(rec->hthread) == (DWORD)-1) 574 #else 564 575 if (ResumeThread(rec->hthread) == (DWORD)-1) 576 #endif 565 577 return PJ_RETURN_OS_ERROR(GetLastError()); 566 578 else … … 606 618 PJ_LOG(6, (pj_thread_this()->obj_name, "Joining thread %s", p->obj_name)); 607 619 608 #if PJ_WIN32_WINPHONE620 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 609 621 rc = WaitForSingleObjectEx(rec->hthread, INFINITE, FALSE); 610 622 #else … … 642 654 { 643 655 PJ_CHECK_STACK(); 656 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 657 SleepRT(msec); 658 #else 644 659 Sleep(msec); 660 #endif 645 661 return PJ_SUCCESS; 646 662 } … … 836 852 //PJ_CHECK_STACK(); 837 853 854 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 855 *index = TlsAllocRT(); 856 #else 838 857 *index = TlsAlloc(); 858 #endif 839 859 840 860 if (*index == TLS_OUT_OF_INDEXES) … … 850 870 { 851 871 PJ_CHECK_STACK(); 872 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 873 TlsFreeRT(index); 874 #else 852 875 TlsFree(index); 876 #endif 853 877 } 854 878 … … 863 887 //beginning before main thread is initialized. 864 888 //PJ_CHECK_STACK(); 889 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 890 rc = TlsSetValueRT(index, value); 891 #else 865 892 rc = TlsSetValue(index, value); 893 #endif 866 894 return rc!=0 ? PJ_SUCCESS : PJ_RETURN_OS_ERROR(GetLastError()); 867 895 } … … 875 903 //by PJ_CHECK_STACK() itself!!! 876 904 //PJ_CHECK_STACK(); 905 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 906 return TlsGetValueRT(index); 907 #else 877 908 return TlsGetValue(index); 909 #endif 878 910 } 879 911 … … 884 916 PJ_CHECK_STACK(); 885 917 886 #if PJ_WIN32_WINPHONE918 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 887 919 InitializeCriticalSectionEx(&mutex->crit, 0, 0); 888 920 #elif PJ_WIN32_WINNT >= 0x0400 … … 1140 1172 1141 1173 sem = pj_pool_alloc(pool, sizeof(*sem)); 1142 #if PJ_WIN32_WINPHONE1174 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 1143 1175 /** SEMAPHORE_ALL_ACCESS **/ 1144 1176 sem->hSemaphore = CreateSemaphoreEx(NULL, initial, max, NULL, 0, … … 1177 1209 pj_thread_this()->obj_name)); 1178 1210 1179 #if PJ_WIN32_WINPHONE1211 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 1180 1212 result = WaitForSingleObjectEx(sem->hSemaphore, timeout, FALSE); 1181 1213 #else … … 1279 1311 return PJ_ENOMEM; 1280 1312 1281 #if PJ_WIN32_WINPHONE1313 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 1282 1314 event->hEvent = CreateEventEx(NULL, NULL, 1283 1315 (manual_reset?0x1:0x0)|(initial?0x2:0x0), … … 1318 1350 pj_thread_this()->obj_name)); 1319 1351 1320 #if PJ_WIN32_WINPHONE1352 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 1321 1353 result = WaitForSingleObjectEx(event->hEvent, timeout, FALSE); 1322 1354 #else … … 1380 1412 PJ_DEF(pj_status_t) pj_event_pulse(pj_event_t *event) 1381 1413 { 1382 #if defPJ_WIN32_WINPHONE1414 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 1383 1415 PJ_UNUSED_ARG(event); 1384 1416 pj_assert(!"pj_event_pulse() not supported!"); -
pjproject/branches/projects/winphone/pjlib/src/pj/os_info.c
r4629 r4777 187 187 #elif defined(_MSC_VER) 188 188 { 189 #if defPJ_WIN32_WINPHONE189 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 190 190 si.os_name = pj_str("winphone"); 191 191 #else … … 210 210 SYSTEM_INFO wsi; 211 211 212 #if defPJ_WIN32_WINPHONE212 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 213 213 GetNativeSystemInfo(&wsi); 214 214 #else … … 238 238 #endif /* PJ_WIN32_WINCE || PJ_WIN32_WINPHONE */ 239 239 } 240 #if defPJ_WIN32_WINPHONE240 #if defined(PJ_WIN32_WINPHONE) && PJ_WIN32_WINPHONE 241 241 /* Avoid compile warning. */ 242 242 goto get_sdk_info; -
pjproject/branches/projects/winphone/third_party/threademulation/include/ThreadEmulation.h
r4618 r4777 34 34 35 35 #ifdef __cplusplus 36 namespace ThreadEmulation 37 { 38 extern "C" { 36 //namespace ThreadEmulation 37 //{ 38 extern "C" 39 { 39 40 #endif 40 41 #ifndef CREATE_SUSPENDED … … 42 43 #endif 43 44 44 HANDLE WINAPI CreateThread(_In_opt_ LPSECURITY_ATTRIBUTES unusedThreadAttributes, _In_ SIZE_T unusedStackSize, _In_ LPTHREAD_START_ROUTINE lpStartAddress, _In_opt_ LPVOID lpParameter, _In_ DWORD dwCreationFlags, _Out_opt_ LPDWORD unusedThreadId); 45 HANDLE WINAPI CreateThreadRT(_In_opt_ LPSECURITY_ATTRIBUTES unusedThreadAttributes, _In_ SIZE_T unusedStackSize, _In_ LPTHREAD_START_ROUTINE lpStartAddress, _In_opt_ LPVOID lpParameter, _In_ DWORD dwCreationFlags, _Out_opt_ LPDWORD unusedThreadId); 46 DWORD WINAPI ResumeThreadRT(_In_ HANDLE hThread); 47 BOOL WINAPI SetThreadPriorityRT(_In_ HANDLE hThread, _In_ int nPriority); 48 49 VOID WINAPI SleepRT(_In_ DWORD dwMilliseconds); 45 50 46 DWORD WINAPI ResumeThread(_In_ HANDLE hThread); 47 BOOL WINAPI SetThreadPriority(_In_ HANDLE hThread, _In_ int nPriority); 48 49 VOID WINAPI Sleep(_In_ DWORD dwMilliseconds); 50 51 DWORD WINAPI TlsAlloc(); 52 BOOL WINAPI TlsFree(_In_ DWORD dwTlsIndex); 53 LPVOID WINAPI TlsGetValue(_In_ DWORD dwTlsIndex); 54 BOOL WINAPI TlsSetValue(_In_ DWORD dwTlsIndex, _In_opt_ LPVOID lpTlsValue); 51 DWORD WINAPI TlsAllocRT(); 52 BOOL WINAPI TlsFreeRT(_In_ DWORD dwTlsIndex); 53 LPVOID WINAPI TlsGetValueRT(_In_ DWORD dwTlsIndex); 54 BOOL WINAPI TlsSetValueRT(_In_ DWORD dwTlsIndex, _In_opt_ LPVOID lpTlsValue); 55 55 56 56 void WINAPI TlsShutdown(); 57 58 57 #ifdef __cplusplus 59 58 } 60 }61 59 #endif -
pjproject/branches/projects/winphone/third_party/threademulation/src/ThreadEmulation.cpp
r4618 r4777 6 6 // Copyright (c) Microsoft Corporation. All rights reserved. 7 7 8 //#include "ThreadEmulation.h"9 8 #include "../include/ThreadEmulation.h" 10 9 … … 20 19 using namespace Windows::System::Threading; 21 20 22 23 #ifdef __cplusplus 24 namespace ThreadEmulation 25 { 26 #endif 21 //namespace ThreadEmulation 22 //{ 27 23 // Stored data for CREATE_SUSPENDED and ResumeThread. 28 24 struct PendingThreadInfo … … 84 80 } 85 81 86 _Use_decl_annotations_ HANDLE WINAPI CreateThread(LPSECURITY_ATTRIBUTES unusedThreadAttributes, SIZE_T unusedStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD unusedThreadId) 82 83 _Use_decl_annotations_ HANDLE WINAPI CreateThreadRT(LPSECURITY_ATTRIBUTES unusedThreadAttributes, SIZE_T unusedStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD unusedThreadId) 87 84 { 88 85 // Validate parameters. … … 143 140 } 144 141 145 _Use_decl_annotations_ DWORD WINAPI ResumeThread(HANDLE hThread) 142 143 _Use_decl_annotations_ DWORD WINAPI ResumeThreadRT(HANDLE hThread) 146 144 { 147 145 lock_guard<mutex> lock(pendingThreadsLock); … … 176 174 177 175 178 _Use_decl_annotations_ BOOL WINAPI SetThreadPriority (HANDLE hThread, int nPriority)176 _Use_decl_annotations_ BOOL WINAPI SetThreadPriorityRT(HANDLE hThread, int nPriority) 179 177 { 180 178 lock_guard<mutex> lock(pendingThreadsLock); … … 197 195 198 196 199 _Use_decl_annotations_ VOID WINAPI Sleep (DWORD dwMilliseconds)197 _Use_decl_annotations_ VOID WINAPI SleepRT(DWORD dwMilliseconds) 200 198 { 201 199 static HANDLE singletonEvent = nullptr; … … 226 224 227 225 228 DWORD WINAPI TlsAlloc ()226 DWORD WINAPI TlsAllocRT() 229 227 { 230 228 lock_guard<mutex> lock(tlsAllocationLock); … … 243 241 244 242 245 _Use_decl_annotations_ BOOL WINAPI TlsFree (DWORD dwTlsIndex)243 _Use_decl_annotations_ BOOL WINAPI TlsFreeRT(DWORD dwTlsIndex) 246 244 { 247 245 lock_guard<mutex> lock(tlsAllocationLock); … … 273 271 274 272 275 _Use_decl_annotations_ LPVOID WINAPI TlsGetValue (DWORD dwTlsIndex)273 _Use_decl_annotations_ LPVOID WINAPI TlsGetValueRT(DWORD dwTlsIndex) 276 274 { 277 275 ThreadLocalData* threadData = currentThreadData; … … 290 288 291 289 292 _Use_decl_annotations_ BOOL WINAPI TlsSetValue (DWORD dwTlsIndex, LPVOID lpTlsValue)290 _Use_decl_annotations_ BOOL WINAPI TlsSetValueRT(DWORD dwTlsIndex, LPVOID lpTlsValue) 293 291 { 294 292 ThreadLocalData* threadData = currentThreadData; … … 355 353 } 356 354 } 357 #ifdef __cplusplus 358 } 359 #endif 355 //}
Note: See TracChangeset
for help on using the changeset viewer.