333 int sys_islink(const char *path) { |
333 int sys_islink(const char *path) { |
334 // don't use symlinks on windows, because it is not really useful |
334 // don't use symlinks on windows, because it is not really useful |
335 // however, we interpret .lnk files as symlinks |
335 // however, we interpret .lnk files as symlinks |
336 int ret = 0; |
336 int ret = 0; |
337 |
337 |
338 scstr_t path_s = scstr(path); |
338 cxstring path_s = cx_str(path); |
339 if(scstrsuffix(path_s, SC(".lnk"))) { |
339 if(cx_strsuffix(path_s, CX_STR(".lnk"))) { |
340 // looks like a .lnk file |
340 // looks like a .lnk file |
341 // check content |
341 // check content |
342 IShellLink *sl; |
342 IShellLink *sl; |
343 HRESULT hres; |
343 HRESULT hres; |
344 hres = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLinkW, (LPVOID*)&sl); |
344 hres = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLinkW, (LPVOID*)&sl); |