Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #87355 > unrolled thread

What is a `**ppEnum`?

Started byT <T@invalid.invalid>
First post2022-11-14 00:39 -0800
Last post2022-11-19 14:16 +0100
Articles 20 on this page of 40 — 10 participants

Back to article view | Back to comp.lang.c++


Contents

  What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 00:39 -0800
    Re: What is a `**ppEnum`? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-11-14 01:29 -0800
      Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 01:46 -0800
        Re: What is a `**ppEnum`? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-11-14 01:52 -0800
          Re: What is a `**ppEnum`? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-11-14 01:55 -0800
        Re: What is a `**ppEnum`? Öö Tiib <ootiib@hot.ee> - 2022-11-14 02:30 -0800
          Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 02:38 -0800
            Re: What is a `**ppEnum`? Öö Tiib <ootiib@hot.ee> - 2022-11-14 02:48 -0800
    Re: What is a `**ppEnum`? Öö Tiib <ootiib@hot.ee> - 2022-11-14 01:39 -0800
      Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 01:48 -0800
        Re: What is a `**ppEnum`? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-11-14 02:01 -0800
        Re: What is a `**ppEnum`? Öö Tiib <ootiib@hot.ee> - 2022-11-14 02:33 -0800
          Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 02:59 -0800
            Re: What is a `**ppEnum`? Öö Tiib <ootiib@hot.ee> - 2022-11-14 03:33 -0800
              Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 11:10 -0800
            Re: What is a `**ppEnum`? Juha Nieminen <nospam@thanks.invalid> - 2022-11-16 09:47 +0000
              Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-16 15:55 -0800
                Re: What is a `**ppEnum`? scott@slp53.sl.home (Scott Lurndal) - 2022-11-17 00:19 +0000
                Re: What is a `**ppEnum`? Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2022-11-17 01:21 +0000
                  Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-16 18:01 -0800
                    Re: What is a `**ppEnum`? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-11-16 18:40 -0800
                    Re: What is a `**ppEnum`? Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2022-11-17 04:18 +0000
                Re: What is a `**ppEnum`? Juha Nieminen <nospam@thanks.invalid> - 2022-11-17 08:25 +0000
                  Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-17 00:31 -0800
                  Re: What is a `**ppEnum`? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-11-17 10:17 -0800
                Re: What is a `**ppEnum`? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-11-17 13:03 +0000
                  Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-17 10:28 -0800
            Re: What is a `**ppEnum`? Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2022-11-17 03:36 +0000
              Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-16 20:57 -0800
    Re: What is a `**ppEnum`? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-11-14 14:34 +0100
      Re: What is a `**ppEnum`? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-11-14 14:44 +0100
      Re: What is a `**ppEnum`? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-11-14 09:12 -0800
      Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-14 11:02 -0800
        Re: What is a `**ppEnum`? Ralf Fassel <ralfixx@gmx.de> - 2022-11-15 10:17 +0100
          Re: What is a `**ppEnum`? Öö Tiib <ootiib@hot.ee> - 2022-11-15 04:24 -0800
        Re: What is a `**ppEnum`? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-11-15 14:04 +0100
          Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-15 08:28 -0800
            Re: What is a `**ppEnum`? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-11-17 16:21 +0100
              Re: What is a `**ppEnum`? T <T@invalid.invalid> - 2022-11-17 16:39 -0800
                Re: What is a `**ppEnum`? "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-11-19 14:16 +0100

Page 1 of 2  [1] 2  Next page →


#87355 — What is a `**ppEnum`?

FromT <T@invalid.invalid>
Date2022-11-14 00:39 -0800
SubjectWhat is a `**ppEnum`?
Message-ID<tksuro$1nh25$1@dont-email.me>
Hi All,

I am trying to write an interface to wit Raku.
I do have a time understanding C++.

 
https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes

What is `[out] IEnumVdsObject **ppEnum`.

C++

HRESULT QueryVolumes(
   [out] IEnumVdsObject **ppEnum
);


Is this an array of 32 bit Integers?  Where is
this length?

[toc] | [next] | [standalone]


#87358

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2022-11-14 01:29 -0800
Message-ID<tkt1p5$1nno4$1@dont-email.me>
In reply to#87355
On 11/14/2022 12:39 AM, T wrote:
> Hi All,
> 
> I am trying to write an interface to wit Raku.
> I do have a time understanding C++.
> 
> 
> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes
> 
> What is `[out] IEnumVdsObject **ppEnum`.
> 
> C++
> 
> HRESULT QueryVolumes(
>    [out] IEnumVdsObject **ppEnum
> );



> 
> 
> Is this an array of 32 bit Integers?  Where is
> this length?
> 

Afaict, it means the function can store a resulting pointer in ppEnum, 
perhaps depending on HRESULT, don't know off hand.

[toc] | [prev] | [next] | [standalone]


#87360

FromT <T@invalid.invalid>
Date2022-11-14 01:46 -0800
Message-ID<tkt2q6$1no3l$1@dont-email.me>
In reply to#87358
On 11/14/22 01:29, Chris M. Thomasson wrote:
> On 11/14/2022 12:39 AM, T wrote:
>> Hi All,
>>
>> I am trying to write an interface to wit Raku.
>> I do have a time understanding C++.
>>
>>
>> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes
>>
>> What is `[out] IEnumVdsObject **ppEnum`.
>>
>> C++
>>
>> HRESULT QueryVolumes(
>>    [out] IEnumVdsObject **ppEnum
>> );
> 
> 
> 
>>
>>
>> Is this an array of 32 bit Integers?  Where is
>> this length?
>>
> 
> Afaict, it means the function can store a resulting pointer in ppEnum, 
> perhaps depending on HRESULT, don't know off handHi Chris,


