Retrieve number of samples allocated by driver

I am working on application in which i am using multisampled textures. Now, i want to retrieve number of actual samples allocated by driver. for e.g. when my application asks for a 1X multisampled texture then the driver legally allocates a 2X multisampled texture how can i retrieve this number legally allocated by driver? I have searched corresponding argument with glGet but did not find the one.

Look at GL_ARB_internalformat_query2 extension.

GetTexLevelParameter(…TEXTURE_SAMPLES…), as per ARB_texture_multisample or GL3.2.

This works the same way as GetRenderbufferParameter(…RENDERBUFFER_SAMPLES…) from 2005.