Changeset 928 for branches/client-3.0/src/ndpsmb.c
- Timestamp:
- Jul 24, 2016, 11:34:45 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/client-3.0/src/ndpsmb.c
r818 r928 163 163 #define LEAVE() do { /* nothing */ } while (0) 164 164 #endif 165 166 int helperEASet (cli_state *cli, FEALIST *pFEAList, char *path) 167 { 168 int rc = 0; 169 170 if (!path || !pFEAList || pFEAList->cbList <= sizeof(long)) 171 { 172 return ERROR_EAS_NOT_SUPPORTED; 173 } 174 175 ENTER(); 176 177 do { 178 // got FEA there 179 FEA * pfea; 180 unsigned long done = sizeof(long); 181 pfea = pFEAList->list; 182 while (done < pFEAList->cbList) 183 { 184 rc = smbwrp_setea(cli, path, (char*)(pfea + 1), pfea->cbValue ? (char *)(pfea + 1) + pfea->cbName + 1: NULL, pfea->cbValue); 185 if (rc) 186 { 187 break; 188 } 189 pfea = (FEA *)((char *)(pfea + 1) + pfea->cbName + 1 + pfea->cbValue); 190 done += sizeof(FEA) + pfea->cbName + 1 + pfea->cbValue; 191 } 192 } while (0); 193 LEAVE(); 194 return rc; 195 } 165 196 166 197 int APIENTRY NdpPluginLoad (PLUGINHELPERTABLE2L *pPHT) … … 1358 1389 debuglocal(9,"NdpEASet in [%p]\n", pConn); 1359 1390 1360 if (!pfi || !pfi->pszName || !pFEAList || pFEAList->cbList <= sizeof(long))1391 if (!pfi || !pfi->pszName) 1361 1392 { 1362 1393 return ERROR_EAS_NOT_SUPPORTED; … … 1374 1405 } 1375 1406 1376 ENTER();1377 1378 1407 finfo = (smbwrp_fileinfo *)fdata.pData; 1379 1408 path = finfo->fname; 1380 1409 1381 do { 1382 // got FEA there 1383 FEA * pfea; 1384 unsigned long done = sizeof(long); 1385 pfea = pFEAList->list; 1386 while (done < pFEAList->cbList) 1387 { 1388 rc = smbwrp_setea(pConn->cli, path, (char*)(pfea + 1), pfea->cbValue ? (char *)(pfea + 1) + pfea->cbName + 1: NULL, pfea->cbValue); 1389 if (rc) 1390 { 1391 break; 1392 } 1393 pfea = (FEA *)((char *)(pfea + 1) + pfea->cbName + 1 + pfea->cbValue); 1394 done += sizeof(FEA) + pfea->cbName + 1 + pfea->cbValue; 1395 } 1396 } while (0); 1410 rc = helperEASet(pConn->cli, pFEAList, path); 1397 1411 debuglocal(9,"NdpEASet %d\n", rc); 1398 LEAVE();1399 1412 return rc; 1400 1413 } … … 1554 1567 Resource *pRes = pConn->pRes; 1555 1568 int rc = 0; 1569 int rcEASet = 0; 1556 1570 unsigned long action; 1557 1571 char path[CCHMAXPATH+1] = {0}; … … 1572 1586 rc = smbwrp_mkdir(pConn->cli, path); 1573 1587 } while (0); 1574 debuglocal(9,"NdpCreateDir <%s> (%s) %d\n", szDirName, path, rc); 1575 LEAVE(); 1588 LEAVE(); 1589 1590 if (path && pRes->easupport) 1591 { 1592 rcEASet = helperEASet(pConn->cli, pFEAList, path); 1593 } 1594 debuglocal(9,"NdpCreateDir <%s> (%s) rc=%d, EASupport=%s rc=%d\n", szDirName, path, rc, pRes->easupport?"yes":"no", rcEASet); 1595 1576 1596 return rc; 1577 1597 }
Note:
See TracChangeset
for help on using the changeset viewer.