I get it now.  **ppEnum is a C style pointer
to a structure defined by HSRESULT.

Now to figure out what HSRESULT is.

Thank you!

-T

[toc] | [prev] | [next] | [standalone]


#87362

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2022-11-14 01:52 -0800
Message-ID<tkt34c$1nqog$1@dont-email.me>
In reply to#87360
On 11/14/2022 1:46 AM, T wrote:
> On 11/14/22 01:29, Chris M. Thomasson wrote:
>> On 11/14/2022 12:39 AM, T wrote:
>>> Hi All,
>>>
>>> I am trying to write an interface to wit Raku.
>>> I do have a time understanding C++.
>>>
>>>
>>> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes
>>>
>>> What is `[out] IEnumVdsObject **ppEnum`.
>>>
>>> C++
>>>
>>> HRESULT QueryVolumes(
>>>    [out] IEnumVdsObject **ppEnum
>>> );
>>
>>
>>
>>>
>>>
>>> Is this an array of 32 bit Integers?  Where is
>>> this length?
>>>
>>
>> Afaict, it means the function can store a resulting pointer in ppEnum, 
>> perhaps depending on HRESULT, don't know off handHi Chris,
> 
> 
> I get it now.  **ppEnum is a C style pointer
> to a structure defined by HSRESULT.

take:

IEnumVdsObject **ppEnum

Well, that is pointer to a pointer.

So, think of: typing, please try to forgive any typos:

int a = 0;
int* p_a = &a;

int* p_b = nullptr;

int** foo = nullptr;

foo = &p_b;
*foo = &p_a;

Now p_a == p_b, the both point at a ala (&a)...

;^)

> 
> Now to figure out what HSRESULT is.
> 
> Thank you!


[toc] | [prev] | [next] | [standalone]


#87363

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2022-11-14 01:55 -0800
Message-ID<tkt3a7$1nqoe$1@dont-email.me>
In reply to#87362
On 11/14/2022 1:52 AM, Chris M. Thomasson wrote:
> On 11/14/2022 1:46 AM, T wrote:
>> On 11/14/22 01:29, Chris M. Thomasson wrote:
>>> On 11/14/2022 12:39 AM, T wrote:
>>>> Hi All,
>>>>
>>>> I am trying to write an interface to wit Raku.
>>>> I do have a time understanding C++.
>>>>
>>>>
>>>> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes
>>>>
>>>> What is `[out] IEnumVdsObject **ppEnum`.
>>>>
>>>> C++
>>>>
>>>> HRESULT QueryVolumes(
>>>>    [out] IEnumVdsObject **ppEnum
>>>> );
>>>
>>>
>>>
>>>>
>>>>
>>>> Is this an array of 32 bit Integers?  Where is
>>>> this length?
>>>>
>>>
>>> Afaict, it means the function can store a resulting pointer in 
>>> ppEnum, perhaps depending on HRESULT, don't know off handHi Chris,
>>
>>
>> I get it now.  **ppEnum is a C style pointer
>> to a structure defined by HSRESULT.
> 
> take:
> 
> IEnumVdsObject **ppEnum
> 
> Well, that is pointer to a pointer.
> 
> So, think of: typing, please try to forgive any typos:
> 
> int a = 0;
> int* p_a = &a;
> 
> int* p_b = nullptr;
> 
> int** foo = nullptr;
> 
> foo = &p_b;
> *foo = &p_a;
^^^^^^^^^^^^^^^

GOD DAMN IT!!

That should be *foo = p_a, shit. That's what I get wrt typing code into 
a damn newsreader!

So sorry for that boneheaded mistake. ;^o

> 
> Now p_a == p_b, the both point at a ala (&a)...
> 
> ;^)
> 
>>
>> Now to figure out what HSRESULT is.
>>
>> Thank you!
> 
> 
> 

[toc] | [prev] | [next] | [standalone]


#87365

FromÖö Tiib <ootiib@hot.ee>
Date2022-11-14 02:30 -0800
Message-ID<61fd85b4-b8a5-4238-94a6-f27e8d6cc9e5n@googlegroups.com>
In reply to#87360
On Monday, 14 November 2022 at 11:48:27 UTC+2, T wrote:
> On 11/14/22 01:29, Chris M. Thomasson wrote: 
> > On 11/14/2022 12:39 AM, T wrote: 
> >> Hi All, 
> >> 
> >> I am trying to write an interface to wit Raku. 
> >> I do have a time understanding C++. 
> >> 
> >> 
> >> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes 
> >> 
> >> What is `[out] IEnumVdsObject **ppEnum`. 
> >> 
> >> C++ 
> >> 
> >> HRESULT QueryVolumes( 
> >>    [out] IEnumVdsObject **ppEnum 
> >> ); 
> > 
> > 
> > 
> >> 
> >> 
> >> Is this an array of 32 bit Integers?  Where is 
> >> this length? 
> >> 
> > 
> > Afaict, it means the function can store a resulting pointer in ppEnum,
> > perhaps depending on HRESULT, don't know off handHi Chris, 
> 
> 
> I get it now. **ppEnum is a C style pointer 
> to a structure defined by HSRESULT. 
> 
> Now to figure out what HSRESULT is. 

