Grade: B-

There’s dumb dumb and smart dumb, and director Danny Leiner has now given us both. His first movie, “Dude, Where’s My Car?” was definitely dumb squared, maybe even cubed. It thrived on stupidity, which wouldn’t have been terrible if it had possessed even a scintilla of redeeming cleverness (e.g., “Bill and Ted’s Excellent Adventure”), but it didn’t; it was pure brainlessness. There’s an in-joke about “Dude” in Leiner’s new picture, “Harold & Kumar Go to White Castle,” and it’s actually pretty good. Moreover, it’s not the only moment of genuine amusement to be found in it. “Harold & Kumar” is hardly the height of wit and sophistication, but though on the surface it just might seem a ramshackle appeal to the lowest common denominator, it’s actually a nicely constructed comedy of frustration that uses the oldest buddy combination in the business–hapless schlub and fast-talking straight man who always gets him into trouble–to refreshingly different effect, especially by giving both guys strong ethnic identities and then happily subverting the stereotypes. It’s a movie that’s smarter than it first appears.

The set-up is a simple one. Harold Lee (John Cho) and Kumar Patel (Kal Penn) are best buddies and roommates in New Jersey. The former’s a shy, reserved low-level banking employee used as a doormat by his colleagues; the latter’s a glib, fun-loving ne’er-do-well who deliberately sabotages his doctor dad’s efforts to get him into medical school by blowing off an interview with Dean Willoughby (Fred Willard). As they smoke away another Friday night in front of the tube, they get the munchies just as a commercial for White Castle comes on the screen, and decide to jump in the car and search out the burger joint. What follows is a series of farcical episodes in which they’re repeatedly prevented from reaching their goal. Some are just brief noodlings–a toll-booth contretemps, a stop at a non-WC burger joint manned by an all-too-honest clerk (Anthony Anderson). Others are repeated intrusions–periodic harassment by a bunch of loudmouthed skateboarding jerks. Still others are surrealistic Alice-in-Wonderland bits–an encounter with a racoon, another with a cheetah, an extended interlude with a ghoulish-looking but strangely friendly mechanic (Christopher Meloni), and an even more peculiar encounter with Neil Patrick Harris, playing himself as a zonked-out, oversexed celebrity. A number are just puerile excuses for the boys to stare in bug-eyed disbelief at some terrible enormity. And a few mix the bright with the decidedly not, like a stay at Princeton which includes a really sharp take-off on an Asian students group, but also a rowdily dopey bit involving a would-be drug-dealer and the campus Keystone Cops and a terrible dose of potty humor featuring two sorority-girl types; or a routine that mingles some easy jokes about dull-witted cops with some cleverly observed comments on racism (involving a sadly experienced fellow played by Gary Anthony Williams). In the process of making it through the night (and to White Castle) Harold and Kumar naturally learn important lessons about themselves–the former not only becomes assertive with his co-workers but finally gathers the courage to speak to the neighbor girl (Paula Garces) he’s long admired from afar, while the latter–after a bizarre case of mistaken identity in a hospital operating room–seems ready to try medical school for real. (Of course those skateboarders get their comeuppance, too.)

Much of this stuff is just silly in a “Dude” way, but a few of the episodes actually have some satirical bite, and they’re linked together cannily by scripters Jon Hurwitz and Hayden Schlossberg. Under Leiner’s amiably shambling direction Cho and Penn give winning performances, with Cho managing to be appealingly long-suffering without becoming utterly nerdy, and Penn keeping the con-man shtick within bounds to avoid growing as irritating as, say, Bud Abbott; each appears actually to like the other, too. In support, Meloni and Harris stand out in turns that are thoroughly unrestrained, and Willard, as always, scores with his usual befuddlement shtick. Everybody else does what’s expected of them–both actors and technical crew. The result isn’t terribly elegant, but it’s reasonably colorful and energetic.

“Harold and Kumar” doesn’t match the best examples of highway frustration comedy, but it’s closer to the Griswolds’ first road trip than to the recent “Johnson Family Vacation.” Though too scattershot and uneven to be recommended without reservation, it has a loose, goofball charm that makes it a pleasant surprise and may well earn it cult status. If you look hard you may find there’s a bit of unexpected depth to it, too.