196 FIXME(
"Unsupported error code: %d\n",
err);
238 return This->mode == ForWriting ||
This->mode == ForAppending;
240 return This->mode == ForReading;
253 *
obj = &
This->ITextStream_iface;
257 *
obj = &
This->classinfo.IProvideClassInfo_iface;
301 TRACE(
"(%p)->(%u %u %p)\n",
This, iTInfo, lcid, ppTInfo);
318 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId);
327 DISPPARAMS *pDispParams,
VARIANT *pVarResult,
328 EXCEPINFO *pExcepInfo,
UINT *puArgErr)
335 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
341 pDispParams, pVarResult, pExcepInfo, puArgErr);
381 *eos =
This->size.QuadPart ==
pos.QuadPart ? VARIANT_TRUE : VARIANT_FALSE;
408 if (toread <
sizeof(
WCHAR))
409 return CTL_E_ENDOFFILE;
466 if (!
This->first_read) {
470 hr = ITextStream_get_AtEndOfStream(iface, &eos);
474 if (eos == VARIANT_TRUE)
475 return CTL_E_ENDOFFILE;
482 toread =
end.QuadPart -
start.QuadPart;
513 hr = ITextStream_get_AtEndOfStream(iface, &eos);
517 if (eos == VARIANT_TRUE)
518 return CTL_E_ENDOFFILE;
539 if (!
This->first_read) {
543 hr = ITextStream_get_AtEndOfStream(iface, &eos);
547 if (eos == VARIANT_TRUE)
548 return CTL_E_ENDOFFILE;
555 toread =
end.QuadPart -
start.QuadPart;
606 static const char crlfA[] = {
'\r',
'\n'};
736 if (
mode == ForReading)
741 if (
mode == ForWriting)
749 ITextStream_Release(&
stream->ITextStream_iface);
756 if (
format == TristateUseDefault)
764 ITextStream_Release(&
stream->ITextStream_iface);
797 *
obj = &
This->classinfo.IProvideClassInfo_iface;
841 TRACE(
"(%p)->(%u %u %p)\n",
This, iTInfo, lcid, ppTInfo);
858 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId);
867 DISPPARAMS *pDispParams,
VARIANT *pVarResult,
868 EXCEPINFO *pExcepInfo,
UINT *puArgErr)
875 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
881 pDispParams, pVarResult, pExcepInfo, puArgErr);
914 FIXME(
"(%p)->(%p): stub\n",
This, share_name);
1091 *ready =
ret ? VARIANT_TRUE : VARIANT_FALSE;
1135 This->root[0] = letter;
1136 This->root[1] =
':';
1137 This->root[2] =
'\\';
1157 IEnumVARIANT_AddRef(iface);
1182 IFolderCollection_Release(&
This->data.u.foldercoll.coll->IFolderCollection_iface);
1192 static const WCHAR allW[] = {
'*',0};
1199 if (
len && pathW[
len-1] !=
'\\')
1232 if (!celt)
return S_OK;
1264 if (
count >= celt)
break;
1282 if (!celt)
return S_OK;
1315 This->data.u.foldercoll.find =
NULL;
1348 This->data.u.foldercoll.find =
NULL;
1350 IFolderCollection_AddRef(&
collection->IFolderCollection_iface);
1366 IFileCollection_Release(&
This->data.u.filecoll.coll->IFileCollection_iface);
1386 if (!celt)
return S_OK;
1412 if (++
count >= celt)
break;
1430 if (!celt)
return S_OK;
1492 IFileCollection_AddRef(&
collection->IFileCollection_iface);
1508 IDriveCollection_Release(&
This->data.u.drivecoll.coll->IDriveCollection_iface);
1517 int i = penum->
data.u.drivecoll.cur == -1 ? 0 : penum->
data.u.drivecoll.cur + 1;
1520 if (penum->
data.u.drivecoll.coll->drives & (1 <<
i))
1522 penum->
data.u.drivecoll.cur =
i;
1539 if (!celt)
return S_OK;
1552 if (++
count >= celt)
break;
1567 if (!celt)
return S_OK;
1581 This->data.u.drivecoll.cur = -1;
1614 This->data.u.drivecoll.cur = -1;
1615 IDriveCollection_AddRef(&
collection->IDriveCollection_iface);
1634 *
obj = &
This->IFolderCollection_iface;
1638 *
obj = &
This->classinfo.IProvideClassInfo_iface;
1682 TRACE(
"(%p)->(%u %u %p)\n",
This, iTInfo, lcid, ppTInfo);
1699 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId);
1708 DISPPARAMS *pDispParams,
VARIANT *pVarResult,
1709 EXCEPINFO *pExcepInfo,
UINT *puArgErr)
1716 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1722 pDispParams, pVarResult, pExcepInfo, puArgErr);
1758 static const WCHAR allW[] = {
'\\',
'*',0};
1819 *folders = &
This->IFolderCollection_iface;
1836 *
obj = &
This->IFileCollection_iface;
1840 *
obj = &
This->classinfo.IProvideClassInfo_iface;
1884 TRACE(
"(%p)->(%u %u %p)\n",
This, iTInfo, lcid, ppTInfo);
1901 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId);
1910 DISPPARAMS *pDispParams,
VARIANT *pVarResult,
1911 EXCEPINFO *pExcepInfo,
UINT *puArgErr)
1918 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1924 pDispParams, pVarResult, pExcepInfo, puArgErr);
1953 static const WCHAR allW[] = {
'\\',
'*',0};
2013 *files = &
This->IFileCollection_iface;
2029 *
obj = &
This->IDriveCollection_iface;
2033 *
obj = &
This->classinfo.IProvideClassInfo_iface;
2074 TRACE(
"(%p)->(%u %u %p)\n",
This, iTInfo, lcid, ppTInfo);
2091 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId);
2100 DISPPARAMS *pDispParams,
VARIANT *pVarResult,
2101 EXCEPINFO *pExcepInfo,
UINT *puArgErr)
2108 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2114 pDispParams, pVarResult, pExcepInfo, puArgErr);
2203 *
obj = &
This->classinfo.IProvideClassInfo_iface;
2247 TRACE(
"(%p)->(%u %u %p)\n",
This, iTInfo, lcid, ppTInfo);
2264 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId);
2273 DISPPARAMS *pDispParams,
VARIANT *pVarResult,
2274 EXCEPINFO *pExcepInfo,
UINT *puArgErr)
2281 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2287 pDispParams, pVarResult, pExcepInfo, puArgErr);
2412 FIXME(
"(%p)->(%x): stub\n",
This, force);
2433 FIXME(
"(%p)->(%p): stub\n",
This, isroot);
2549 *
obj = &
This->classinfo.IProvideClassInfo_iface;
2599 TRACE(
"(%p)->(%u %u %p)\n",
This, iTInfo, lcid, ppTInfo);
2612 rgszNames, cNames, lcid, rgDispId);
2616 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId);
2629 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
2635 pDispParams, pVarResult, pExcepInfo, puArgErr);
2805 size.u.LowPart =
fd.nFileSizeLow;
2806 size.u.HighPart =
fd.nFileSizeHigh;
2940 TRACE(
"Interface IDispatchEx not supported - returning NULL\n");
2946 TRACE(
"Interface IObjectWithSite not supported - returning NULL\n");
2963 TRACE(
"%p\n", iface);
2970 TRACE(
"%p\n", iface);
2977 TRACE(
"(%p)->(%p)\n", iface, pctinfo);
2986 TRACE(
"(%p)->(%u %u %p)\n", iface, iTInfo, lcid, ppTInfo);
3002 hr = ITypeInfo_GetIDsOfNames(
typeinfo, rgszNames, cNames, rgDispId);
3011 DISPPARAMS *pDispParams,
VARIANT *pVarResult,
3012 EXCEPINFO *pExcepInfo,
UINT *puArgErr)
3018 lcid,
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
3024 pDispParams, pVarResult, pExcepInfo, puArgErr);
3033 TRACE(
"%p %p\n", iface, ppdrives);
3149 *pbstrResult =
NULL;
3170 *pbstrResult =
NULL;
3184 *pbstrResult =
NULL;
3205 *pbstrResult =
NULL;
3222 *pbstrResult =
NULL;
3257 static const WCHAR cur_path[] = {
'.',0};
3283 for(beg=3,
i=3;
i<=
len;
i++) {
3293 exp_len =
lstrlenW(fdata.cFileName);
3294 if(exp_len ==
i-beg)
3309 static const WCHAR fmt[] = {
'r',
'a',
'd',
'%',
'0',
'5',
'X',
'.',
't',
'x',
't',0};
3313 TRACE(
"%p %p\n", iface, pbstrResult);
3337 *pfExists = VARIANT_FALSE;
3341 driveletter =
towupper(DriveSpec[0]);
3342 if (driveletter >=
'A' && driveletter <=
'Z'
3343 && (
len < 2 || DriveSpec[1] ==
':')
3344 && (
len < 3 || DriveSpec[2] ==
'\\')) {
3345 const WCHAR root[] = {driveletter,
':',
'\\', 0};
3398 else if (
len <= 3) {
3399 driveletter =
towupper(DriveSpec[0]);
3400 if (driveletter <
'A' || driveletter >
'Z'
3401 || (
len >= 2 && DriveSpec[1] !=
':')
3402 || (
len == 3 && DriveSpec[2] !=
'\\'))
3404 hr = IFileSystem3_DriveExists(iface, DriveSpec, &drive_exists);
3407 if (drive_exists == VARIANT_FALSE)
3411 if (DriveSpec[0] !=
'\\' || DriveSpec[1] !=
'\\')
3474 case TemporaryFolder:
3477 if (
ret && pathW[
ret-1] ==
'\\')
3516 name_len =
lstrlenW(ffd.cFileName);
3574 if(ffd.cFileName[0]==
'.' && (ffd.cFileName[1]==0 ||
3575 (ffd.cFileName[1]==
'.' && ffd.cFileName[2]==0)))
3578 name_len =
lstrlenW(ffd.cFileName);
3645 DWORD src_len, dst_len, name_len;
3650 if(!
source[0] || !destination[0])
3677 src_path[src_len++] =
'\\';
3680 dst_len = destination_len;
3685 memcpy(dst_path, destination, dst_len*
sizeof(
WCHAR));
3686 if(dst_path[dst_len-1]!=
'\\' && dst_path[dst_len-1]!=
'/')
3687 dst_path[dst_len++] =
'\\';
3694 name_len =
lstrlenW(ffd.cFileName);
3699 memcpy(src_path+src_len, ffd.cFileName, (name_len+1)*
sizeof(
WCHAR));
3700 memcpy(dst_path+dst_len, ffd.cFileName, (name_len+1)*
sizeof(
WCHAR));
3704 if(!
CopyFileW(src_path, dst_path, !overwrite)) {
3731 DWORD tmp, src_len, dst_len, name_len;
3738 if(!
source[0] || !destination[0])
3741 dst_len = destination_len;
3746 if(
dst[dst_len-1]!=
'\\' &&
dst[dst_len-1]!=
'/' &&
3760 src_len = source_len;
3764 src[src_len++] =
'\\';
3779 src[src_len++] =
'\\';
3786 dst[dst_len++] =
'\\';
3792 if(ffd.cFileName[0]==
'.' && (ffd.cFileName[1]==0 ||
3793 (ffd.cFileName[1]==
'.' && ffd.cFileName[2]==0)))
3796 name_len =
lstrlenW(ffd.cFileName);
3802 dst[dst_len+name_len] = 0;
3804 src[src_len+name_len] =
'\\';
3805 src[src_len+name_len+1] =
'*';
3806 src[src_len+name_len+2] = 0;