No "HSRESULT" there. It is HRESULT. 32-bit signed integer encoding
long list of  values ... for that method the potential values are mentioned
in the very page you gave. E_INVALIDARG, E_OUTOFMEMORY,
S_OK,  VDS_E_PROVIDER_CACHE_CORRUPT.

[toc] | [prev] | [next] | [standalone]


#87367

FromT <T@invalid.invalid>
Date2022-11-14 02:38 -0800
Message-ID<tkt5qt$1o22e$1@dont-email.me>
In reply to#87365
On 11/14/22 02:30, Öö Tiib wrote:
> On Monday, 14 November 2022 at 11:48:27 UTC+2, T wrote:
>> On 11/14/22 01:29, Chris M. Thomasson wrote:
>>> On 11/14/2022 12:39 AM, T wrote:
>>>> Hi All,
>>>>
>>>> I am trying to write an interface to wit Raku.
>>>> I do have a time understanding C++.
>>>>
>>>>
>>>> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes
>>>>
>>>> What is `[out] IEnumVdsObject **ppEnum`.
>>>>
>>>> C++
>>>>
>>>> HRESULT QueryVolumes(
>>>>     [out] IEnumVdsObject **ppEnum
>>>> );
>>>
>>>
>>>
>>>>
>>>>
>>>> Is this an array of 32 bit Integers?  Where is
>>>> this length?
>>>>
>>>
>>> Afaict, it means the function can store a resulting pointer in ppEnum,
>>> perhaps depending on HRESULT, don't know off handHi Chris,
>>
>>
>> I get it now. **ppEnum is a C style pointer
>> to a structure defined by HSRESULT.
>>
>> Now to figure out what HSRESULT is.
> 
> No "HSRESULT" there. It is HRESULT. 32-bit signed integer encoding
> long list of  values ... for that method the potential values are mentioned
> in the very page you gave. E_INVALIDARG, E_OUTOFMEMORY,
> S_OK,  VDS_E_PROVIDER_CACHE_CORRUPT.


This is their list of return codes:

https://learn.microsoft.com/en-us/windows/win32/vds/virtual-disk-service-common-return-codes

I am not wrapping my head around how one crams all
those codes into one 32 bit integer.

By "32-bit signed integer", do you mean it can
have a negative value (as opposed to a cardinal)?


[toc] | [prev] | [next] | [standalone]


#87368

FromÖö Tiib <ootiib@hot.ee>
Date2022-11-14 02:48 -0800
Message-ID<c99917e7-961a-46f2-b981-0674dafc2bf1n@googlegroups.com>
In reply to#87367
On Monday, 14 November 2022 at 12:39:50 UTC+2, T wrote:
> On 11/14/22 02:30, Öö Tiib wrote: 
> > On Monday, 14 November 2022 at 11:48:27 UTC+2, T wrote: 
> >> On 11/14/22 01:29, Chris M. Thomasson wrote: 
> >>> On 11/14/2022 12:39 AM, T wrote: 
> >>>> Hi All, 
> >>>> 
> >>>> I am trying to write an interface to wit Raku. 
> >>>> I do have a time understanding C++. 
> >>>> 
> >>>> 
> >>>> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes 
> >>>> 
> >>>> What is `[out] IEnumVdsObject **ppEnum`. 
> >>>> 
> >>>> C++ 
> >>>> 
> >>>> HRESULT QueryVolumes( 
> >>>> [out] IEnumVdsObject **ppEnum 
> >>>> ); 
> >>> 
> >>> 
> >>> 
> >>>> 
> >>>> 
> >>>> Is this an array of 32 bit Integers? Where is 
> >>>> this length? 
> >>>> 
> >>> 
> >>> Afaict, it means the function can store a resulting pointer in ppEnum, 
> >>> perhaps depending on HRESULT, don't know off handHi Chris, 
> >> 
> >> 
> >> I get it now. **ppEnum is a C style pointer 
> >> to a structure defined by HSRESULT. 
> >> 
> >> Now to figure out what HSRESULT is. 
> > 
> > No "HSRESULT" there. It is HRESULT. 32-bit signed integer encoding 
> > long list of values ... for that method the potential values are mentioned 
> > in the very page you gave. E_INVALIDARG, E_OUTOFMEMORY, 
> > S_OK, VDS_E_PROVIDER_CACHE_CORRUPT.
> This is their list of return codes: 
> 
> https://learn.microsoft.com/en-us/windows/win32/vds/virtual-disk-service-common-return-codes 

Those are special values for whole subsystem. The methods return
still usually S_OK for when all is good.

> I am not wrapping my head around how one crams all 
> those codes into one 32 bit integer. 

One at time. It is return value of method. So each method
call produces only one value of HRESULT.

> By "32-bit signed integer", do you mean it can 
> have a negative value (as opposed to a cardinal)?

Yes. Basically zero is full success named S_OK, positive values are
indicating generally positive outcome and negative values are errors.
Maybe that is simpler explanation:
<https://en.wikipedia.org/wiki/HRESULT>

