ExtendedInfo.cpp 675 B

1234567891011121314151617181920212223242526272829
  1. #include <bfc/platform/types.h>
  2. #include <windows.h>
  3. #include <strsafe.h>
  4. #include "api__in_flv.h"
  5. #include "resource.h"
  6. extern "C" __declspec(dllexport)
  7. int winampGetExtendedFileInfoW(const wchar_t *fn, const char *data, wchar_t *dest, size_t destlen)
  8. {
  9. if (!_stricmp(data, "type"))
  10. {
  11. dest[0]='1';
  12. dest[1]=0;
  13. return 1;
  14. }
  15. else if (!_stricmp(data, "family"))
  16. {
  17. int len;
  18. const wchar_t *p;
  19. if (!fn || !fn[0]) return 0;
  20. len = lstrlenW(fn);
  21. if (len < 4 || L'.' != fn[len - 4]) return 0;
  22. p = &fn[len - 3];
  23. if (!_wcsicmp(p, L"FLV") && S_OK == StringCchCopyW(dest, destlen, WASABI_API_LNGSTRINGW(IDS_FAMILY_STRING))) return 1;
  24. return 0;
  25. }
  26. return 0;
  27. }