One of the nation's leading suppliers of electronic voting machines may decide against selling new equipment in North Carolina after a judge declined Monday to protect it from criminal prosecution should it fail to disclose software code as required by state law.

Diebold Inc., which makes automated teller machines and security and voting equipment, is worried it could be charged with a felony if officials determine the company failed to make all of its code — some of which is owned by third-party software firms, including Microsoft Corp. — available for examination by election officials in case of a voting mishap.

The requirement is part of the minimum voting equipment standards approved by state lawmakers earlier this year following the loss of more than 4,400 electronic ballots in Carteret County during the November 2004 election. The lost votes threw at least one close statewide race into uncertainty for more than two months.

About 20 North Carolina counties already use Diebold voting machines, and the State Board of Elections plans to announce Thursday the suppliers that meet the new standards. Local elections boards will be allowed to purchase voting machines from the approved vendors.

"We will obviously have no alternative but withdraw from the process," said Doug Hanna, a Raleigh-based lawyer representing North Canton, Ohio-based Diebold.

David Bear, a Diebold spokesman, said the company was reviewing several options after Monday's ruling.

"We're going to do what is necessary to provide what is best for our existing clients" in North Carolina, he said.

The dispute centers on the state's requirement that suppliers place in escrow "all software that is relevant to functionality, setup, configuration, and operation of the voting system," as well as a list of programmers responsible for creating the software.

That's not possible for Diebold's machines, which use Microsoft Windows, Hanna said. The company does not have the right to provide Microsoft's code, he said, adding it would be impossible to provide the names of every programmer who worked on Windows.

The State Board of Elections has told potential suppliers to provide code for all available software and explain why some is unavailable. That's not enough of an assurance for Diebold, which remains concerned about breaking a law that's punishable by a low-grade felony and a civil penalty of up to $100,000 per violation.

"You cannot have a statute that imposes a criminal violation ... without being clear about what conduct will submit you to a criminal violation," Hanna said.

But because no one has yet to accuse Diebold of breaking the law, Wake County Superior Court Judge Narley Cashwell declined to issue an injunction that would have protected the company from prosecution. Cashwell also declined to offer an interpretation of the law that would have allayed Diebold's concerns.

"We need to comply with the literal language and the statute," Cashwell said. "I don't think we have an issue here yet."

Diebold machines were blamed for voting disruptions in a California primary election last year. California has refused to certify some machines because of their malfunction rate. California officials have agreed to let a computer expert attempt to hack into Diebold machines to examine how secure they are.

On Monday, California Secretary of State Bruce McPherson said his office might seek to expand such testing to all systems seeking certification for use in California's 58 counties.

Diebold shares fell 71 cents, or 1.8 percent, to close at $38.93 Monday on the New York Stock Exchange.