[toc] | [prev] | [next] | [standalone]


#87359

FromÖö Tiib <ootiib@hot.ee>
Date2022-11-14 01:39 -0800
Message-ID<cc3b22c7-20a3-403b-9e87-bdd6d75d46e1n@googlegroups.com>
In reply to#87355
On Monday, 14 November 2022 at 10:39:38 UTC+2, T wrote:
> Hi All, 
> 
> I am trying to write an interface to wit Raku. 
> I do have a time understanding C++. 
> 
> 
> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes 
> 
> What is `[out] IEnumVdsObject **ppEnum`. 

Not standard C++. The [out] is simply MS extension/notation that ppEnum is
pointer to output parameter that is pointer of interface. So pointer of pointer. 

> 
> C++ 
> 
> HRESULT QueryVolumes( 
> [out] IEnumVdsObject **ppEnum 
> ); 
> 
> 
> Is this an array of 32 bit Integers? Where is 
> this length?

No arrays there. Pointer of pointer to single interface.
It is typical MS COM interface calling concept so you use it like that:

IVdsPack* pVp = get_that_interface_from_somewhere();
IEnumVdsObject* pEvo;
HRESULT res = pVp->QueryVolumes(&pEvo);
// check if res was good and handle issues
// if good then use pEvo->methods documented there:
// <https://learn.microsoft.com/en-us/windows/win32/api/vdshwprv/nn-vdshwprv-ienumvdsobject>







[toc] | [prev] | [next] | [standalone]


#87361

FromT <T@invalid.invalid>
Date2022-11-14 01:48 -0800
Message-ID<tkt2u9$1no3l$2@dont-email.me>
In reply to#87359
On 11/14/22 01:39, Öö Tiib wrote:
> On Monday, 14 November 2022 at 10:39:38 UTC+2, T wrote:
>> Hi All,
>>
>> I am trying to write an interface to wit Raku.
>> I do have a time understanding C++.
>>
>>
>> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes
>>
>> What is `[out] IEnumVdsObject **ppEnum`.
> 
> Not standard C++. The [out] is simply MS extension/notation that ppEnum is
> pointer to output parameter that is pointer of interface. So pointer of pointer.
> 
>>
>> C++
>>
>> HRESULT QueryVolumes(
>> [out] IEnumVdsObject **ppEnum
>> );
>>
>>
>> Is this an array of 32 bit Integers? Where is
>> this length?
> 
> No arrays there. Pointer of pointer to single interface.
> It is typical MS COM interface calling concept so you use it like that:
> 
> IVdsPack* pVp = get_that_interface_from_somewhere();
> IEnumVdsObject* pEvo;
> HRESULT res = pVp->QueryVolumes(&pEvo);
> // check if res was good and handle issues
> // if good then use pEvo->methods documented there:
> // <https://learn.microsoft.com/en-us/windows/win32/api/vdshwprv/nn-vdshwprv-ienumvdsobject>

I am confused.  :'(

[toc] | [prev] | [next] | [standalone]


#87364

From"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Date2022-11-14 02:01 -0800
Message-ID<tkt3m0$1nqoe$2@dont-email.me>
In reply to#87361
On 11/14/2022 1:48 AM, T wrote:
> On 11/14/22 01:39, Öö Tiib wrote:
>> On Monday, 14 November 2022 at 10:39:38 UTC+2, T wrote:
>>> Hi All,
>>>
>>> I am trying to write an interface to wit Raku.
>>> I do have a time understanding C++.
>>>
>>>
>>> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes
>>>
>>> What is `[out] IEnumVdsObject **ppEnum`.
>>
>> Not standard C++. The [out] is simply MS extension/notation that 
>> ppEnum is
>> pointer to output parameter that is pointer of interface. So pointer 
>> of pointer.
>>
>>>
>>> C++
>>>
>>> HRESULT QueryVolumes(
>>> [out] IEnumVdsObject **ppEnum
>>> );
>>>
>>>
>>> Is this an array of 32 bit Integers? Where is
>>> this length?
>>
>> No arrays there. Pointer of pointer to single interface.
>> It is typical MS COM interface calling concept so you use it like that:
>>
>> IVdsPack* pVp = get_that_interface_from_somewhere();
>> IEnumVdsObject* pEvo;
>> HRESULT res = pVp->QueryVolumes(&pEvo);
>> // check if res was good and handle issues
>> // if good then use pEvo->methods documented there:
>> // 
>> <https://learn.microsoft.com/en-us/windows/win32/api/vdshwprv/nn-vdshwprv-ienumvdsobject>
> 
> I am confused.  :'(

int a = 0;
int* p_a = &a;
int* p_b = nullptr;

int** pp = &p_b;
*pp = p_a;

p_b == p_a

I think I got it right typing directly in the newsreader. :^)

[toc] | [prev] | [next] | [standalone]


#87366

