| 237 | } |
| 238 | |
| 239 | XnStatus XnWin32CreateKernelObjectName(XnChar* strDest, const XnUInt32 nDestLength, const XnChar* strSource, XnBool bAllowOtherUsers) |
| 240 | { |
| 241 | XnChar* pDest = strDest; |
| 242 | XnChar* pDestEnd = strDest + nDestLength; |
| 243 | |
| 244 | if (bAllowOtherUsers) |
| 245 | { |
| 246 | static const XnChar strGlobal[] = "Global\\"; |
| 247 | strcpy(strDest, strGlobal); |
| 248 | pDest = strDest + sizeof(strGlobal) - 1; |
| 249 | } |
| 250 | |
| 251 | const XnChar* pSource = strSource; |
| 252 | |
| 253 | while (pDest < pDestEnd && *pSource != '\0') |
| 254 | { |
| 255 | *pDest = *pSource == '\\' ? '_' : *pSource; |
| 256 | ++pDest; |
| 257 | ++pSource; |
| 258 | } |
| 259 | |
| 260 | if (pDest == pDestEnd) |
| 261 | { |
| 262 | xnLogWarning(XN_MASK_OS, "Event name is too long!"); |
| 263 | return XN_STATUS_ERROR; |
| 264 | } |
| 265 | |
| 266 | *pDest = '\0'; |
| 267 | |
| 268 | return (XN_STATUS_OK); |
| 269 | } |
| 270 | |
| 271 | XnStatus XnWin32GetSecurityAttributes(XnBool bAllowOtherUsers, SECURITY_ATTRIBUTES** ppSecurityAttributes) |
| 272 | { |
no outgoing calls
no test coverage detected