Debug error when use IDiskQuotaCOntrol->FindUserName() and AddUserName()??

Hi all,
I use IDiskQuotaControl->FindUserName() and IDiskQuotaControl->AddUserName()
to add quota entry to a network shared volume for every user.
But There are miss match of the function parameters between the Visual
studio promotion and the search result of F1 help.
The Visual studio promotion after I type the funciton name and the “(” is:
///////////
HRESULT FindUserName(LPCWSTR pszDomain,
LPCWSTR pszName, PDISKQUOTA_USER **ppUser);

/////////
but when I search use F1 help:
the result is:
///////////////
HRESULT FindUserName(
LPCWSTR pszLogonName,
PDISKQUOTA_USER *ppUser
);

Then I tried the first function. compile and link ok but when execute to it,
a Debug Error! occurce:
/**************
Debug Error!
Program: ***
Module:
FIle:i386\chkesp.c
Line: 42

The value of ESP was not properly saved across a funciton call. This is
usually a result of calling a function declared with one calling convention
with a funciton pointer declared with a different calling convention.
***************************
I suspect that the error was caused by the reson that there are two
functions one is we used and can compile and link but the real function in
some dll is the other one.
But when I use the second one in code, it can not be compiled. say the this
funciton does not take two parameters.
And the same situation with the AddUserName()

Does any one know how to sovle this problem?

Thanks very much for your help.

Laura.


Post your ad for free now! http://personals.yahoo.ca

Looks like a calling convention mismatch for me.

Max

----- Original Message -----
From: “Laura Ren”
To: “File Systems Developers”
Sent: Tuesday, September 24, 2002 7:35 PM
Subject: [ntfsd] Debug error when use
IDiskQuotaCOntrol->FindUserName() and AddUserName()??

>
> Hi all,
> I use IDiskQuotaControl->FindUserName() and
IDiskQuotaControl->AddUserName()
> to add quota entry to a network shared volume for every user.
> But There are miss match of the function parameters between the
Visual
> studio promotion and the search result of F1 help.
> The Visual studio promotion after I type the funciton name and the
“(” is:
> ///////////
> HRESULT FindUserName(LPCWSTR pszDomain,
> LPCWSTR pszName, PDISKQUOTA_USER ppUser);
>
> /////////
> but when I search use F1 help:
> the result is:
> ///////////////
> HRESULT FindUserName(
> LPCWSTR pszLogonName,
> PDISKQUOTA_USER *ppUser
> );
>
> Then I tried the first function. compile and link ok but when
execute to it,
> a Debug Error! occurce:
> /

> Debug Error!
> Program:
> Module:
> FIle:i386\chkesp.c
> Line: 42
>
> The value of ESP was not properly saved across a funciton call. This
is
> usually a result of calling a function declared with one calling
convention
> with a funciton pointer declared with a different calling
convention.
>
************
> I suspect that the error was caused by the reson that there are two
> functions one is we used and can compile and link but the real
function in
> some dll is the other one.
> But when I use the second one in code, it can not be compiled. say
the this
> funciton does not take two parameters.
> And the same situation with the AddUserName()
>
> Does any one know how to sovle this problem?
>
> Thanks very much for your help.
>
> Laura.
>
>
______________________________________________________________________
>
> Post your ad for free now! http://personals.yahoo.ca
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to %%email.unsub%%
>

Laura,

you wrote on Tuesday, September 24, 2002, 17:35:31:

LR> I use IDiskQuotaControl->FindUserName() and
LR> IDiskQuotaControl->AddUserName() to add quota entry to a network
LR> shared volume for every user. But There are miss match of the
LR> function parameters between the Visual studio promotion and the
LR> search result of F1 help.

You must be using an outdated version of the Platform SDK.
IDiskQuotaControl is declared as follows in dskquota.h from XP SP1 PSDK:

//
// IDiskQuotaControl represents a disk volume, providing query and
// control of that volume’s quota information.
//
#undef INTERFACE
#define INTERFACE IDiskQuotaControl
DECLARE_INTERFACE_(IDiskQuotaControl, IConnectionPointContainer)
{
STDMETHOD(Initialize)(THIS_
LPCWSTR pszPath,
BOOL bReadWrite) PURE;

STDMETHOD(SetQuotaState)(THIS_
DWORD dwState) PURE;

STDMETHOD(GetQuotaState)(THIS_
LPDWORD pdwState) PURE;

STDMETHOD(SetQuotaLogFlags)(THIS_
DWORD dwFlags) PURE;

STDMETHOD(GetQuotaLogFlags)(THIS_
LPDWORD pdwFlags) PURE;

STDMETHOD(SetDefaultQuotaThreshold)(THIS_
LONGLONG llThreshold) PURE;

STDMETHOD(GetDefaultQuotaThreshold)(THIS_
PLONGLONG pllThreshold) PURE;

STDMETHOD(GetDefaultQuotaThresholdText)(THIS_
LPWSTR pszText,
DWORD cchText) PURE;

STDMETHOD(SetDefaultQuotaLimit)(THIS_
LONGLONG llLimit) PURE;

STDMETHOD(GetDefaultQuotaLimit)(THIS_
PLONGLONG pllLimit) PURE;

STDMETHOD(GetDefaultQuotaLimitText)(THIS_
LPWSTR pszText,
DWORD cchText) PURE;

STDMETHOD(AddUserSid)(THIS_
PSID pUserSid,
DWORD fNameResolution,
PDISKQUOTA_USER *ppUser) PURE;

STDMETHOD(AddUserName)(THIS_
LPCWSTR pszLogonName,
DWORD fNameResolution,
PDISKQUOTA_USER *ppUser) PURE;

STDMETHOD(DeleteUser)(THIS_
PDISKQUOTA_USER pUser) PURE;

STDMETHOD(FindUserSid)(THIS_
PSID pUserSid,
DWORD fNameResolution,
PDISKQUOTA_USER *ppUser) PURE;

STDMETHOD(FindUserName)(THIS_
LPCWSTR pszLogonName,
PDISKQUOTA_USER *ppUser) PURE;

STDMETHOD(CreateEnumUsers)(THIS_
PSID *rgpUserSids,
DWORD cpSids,
DWORD fNameResolution,
PENUM_DISKQUOTA_USERS *ppEnum) PURE;

STDMETHOD(CreateUserBatch)(THIS_
PDISKQUOTA_USER_BATCH *ppBatch) PURE;

STDMETHOD(InvalidateSidNameCache)(THIS) PURE;

STDMETHOD(GiveUserNameResolutionPriority)(THIS_
PDISKQUOTA_USER pUser) PURE;

STDMETHOD(ShutdownNameResolution)(THIS_
VOID) PURE;
};

typedef IDiskQuotaControl DISKQUOTA_CONTROL, *PDISKQUOTA_CONTROL;

Did you download the latest PSDK and let it integrate with VC++?

Ralf.