FromÖö Tiib <ootiib@hot.ee>
Date2022-11-14 02:33 -0800
Message-ID<ff8b48f4-e2f9-4ae9-865d-7e657f4ac1c0n@googlegroups.com>
In reply to#87361
On Monday, 14 November 2022 at 11:49:12 UTC+2, T wrote:
> On 11/14/22 01:39, Öö Tiib wrote: 
> > On Monday, 14 November 2022 at 10:39:38 UTC+2, T wrote: 
> >> Hi All, 
> >> 
> >> I am trying to write an interface to wit Raku. 
> >> I do have a time understanding C++. 
> >> 
> >> 
> >> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes 
> >> 
> >> What is `[out] IEnumVdsObject **ppEnum`. 
> > 
> > Not standard C++. The [out] is simply MS extension/notation that ppEnum is 
> > pointer to output parameter that is pointer of interface. So pointer of pointer. 
> > 
> >> 
> >> C++ 
> >> 
> >> HRESULT QueryVolumes( 
> >> [out] IEnumVdsObject **ppEnum 
> >> ); 
> >> 
> >> 
> >> Is this an array of 32 bit Integers? Where is 
> >> this length? 
> > 
> > No arrays there. Pointer of pointer to single interface. 
> > It is typical MS COM interface calling concept so you use it like that: 
> > 
> > IVdsPack* pVp = get_that_interface_from_somewhere(); 
> > IEnumVdsObject* pEvo; 
> > HRESULT res = pVp->QueryVolumes(&pEvo); 
> > // check if res was good and handle issues 
> > // if good then use pEvo->methods documented there: 
> > // <https://learn.microsoft.com/en-us/windows/win32/api/vdshwprv/nn-vdshwprv-ienumvdsobject>

> I am confused. :'(

I am not psychic. Elaborate what you understand, what you do
not. Default is nothing ... but that takes about half a year of
teaching to compensate ... that we can't do in Usenet thread.

[toc] | [prev] | [next] | [standalone]


#87369

FromT <T@invalid.invalid>
Date2022-11-14 02:59 -0800
Message-ID<tkt73c$1o60i$2@dont-email.me>
In reply to#87366
On 11/14/22 02:33, Öö Tiib wrote:
> On Monday, 14 November 2022 at 11:49:12 UTC+2, T wrote:
>> On 11/14/22 01:39, Öö Tiib wrote:
>>> On Monday, 14 November 2022 at 10:39:38 UTC+2, T wrote:
>>>> Hi All,
>>>>
>>>> I am trying to write an interface to wit Raku.
>>>> I do have a time understanding C++.
>>>>
>>>>
>>>> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes
>>>>
>>>> What is `[out] IEnumVdsObject **ppEnum`.
>>>
>>> Not standard C++. The [out] is simply MS extension/notation that ppEnum is
>>> pointer to output parameter that is pointer of interface. So pointer of pointer.
>>>
>>>>
>>>> C++
>>>>
>>>> HRESULT QueryVolumes(
>>>> [out] IEnumVdsObject **ppEnum
>>>> );
>>>>
>>>>
>>>> Is this an array of 32 bit Integers? Where is
>>>> this length?
>>>
>>> No arrays there. Pointer of pointer to single interface.
>>> It is typical MS COM interface calling concept so you use it like that:
>>>
>>> IVdsPack* pVp = get_that_interface_from_somewhere();
>>> IEnumVdsObject* pEvo;
>>> HRESULT res = pVp->QueryVolumes(&pEvo);
>>> // check if res was good and handle issues
>>> // if good then use pEvo->methods documented there:
>>> // <https://learn.microsoft.com/en-us/windows/win32/api/vdshwprv/nn-vdshwprv-ienumvdsobject>
> 
>> I am confused. :'(
> 
> I am not psychic. Elaborate what you understand, what you do
> not. Default is nothing ... but that takes about half a year of
> teaching to compensate ... that we can't do in Usenet thread.


This is what I think I understand and do not.

`*` is a C pointer

`**` is a C pointer that points to another
C pointer  (AAAHHH!)

`HRESULT QueryVolume` is not `HRESULT = QueryVolume(...)`.
It is not a return value from a function.

`HRESULT` is telling me that is the structure of what
the pointer to a pointer (**ppEnum) points to.

I have no idea what `HRESULT` is. I am not sure
how this applies:
https://en.wikipedia.org/wiki/HRESULT#Data_Structure

I am after both
     VDS_E_VOLUME_NOT_HEALTHY  (0x8004243EL), and
     VDS_E_VOLUME_NOT_A_MIRROR (0x80042445L)

Does the "L" stand from 32 bit integer?  (To me,
64 bits is "Long".)

And is bit 31 is used for "Severity" it look a
lot and unsigned integer (cardinal) to me.



[toc] | [prev] | [next] | [standalone]


#87370

