daily pastebin goal
52%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: shellole.cpp
  2. ===================================================================
  3. --- shellole.cpp    (revision 53821)
  4. +++ shellole.cpp    (working copy)
  5. @@ -20,6 +20,7 @@
  6.   */
  7.  
  8.  #include <precomp.h>
  9. +#include <PropIdl.h>
  10.  
  11.  WINE_DEFAULT_DEBUG_CHANNEL(shell);
  12.  
  13. @@ -580,3 +581,135 @@
  14.      GlobalUnlock(hDrop);
  15.      return i;
  16.  }
  17. +
  18. +/*************************************************************************
  19. + *  SHPropStgCreate             [SHELL32.685]
  20. + */
  21. +EXTERN_C HRESULT WINAPI SHPropStgCreate(IPropertySetStorage *psstg, REFFMTID fmtid,
  22. +         const CLSID *pclsid, DWORD grfFlags, DWORD grfMode,
  23. +         DWORD dwDisposition, IPropertyStorage **ppstg, UINT *puCodePage)
  24. +{
  25. +    PROPSPEC prop;
  26. +    PROPVARIANT ret;
  27. +    HRESULT hres;
  28. +
  29. +    TRACE("%p %s %s %x %x %x %p %p\n", psstg, debugstr_guid(&fmtid), debugstr_guid(pclsid),
  30. +        grfFlags, grfMode, dwDisposition, ppstg, puCodePage);
  31. +
  32. +    hres = psstg->Open(fmtid, grfMode, ppstg);
  33. +
  34. +     switch (dwDisposition)
  35. +     {
  36. +         case CREATE_ALWAYS:
  37. +             if (SUCCEEDED(hres))
  38. +             {
  39. +                 reinterpret_cast<IPropertyStorage*>(*ppstg)->Release();
  40. +                 hres = psstg->Delete(fmtid);
  41. +                 if(FAILED(hres))
  42. +                     return hres;
  43. +                 hres = E_FAIL;
  44. +             }
  45. +
  46. +         case OPEN_ALWAYS:
  47. +         case CREATE_NEW:
  48. +             if (FAILED(hres))
  49. +                 hres = psstg->Create(fmtid, pclsid, grfFlags, grfMode, ppstg);
  50. +
  51. +         case OPEN_EXISTING:
  52. +             if (FAILED(hres))
  53. +                 return hres;
  54. +
  55. +             if (puCodePage)
  56. +             {
  57. +                 prop.ulKind = PRSPEC_PROPID;
  58. +                 prop.propid = PID_CODEPAGE;
  59. +                 hres = reinterpret_cast<IPropertyStorage*>(*ppstg)->ReadMultiple(1, &prop, &ret);
  60. +                 if (FAILED(hres) || ret.vt!=VT_I2)
  61. +                     *puCodePage = 0;
  62. +                 else
  63. +                     *puCodePage = ret.iVal;
  64. +             }
  65. +     }
  66. +
  67. +     return S_OK;
  68. +}
  69. +
  70. +/*************************************************************************
  71. + *  SHPropStgReadMultiple       [SHELL32.688]
  72. + */
  73. +EXTERN_C HRESULT WINAPI SHPropStgReadMultiple(IPropertyStorage *pps, UINT uCodePage,
  74. +         ULONG cpspec, const PROPSPEC *rgpspec, PROPVARIANT *rgvar)
  75. +{
  76. +    STATPROPSETSTG stat;
  77. +    HRESULT hres;
  78. +
  79. +    FIXME("%p %u %u %p %p\n", pps, uCodePage, cpspec, rgpspec, rgvar);
  80. +
  81. +    memset(rgvar, 0, cpspec*sizeof(PROPVARIANT));
  82. +    hres = pps->ReadMultiple(cpspec, rgpspec, rgvar);
  83. +    if (FAILED(hres))
  84. +        return hres;
  85. +
  86. +    if (!uCodePage)
  87. +    {
  88. +        PROPSPEC prop;
  89. +        PROPVARIANT ret;
  90. +
  91. +        prop.ulKind = PRSPEC_PROPID;
  92. +        prop.propid = PID_CODEPAGE;
  93. +        hres = pps->ReadMultiple(1, &prop, &ret);
  94. +        if(FAILED(hres) || ret.vt!=VT_I2)
  95. +            return S_OK;
  96. +
  97. +        uCodePage = ret.iVal;
  98. +    }
  99. +
  100. +    hres = pps->Stat(&stat);
  101. +    if (FAILED(hres))
  102. +        return S_OK;
  103. +
  104. +    /* TODO: do something with codepage and stat */
  105. +    return S_OK;
  106. +}
  107. +
  108. +/*************************************************************************
  109. + *  SHPropStgWriteMultiple      [SHELL32.689]
  110. + */
  111. +EXTERN_C HRESULT WINAPI SHPropStgWriteMultiple(IPropertyStorage *pps, UINT *uCodePage,
  112. +         ULONG cpspec, const PROPSPEC *rgpspec, PROPVARIANT *rgvar, PROPID propidNameFirst)
  113. +{
  114. +    STATPROPSETSTG stat;
  115. +    UINT codepage;
  116. +    HRESULT hres;
  117. +
  118. +    FIXME("%p %p %u %p %p %d\n", pps, uCodePage, cpspec, rgpspec, rgvar, propidNameFirst);
  119. +
  120. +    hres = pps->Stat(&stat);
  121. +    if (FAILED(hres))
  122. +        return hres;
  123. +
  124. +    if (uCodePage && *uCodePage)
  125. +        codepage = *uCodePage;
  126. +    else
  127. +    {
  128. +        PROPSPEC prop;
  129. +        PROPVARIANT ret;
  130. +
  131. +        prop.ulKind = PRSPEC_PROPID;
  132. +        prop.propid = PID_CODEPAGE;
  133. +        hres = pps->ReadMultiple(1, &prop, &ret);
  134. +        if (FAILED(hres))
  135. +            return hres;
  136. +        if (ret.vt!=VT_I2 || !ret.iVal)
  137. +            return E_FAIL;
  138. +
  139. +        codepage = ret.iVal;
  140. +        if (uCodePage)
  141. +            *uCodePage = codepage;
  142. +    }
  143. +
  144. +    /* TODO: do something with codepage and stat */
  145. +
  146. +    hres = pps->WriteMultiple(cpspec, rgpspec, rgvar, propidNameFirst);
  147. +    return hres;
  148. +}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top