Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
898 B

  1. //
  2. // Pei-Hwa Lin (peiwhal), July 17, 1997
  3. //
  4. #include "urltrk.h"
  5. #ifdef unix
  6. extern "C"
  7. #endif /* unix */
  8. BOOL WINAPI
  9. IsLoggingEnabledW
  10. (
  11. IN LPCWSTR pwszUrl
  12. )
  13. {
  14. DWORD cbSize;
  15. LPSTR lpUrl = NULL;
  16. BOOL bRet = FALSE;
  17. if (pwszUrl == NULL)
  18. {
  19. SetLastError(ERROR_INVALID_PARAMETER);
  20. return bRet;
  21. }
  22. cbSize = lstrlenW(pwszUrl) + sizeof(WCHAR);
  23. lpUrl = (LPSTR)LocalAlloc(LPTR, cbSize);
  24. if (!lpUrl)
  25. {
  26. SetLastError(ERROR_NOT_ENOUGH_MEMORY);
  27. return bRet;
  28. }
  29. int i=WideCharToMultiByte(CP_ACP, 0, pwszUrl, -1, lpUrl,
  30. cbSize, NULL, NULL);
  31. if (!i)
  32. {
  33. SetLastError(ERROR_NOT_ENOUGH_MEMORY);
  34. LocalFree(lpUrl);
  35. return bRet;
  36. }
  37. bRet = IsLoggingEnabledA(lpUrl);
  38. LocalFree(lpUrl);
  39. return bRet;
  40. }