FromÖö Tiib <ootiib@hot.ee>
Date2022-11-14 03:33 -0800
Message-ID<0ae4c216-2ea2-4998-afcb-d10a88fb9f89n@googlegroups.com>
In reply to#87369
On Monday, 14 November 2022 at 13:00:13 UTC+2, T wrote:
> On 11/14/22 02:33, Öö Tiib wrote: 
> > On Monday, 14 November 2022 at 11:49:12 UTC+2, T wrote: 
> >> On 11/14/22 01:39, Öö Tiib wrote: 
> >>> On Monday, 14 November 2022 at 10:39:38 UTC+2, T wrote: 
> >>>> Hi All, 
> >>>> 
> >>>> I am trying to write an interface to wit Raku. 
> >>>> I do have a time understanding C++. 
> >>>> 
> >>>> 
> >>>> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes 
> >>>> 
> >>>> What is `[out] IEnumVdsObject **ppEnum`. 
> >>> 
> >>> Not standard C++. The [out] is simply MS extension/notation that ppEnum is 
> >>> pointer to output parameter that is pointer of interface. So pointer of pointer. 
> >>> 
> >>>> 
> >>>> C++ 
> >>>> 
> >>>> HRESULT QueryVolumes( 
> >>>> [out] IEnumVdsObject **ppEnum 
> >>>> ); 
> >>>> 
> >>>> 
> >>>> Is this an array of 32 bit Integers? Where is 
> >>>> this length? 
> >>> 
> >>> No arrays there. Pointer of pointer to single interface. 
> >>> It is typical MS COM interface calling concept so you use it like that: 
> >>> 
> >>> IVdsPack* pVp = get_that_interface_from_somewhere(); 
> >>> IEnumVdsObject* pEvo; 
> >>> HRESULT res = pVp->QueryVolumes(&pEvo); 
> >>> // check if res was good and handle issues 
> >>> // if good then use pEvo->methods documented there: 
> >>> // <https://learn.microsoft.com/en-us/windows/win32/api/vdshwprv/nn-vdshwprv-ienumvdsobject> 
> > 
> >> I am confused. :'( 
> > 
> > I am not psychic. Elaborate what you understand, what you do 
> > not. Default is nothing ... but that takes about half a year of 
> > teaching to compensate ... that we can't do in Usenet thread.
> This is what I think I understand and do not. 
> 
> `*` is a C pointer 
> 
> `**` is a C pointer that points to another 
> C pointer (AAAHHH!) 

Correct.

> 
> `HRESULT QueryVolume` is not `HRESULT = QueryVolume(...)`. 
> It is not a return value from a function. 

It is, QueryVolume is method of IVdsPack interface.

> 
> `HRESULT` is telling me that is the structure of what 
> the pointer to a pointer (**ppEnum) points to. 

No.
You get the value like I posted:

HRESULT res = pVp->QueryVolumes(&pEvo); 

Where pVp is pointer to IVdsPack interface.

> 
> I have no idea what `HRESULT` is. 

It is 32 bit signed integer.

> I am not sure 
> how this applies: 
> https://en.wikipedia.org/wiki/HRESULT#Data_Structure 

It is just meaning of individual bits in HRESULT value.
Those bits do not generally matter unless you want to 
make some kind of very generic handling of HRESULT
value space.

> 
> I am after both 
> VDS_E_VOLUME_NOT_HEALTHY (0x8004243EL), and 
> VDS_E_VOLUME_NOT_A_MIRROR (0x80042445L) 
> 
> Does the "L" stand from 32 bit integer? (To me, 
> 64 bits is "Long".) 

The L means signed long. MS is not caring what rest of
the world thinks, as it is very rich and powerful company.
For MS signed long is 32 bits until MS decides otherwise,
and the C++ standard allows that freedom.

> And is bit 31 is used for "Severity" it look a 
> lot and unsigned integer (cardinal) to me.

As result of  QueryVolumes you should perhaps just check
that if res == S_OK then you use gained IEnumVdsObject
interface, if not then refuse to continue with error
message. 

[toc] | [prev] | [next] | [standalone]


#87377

