Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7077073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:22:39+00:00 2026-05-28T06:22:39+00:00

I’ve got a quite old VS6 app that is generating error 0x8007000E (ERROR_OUTOFMEMORY Not

  • 0

I’ve got a quite old VS6 app that is generating error 0x8007000E (ERROR_OUTOFMEMORY “Not enough storage is available to complete this operation.”) in a call to LookupAccountSid.

The call that fails is just trying to determine how large the buffers need to be to use in a second call to LookupAccountSid:

std::string GetNameFromSID(PSID pSid)
{
    if (NULL == pSid)
        return "";

    DWORD        _dwName;   //Size of the name in TCHARs
    DWORD        _dwDomain; //Size of the domain in TCHARs
    SID_NAME_USE _use;      //Usage type of the name (user,group etc).
    BOOL         _b;

    //Determine the buffer sizes we require
    SetLastError(0);
    _b = LookupAccountSid( NULL, pSid, NULL, &_dwName, NULL, &_dwDomain, &_use );
    if ( !_b ) {
        DWORD _dw = GetLastError();
        if ( ERROR_NONE_MAPPED == _dw ) {
            //There is no name for this SID
            return "";
        } else if ( ERROR_INSUFFICIENT_BUFFER == _dw ) {
            //This is expected.
        } else if ( S_OK != _dw ) {
            //This is where we see ERROR_OUTOFMEMORY
            return "";
        }
    }
    //Do some other stuff here...
}

What I expected was error 0x8007007A : ERROR_INSUFFICIENT_BUFFER “The data area passed to a system call is too small.” Which would indicate that I (unsurprisingly) needed to allocate larger buffers.

The system is not low on memory at all, so can anybody suggest a cause?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:22:40+00:00Added an answer on May 28, 2026 at 6:22 am

    See if it works if you properly initialize _dwName and _dwDomain to 0.

    There might be some random garbage on the stack, but according to http://msdn.microsoft.com/en-us/library/windows/desktop/aa379166(v=vs.85).aspx these have to be actually set to 0 to receive required buffer sizes

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
i got an object with contents of html markup in it, for example: string
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am writing an app with both english and french support. The app requests

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.