FromT <T@invalid.invalid>
Date2022-11-14 11:10 -0800
Message-ID<tku3ru$1qm2f$3@dont-email.me>
In reply to#87370
On 11/14/22 03:33, Öö Tiib wrote:
> On Monday, 14 November 2022 at 13:00:13 UTC+2, T wrote:
>> On 11/14/22 02:33, Öö Tiib wrote:
>>> On Monday, 14 November 2022 at 11:49:12 UTC+2, T wrote:
>>>> On 11/14/22 01:39, Öö Tiib wrote:
>>>>> On Monday, 14 November 2022 at 10:39:38 UTC+2, T wrote:
>>>>>> Hi All,
>>>>>>
>>>>>> I am trying to write an interface to wit Raku.
>>>>>> I do have a time understanding C++.
>>>>>>
>>>>>>
>>>>>> https://learn.microsoft.com/en-us/windows/win32/api/vds/nf-vds-ivdspack-queryvolumes
>>>>>>
>>>>>> What is `[out] IEnumVdsObject **ppEnum`.
>>>>>
>>>>> Not standard C++. The [out] is simply MS extension/notation that ppEnum is
>>>>> pointer to output parameter that is pointer of interface. So pointer of pointer.
>>>>>
>>>>>>
>>>>>> C++
>>>>>>
>>>>>> HRESULT QueryVolumes(
>>>>>> [out] IEnumVdsObject **ppEnum
>>>>>> );
>>>>>>
>>>>>>
>>>>>> Is this an array of 32 bit Integers? Where is
>>>>>> this length?
>>>>>
>>>>> No arrays there. Pointer of pointer to single interface.
>>>>> It is typical MS COM interface calling concept so you use it like that:
>>>>>
>>>>> IVdsPack* pVp = get_that_interface_from_somewhere();
>>>>> IEnumVdsObject* pEvo;
>>>>> HRESULT res = pVp->QueryVolumes(&pEvo);
>>>>> // check if res was good and handle issues
>>>>> // if good then use pEvo->methods documented there:
>>>>> // <https://learn.microsoft.com/en-us/windows/win32/api/vdshwprv/nn-vdshwprv-ienumvdsobject>
>>>
>>>> I am confused. :'(
>>>
>>> I am not psychic. Elaborate what you understand, what you do
>>> not. Default is nothing ... but that takes about half a year of
>>> teaching to compensate ... that we can't do in Usenet thread.
>> This is what I think I understand and do not.
>>
>> `*` is a C pointer
>>
>> `**` is a C pointer that points to another
>> C pointer (AAAHHH!)
> 
> Correct.
> 
>>
>> `HRESULT QueryVolume` is not `HRESULT = QueryVolume(...)`.
>> It is not a return value from a function.
> 
> It is, QueryVolume is method of IVdsPack interface.
> 
>>
>> `HRESULT` is telling me that is the structure of what
>> the pointer to a pointer (**ppEnum) points to.
> 
> No.
> You get the value like I posted:
> 
> HRESULT res = pVp->QueryVolumes(&pEvo);
> 
> Where pVp is pointer to IVdsPack interface.
> 
>>
>> I have no idea what `HRESULT` is.
> 
> It is 32 bit signed integer.
> 
>> I am not sure
>> how this applies:
>> https://en.wikipedia.org/wiki/HRESULT#Data_Structure
> 
> It is just meaning of individual bits in HRESULT value.
> Those bits do not generally matter unless you want to
> make some kind of very generic handling of HRESULT
> value space.
> 
>>
>> I am after both
>> VDS_E_VOLUME_NOT_HEALTHY (0x8004243EL), and
>> VDS_E_VOLUME_NOT_A_MIRROR (0x80042445L)
>>
>> Does the "L" stand from 32 bit integer? (To me,
>> 64 bits is "Long".)
> 
> The L means signed long. MS is not caring what rest of
> the world thinks, as it is very rich and powerful company.
> For MS signed long is 32 bits until MS decides otherwise,
> and the C++ standard allows that freedom.
> 
>> And is bit 31 is used for "Severity" it look a
>> lot and unsigned integer (cardinal) to me.
> 
> As result of  QueryVolumes you should perhaps just check
> that if res == S_OK then you use gained IEnumVdsObject
> interface, if not then refuse to continue with error
> message.


I just found out that `IVdsPack` also has
to be run as an administrator.  I was trying
to get Diskpart --> list volume without
being an administrator.  (Diskpart is
the only call that will give you a mirrored
volume's status.)

So I will have to run as administrator
anyway and I do not need this question
answered anymore.  I will just call Diskpart.
Poop!

Thank you all for your gracious assistance!

-T

Queries should not have to be run as administrator.
Windows is what it is.  I would not have a job
without with poor quality.

[toc] | [prev] | [next] | [standalone]


#87412

FromJuha Nieminen <nospam@thanks.invalid>
Date2022-11-16 09:47 +0000
Message-ID<tl2bj1$1en4$1@gioia.aioe.org>
In reply to#87369
T <T@invalid.invalid> wrote:
> `*` is a C pointer
> 
> `**` is a C pointer that points to another
> C pointer  (AAAHHH!)

Since pointers in C (and thus C++) can point to a single value or an
entire array of values (well, technically speaking a single value
pretty much behaves like it were an array of size 1, so one could
think that pointers *always* point to an array, even if that "array"
is just one single non-array variable), it can become confusing
quite fast when mixing these two uses. Sometimes you may have a
pointer pointing to an array of pointers. Or sometimes you may have
a pointer pointing to another pointer (which in itself might be
pointing to a single value or an array of values).

One practical example of a double pointer is the second parameter to the
strtol() function. The reason why it takes a pointer-to-a-pointer is
because it needs to be able to modify the original pointer to point
somewhere else (ie. it needs to be able to assign a new value to that
original pointer variable).

(A better solution to this would have been to make strtol() return
a struct with two values: The evaluated integer and the new end pointer.
But this design was rarely if ever used in the early days of C. There
may also be some "you don't have to pay for what you don't use" design
in play here, because if you don't need the new end pointer you can
just pass NULL as the parameter.)

[toc] | [prev] | [next] | [standalone]


#87419

FromT <T@invalid.invalid>
Date2022-11-16 15:55 -0800
Message-ID<tl3t9g$2f98u$1@dont-email.me>
In reply to#87412
On 11/16/22 01:47, Juha Nieminen wrote:
> T <T@invalid.invalid> wrote:
>> `*` is a C pointer
>>
>> `**` is a C pointer that points to another
>> C pointer  (AAAHHH!)
> 
> Since pointers in C (and thus C++) can point to a single value or an
> entire array of values (well, technically speaking a single value
> pretty much behaves like it were an array of size 1, so one could
> think that pointers *always* point to an array, even if that "array"
> is just one single non-array variable), it can become confusing
> quite fast when mixing these two uses. Sometimes you may have a
> pointer pointing to an array of pointers. Or sometimes you may have
> a pointer pointing to another pointer (which in itself might be
> pointing to a single value or an array of values).
> 
> One practical example of a double pointer is the second parameter to the
> strtol() function. The reason why it takes a pointer-to-a-pointer is
> because it needs to be able to modify the original pointer to point
> somewhere else (ie. it needs to be able to assign a new value to that
> original pointer variable).
> 
> (A better solution to this would have been to make strtol() return
> a struct with two values: The evaluated integer and the new end pointer.
> But this design was rarely if ever used in the early days of C. There
> may also be some "you don't have to pay for what you don't use" design
> in play here, because if you don't need the new end pointer you can
> just pass NULL as the parameter.)


The only thing I am not following, is how do I know the
length of each item in the array and how many items are
in the array.

[toc] | [prev] | [next] | [standalone]


#87420

Fromscott@slp53.sl.home (Scott Lurndal)
Date2022-11-17 00:19 +0000
Message-ID<I6fdL.101418$1449.67171@fx14.iad>
In reply to#87419
T <T@invalid.invalid> writes:
>On 11/16/22 01:47, Juha Nieminen wrote:
>> T <T@invalid.invalid> wrote:
>>> `*` is a C pointer
>>>
>>> `**` is a C pointer that points to another
>>> C pointer  (AAAHHH!)
>> 
>> Since pointers in C (and thus C++) can point to a single value or an
>> entire array of values (well, technically speaking a single value
>> pretty much behaves like it were an array of size 1, so one could
>> think that pointers *always* point to an array, even if that "array"
>> is just one single non-array variable), it can become confusing
>> quite fast when mixing these two uses. Sometimes you may have a
>> pointer pointing to an array of pointers. Or sometimes you may have
>> a pointer pointing to another pointer (which in itself might be
>> pointing to a single value or an array of values).
>> 
>> One practical example of a double pointer is the second parameter to the
>> strtol() function. The reason why it takes a pointer-to-a-pointer is
>> because it needs to be able to modify the original pointer to point
>> somewhere else (ie. it needs to be able to assign a new value to that
>> original pointer variable).
>> 
>> (A better solution to this would have been to make strtol() return
>> a struct with two values: The evaluated integer and the new end pointer.
>> But this design was rarely if ever used in the early days of C. There
>> may also be some "you don't have to pay for what you don't use" design
>> in play here, because if you don't need the new end pointer you can
>> just pass NULL as the parameter.)
>
>
>The only thing I am not following, is how do I know the
>length of each item in the array and how many items are
>in the array.

You keep track of how many elements you allocated when
you create the array.   As for the "size of" each
element, the 'sizeof' keyword applied to the element
will return the size, in bytes.

[toc] | [prev] | [next] | [standalone]


#87421

FromMike Terry <news.dead.person.stones@darjeeling.plus.com>
Date2022-11-17 01:21 +0000
Message-ID<ZcKdnWa04MvjEej-nZ2dnZfqnPadnZ2d@brightview.co.uk>
In reply to#87419
On 16/11/2022 23:55, T wrote:
> On 11/16/22 01:47, Juha Nieminen wrote:
>> T <T@invalid.invalid> wrote:
>>> `*` is a C pointer
>>>
>>> `**` is a C pointer that points to another
>>> C pointer  (AAAHHH!)
>>
>> Since pointers in C (and thus C++) can point to a single value or an
>> entire array of values (well, technically speaking a single value
>> pretty much behaves like it were an array of size 1, so one could
>> think that pointers *always* point to an array, even if that "array"
>> is just one single non-array variable), it can become confusing
>> quite fast when mixing these two uses. Sometimes you may have a
>> pointer pointing to an array of pointers. Or sometimes you may have
>> a pointer pointing to another pointer (which in itself might be
>> pointing to a single value or an array of values).
>>
>> One practical example of a double pointer is the second parameter to the
>> strtol() function. The reason why it takes a pointer-to-a-pointer is
>> because it needs to be able to modify the original pointer to point
>> somewhere else (ie. it needs to be able to assign a new value to that
>> original pointer variable).
>>
>> (A better solution to this would have been to make strtol() return
>> a struct with two values: The evaluated integer and the new end pointer.
>> But this design was rarely if ever used in the early days of C. There
>> may also be some "you don't have to pay for what you don't use" design
>> in play here, because if you don't need the new end pointer you can
>> just pass NULL as the parameter.)
> 
> 
> The only thing I am not following, is how do I know the
> length of each item in the array and how many items are
> in the array.

If you are still talking about

C++

HRESULT QueryVolumes(
   [out] IEnumVdsObject **ppEnum
);

then you would seem to have misunderstood Öö Tiib's point - there are no arrays anywhere in there.

I'll respond to your earlier post about which bits you understand and don't understand... (but in 
another thread I suggested that trying to use COM interfaces would require you to learn a load of 
stuff your might rather avoid, and that's exactly what you're trying to use here!)

Regards,
Mike.

[toc] | [prev] | [next] | [standalone]


#87422

FromT <T@invalid.invalid>
Date2022-11-16 18:01 -0800
Message-ID<tl44mh$2fqlq$1@dont-email.me>
In reply to#87421
On 11/16/22 17:21, Mike Terry wrote:
> C++
> 
> HRESULT QueryVolumes(
>    [out] IEnumVdsObject **ppEnum
> );

My (mis) understanding is that **ppEnum points to a
pointer that points to an array of HRESULT, which is
a 32 bit word.   Seems I don't understand.

I am expecting the result to give me a long table
of volumes.  Again, I think I misunderstand.


[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.c++


csiph-web